source: Hardware/WARP_v3/Rev1.1/Config_CPLD/src/spi_boot_OpenCores_src/README

Last change on this file was 1799, checked in by murphpo, 12 years ago

Adding WARP v3 hardware files (schematics, FPGA pinout, configuration CPLD source)

File size: 5.9 KB
Line 
1
2README for the spi_boot core
3============================
4Version: $Id: README 77 2009-04-01 19:53:14Z arniml $
5
6
7Description
8-----------
9
10The SD/MMC Bootloader is a CPLD design that manages configuration and
11bootstrapping of FPGAs. It is able to retrieve the required data from
12SecureDigital (SD) cards or MultiMediaCards (MMC) and manages the FPGA
13configuration process. SD cards as well as MMCs are operated in SPI mode which
14is part of both standards thus eliminating the need for dedicated
15implementations. The SD/MMC Bootloader fits both. Beyond configuration, this
16core supports a bootstrapping strategy where multiple images are stored on one
17single memory card.
18For example consider a system completely based on SRAM. The bootloader
19provides the initial configuration data from the first image to the FPGA. This
20image contains a design which pulls the next image from the memory card and
21transfers this data to SRAM. In the third step the final FPGA design is loaded
22from the third image.
23These images are clustered in sets which can be selected by external switches
24for example. Several configuration sets can be stored on one memory card
25allowing you to provide a number of applications which are downloaded quickly
26to the FPGA.
27The schematic (rev. B) shows how the core can be used with an FPGA board. I
28use it to configure/boot the Xilinx Spartan IIe on BurchED's B5-X300
29board. SV2 fits the "SERIAL MODE" connector on this board but you will have to
30add a separate wire from R6 to attach INIT. Please check the proper use of the
31pull-up resistors for your specific board.
32
33
34Features
35--------
36
37* Configuration mode: configures SRAM based FPGAs via slave serial mode
38  (Xilinx and Altera)
39* Data mode: provides stored data over a simple synchronous serial interface
40* Broad compatability using SPI mode
41    + SecureDigital cards using dedicated initialization command
42    + MultiMediaCards (see below)
43* Operation triggerd by power-up or card insertion
44* Multiple configuration sets stored on on single memory card
45
46
47Compatability
48-------------
49
50These cards have been tested with the SD/MMC Bootloader:
51
52  * Hama 64 MB SD
53  * SanDisk 128 MB SD
54  * SanDisk 64 MB MMC
55  * Panasonic 32 MB SD
56
57Some MMC might fail with this core as not all cards support CMD18
58(READ_MULTIPLE_BLOCK). Please consult the data sheet of your specific
59model. In case your MMC does not implement CMD18 you might want to have a look
60at the FPGA MMC-Card Config project.
61
62
63Tools
64-----
65
66Downloading the configuration data to the card is a straight forward
67process. The images have to be written starting at dedicated locations. For
68the provided toplevel designs, these locations are multiples of 256 K. I.e. 0,
690x40000, 0x80000 and so forth.
70
71dd (part of the GNU coreutils) serves this purpose:
72$ dd if=ram_loader.bin of=/dev/sdX bs=512
73$ dd if=pongrom_6.bin of=/dev/sdX bs=512 seek=512
74$ dd if=pacman.bin of=/dev/sdX bs=512 seek=1024
75
76The name of the device node depends on how the card reader is attached to the
77kernel. For Linux systems this is most often something like /dev/sdX with X
78ranging from a-z. Please note that it is essential to use the device without
79any trailing numbers as they refer to partitions leading to wrong offsets for
80data written to the card.
81All this works perfectly for my Spartan IIe device as this FPGA expects the
82configuration data as it is delivered from the card: Consecutive bytes each
83with its most significant bit first. Altera devices like the FLEX family are
84different here. They expect the bytes with least significant bit
85first. Therefore, the configuration data has to be swapped bitwise before it
86is written to the card. Michael Libeskind kindly provided a program that
87accimplishes this task. Find it in sw/misc/bit_reverse.c.
88
89
90Verification
91------------
92
93The spi_boot core comes with a simple testbench that simulates an SD/MMC
94card. All four implementations of the core are verified there in parallel
95while transferring the data for several sets.
96You should normally not need to run the testbench. But in case you modified
97the VHDL code the testbench gives some hints if the design has been broken.
98
99
100Directory Structure
101-------------------
102
103The core's directory structure follows the proposal of OpenCores.org.
104
105spi_boot
106 |
107 \--+-- doc                 : Documentation
108    |    |
109    |    \-- src            : Source files of documentation
110    |
111    +-- rtl
112    |    |
113    |    \-- vhdl           : VHDL code containing the RTL description
114    |                         of the core.
115    |
116    +-- bench
117    |    |
118    |    \-- vhdl           : VHDL testbench code.
119    |
120    \-- sim
121         |
122         \-- rtl_sim        : Directory for running simulations.
123
124
125RAM Loader
126----------
127
128Directory rtl/vhdl/ram_loader contains the sample design which loads the next
129image from the card and stores its contents to external asynchronous
130RAM. After reading 64 KB it triggers a new configuration process for the final
131FPGA design.
132Refer to the code for the mechanisms involved.
133
134
135Compiling the VHDL Code
136-----------------------
137
138VHDL compilation and simulation tasks take place inside in sim/rtl_sim
139directory. The project setup supports only the GHDL simulator (see
140http://ghdl.free.fr).
141
142To compile the code simply type at the shell
143
144$ make
145
146This should result in a file called tb_behav_c0 which can be executed as any
147other executable.
148
149The basic simple sequence list can be found in COMPILE_LIST. This can be
150useful to quickly set up the analyze stage of any compiler or
151synthesizer. Especially when synthesizing the code, you want to skip the VHDL
152configurations in *-c.vhd and everything below the bench/ directory.
153
154
155References
156----------
157
158  * SanDisk SD Card Product Manual
159    http://www.sandisk.com/pdf/oem/ProdManualSDCardv1.9.pdf
160
161  * SanDisk MMC Product Manual
162    http://www.sandisk.com/pdf/oem/manual-rs-mmcv1.0.pdf
163
164  * Toshiba SD Card Specification
165    http://i.cmpnet.com/chipcenter/memory/images/prod055.pdf
166
167  * BurchED
168    http://burched.biz/
169
170  * FPGA MMC-Card Config project
171    http://www.opencores.org/projects.cgi/web/mmcfpgaconfig/overview
Note: See TracBrowser for help on using the repository browser.