by David Baird <dbaird+edkhowto@nmt.edu>
$Id:$
This HOWTO is written for:
Xilinx EDK (Embedded Development Kit) version 8.2i (This is commercial software and must be purchased. Sorry... But, at least it runs in Linux!)
Xilinx ISE version 8.2i
- There is a free version called WebPack which supports the lower-end devices (including the XC4VFX12 found on the ML403 evaluation board)
- There is also a pay version which supports higher-end devices
The Xilinx ML403 Version 1 evaluation board
The Xilinx ML403 board is assumed to be connected to a computer via JTAG and RS-232 serial. In this particular scenario, the Platform Cable USB (the 70mA low power version) Model DLC9LP is being used.
- As of this writing (20061102), the JTAG Xilinx Plaform Cable USB is poorly supported under Linux despite claims made by Xilinx to the contrary (see Usenet posts (FIXME)). This is confirmed by my own tests under Gentoo Linux. Therefore, and much to my regret, it is assumed that you will be connecting this cable to a computer running the Windows, or compatible, operating system.
Operating System: Xilinx ISE and Xilinx EDK can both run on Windows or Linux (FIXME: are there any libc requirements?)
If you do not meet these requirements, your mileage may vary :-)
This document explains how to integrate the single-precision (32-bit) APU FPU [APU_FPU] into the Virtex-4 XC4VFX12-FF668-10C (668 pins, speed grade 10) chip found on the ML403 evaluation board. Circa 20061102, the ML403 board can be purchased for around $500 (USD) and includes:
The kit does not include other useful items, such as:
An overview of the Virtex-4 devices is presented in [DS112]. More detailed information about the Virtex-4 architecture is presented in [UG070]. The XC4VFX12 is the lowest-end model of the VFX family of devices and the the APU FPU consumes roughly 1/4 of its resources, as discussed in sectionResources.
FIXME: pictures?
Because no one else wrote one yet (I was unable to find some via Google). Xilinx provides documentation and example projects which leaves something to be desired. The documentation leaves out important information and warnings for newbies (such as how to check resource utilization, e.g. to resolve conflicts with over-utilization of BRAM). And the example projects - the examples I found just simply did not work. Also, discovering that the Xilinx Platform Cable USB did not work under Linux was a disappointment for me, and I just wanted to warn other people in advance (if I am wrong about this, please correct me).
To resolve these issues, I have clearly indicated what system I am using and what software versions I am using. If anyone uses this tutorial on a different version or platform, please let me know and I will update this document.
How to create a new project using "Base System Builder:"
Open Xilinx Platform Studio ("xps" for short)
Create a new project and call it something like hello_fpu
Choose option "I would like to create a new design" (versus "I would like to load an existing .bsb file")
Choose your device:
- Board vendor: Xilinx
- Board name: Virtex 4 ML403 Evaluation Platform
- Board revisions: 1
Now a "wizard" will be presented that allows the Virtex-4 to be configured with a variety of peripherals:
FPGA:
- Architecture: virtex4
- Device: xc4vfx12
- Package: ff668
- Speed grade: -10
Processor: PowerPC (versus MicroBlaze) (NOTE: the PowerPC is built-in to the Virtex-II Pro and Virtex-4 FX devices)
Configure the PowerPC:
- Reference clock frequency: 100 MHz
- Processor clock frequency: 100 MHz (up to 300 MHz) (WARNING: the FPU can only operate up to 100 MHz [APU_FPU], therefore a clock divider/multiplier must be used if the CPU and FPU are running at different frequencies)
- Debug I/F: JTAG
- OCM Data: 0 kB (on-chip memory - uses "BRAM", see the note just a little further down the list about BRAM, and why this is currently set to 0)
- OCM Instruction: 0 kB
- Cache setup: Disable
Configure other peripherals as desired (RS232_Uart, LEDs_4Bit, LEDs_Positions, DDR_SDRAM_64Mx32, Ethernet_MAC, SRAM_256Kx32, plb_bram_if_cntlr_1, and other peripherals such as OPB TIMER)
- WARNING: When configuring plb_bram_if_cntrl_1, be conservative. Do not go above 64 kB (for the XC4VF12), otherwise the APU FPU might not fit into the FPGA fabric. This is because the amount of BRAM is limited. This size can be changed later if desired (how?).
Set STDIN and STDOUT to RS232_Uart
Enable sample applications (if desired):
- Memory test
- Peripheral selftest
- For each program, use SRAM_256Kx32 for the Instruction, Data, and Stack/Heap sections. This can be changed later if desired (see sectionLinkerScript).
Click "Generate" and then proceed to the next section of this document. (you are now finished creating a new project)
This is explained in [APU_FPU], but for completeness, the steps are explained again here:
Find the IP Catalog and System Assembly View tabs (Have fun finding it! GUI's are so wonderful!)
Drag Arithmetic -> apu_fpu (version 2.10.a) from IP Catalog to System Assembly View
Drag Bus -> fcb_v10 (version 1.00.a) from IP Catalog to System Assembly View
Connect ppc405_0 and apu_fpu_0 to the FCB bus (by clicking the corresponding icons until they are solid)
In System Assembly View, switch to the "Ports" filter (this will show you what ports on each module are connected to which nets)
Connect to fcb_v10_0 FCB_CLK to sys_clk_s
Connect to fcb_v10_0 SYS_RST to sys_bus_reset
NOTE: Each of these settings corresponds to the MHS file (e.g. hello_fpu.mhs in this HOWTO). As such, you can either edit the MHS file, or you can use the System Assembly View GUI. Here's an example snippit from the MHS file (I have no idea why it says fcb_v10 here and fcb_v10_0 in the GUI - does it really matter?):
BEGIN fcb_v10 PARAMETER INSTANCE = fcb_v10_0 PARAMETER HW_VER = 1.00.a PORT FCB_CLK = sys_clk_s PORT SYS_RST = sys_bus_reset ENDNOTE: The FPU maximum clock is ~ 100 MHz. Make sure that the choice for FCB_CLK does not exceed this.
Switch the System Assembly View filter to Bus Interface. Edit the properties of ppc405_0 and set APU -> C_APU_CONTROL to 0b0000000000000001 (the original value is possibly 0b1101111000000000) (FIXME: what does this actually mean? link to docs?)
Check to make sure the design fits i7to the FPGA by compiling it:
- Hardware -> Generate Netlist
- Hardware -> Generate Bitstream
- (if any the log window reports any errors caused by peripherals, such as Ethernet_MAC or DDR_SDRAM_64Mx32, perhaps consider removing that peripheral and then dealing with it later)
''xps'' links to (according to ''ldd''):
ldd `which xps` # >>> linux-gate.so.1 => (0xffffe000) libdl.so.2 => /lib/libdl.so.2 (0x40018000) libpthread.so.0 => /lib/libpthread.so.0 (0x4001c000) libstdc++.so.5 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/libstdc++.so.5 (0x4006e000) libm.so.6 => /lib/libm.so.6 (0x40128000) libgcc_s.so.1 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/libgcc_s.so.1 (0x4014b000) libc.so.6 => /lib/libc.so.6 (0x40153000) /lib/ld-linux.so.2 (0x40000000)
''ise'' is apparently staticly linked (good, I think: we don't have to worry about "Redhat syndrome"):
ldd `which ise`
# >>>
not a dynamic executable
Try out other cores...
| [DS112] | http://www.xilinx.com/bvdocs/publications/ds112.pdf Xilinx DS112 Virtex-4 Overview |
| [UG070] | http://www.xilinx.com/bvdocs/userguides/ug070.pdf UG070 Xilinx Virtex-4 User Guide |
| [APU_FPU] | (1, 2, 3) http://www.xilinx.com/bvdocs/ipcenter/data_sheet/apu_fpu.pdf APU Floating-Point Unit v2.0 Product Specification |