Subversion Repositories spi_boot
[/] [spi_boot/] [tags/] [rel_3_2_rev_C/] [README] - Rev 74
Compare with Previous | Blame | View Log
README for the spi_boot core============================Version: $Date: 2007-08-08 22:55:46 $$Name: not supported by cvs2svn $Description-----------The SD/MMC Bootloader is a CPLD design that manages configuration andbootstrapping of FPGAs. It is able to retrieve the required data fromSecureDigital (SD) cards or MultiMediaCards (MMC) and manages the FPGAconfiguration process. SD cards as well as MMCs are operated in SPI mode whichis part of both standards thus eliminating the need for dedicatedimplementations. The SD/MMC Bootloader fits both. Beyond configuration, thiscore supports a bootstrapping strategy where multiple images are stored on onesingle memory card.For example consider a system completely based on SRAM. The bootloaderprovides the initial configuration data from the first image to the FPGA. Thisimage contains a design which pulls the next image from the memory card andtransfers this data to SRAM. In the third step the final FPGA design is loadedfrom the third image.These images are clustered in sets which can be selected by external switchesfor example. Several configuration sets can be stored on one memory cardallowing you to provide a number of applications which are downloaded quicklyto the FPGA.The schematic (rev. B) shows how the core can be used with an FPGA board. Iuse it to configure/boot the Xilinx Spartan IIe on BurchED's B5-X300board. SV2 fits the "SERIAL MODE" connector on this board but you will have toadd a separate wire from R6 to attach INIT. Please check the proper use of thepull-up resistors for your specific board.Features--------* Configuration mode: configures SRAM based FPGAs via slave serial mode(Xilinx and Altera)* Data mode: provides stored data over a simple synchronous serial interface* Broad compatability using SPI mode+ SecureDigital cards using dedicated initialization command+ MultiMediaCards (see below)* Operation triggerd by power-up or card insertion* Multiple configuration sets stored on on single memory cardCompatability-------------These cards have been tested with the SD/MMC Bootloader:* Hama 64 MB SD* SanDisk 128 MB SD* SanDisk 64 MB MMC* Panasonic 32 MB SDSome MMC might fail with this core as not all cards support CMD18(READ_MULTIPLE_BLOCK). Please consult the data sheet of your specificmodel. In case your MMC does not implement CMD18 you might want to have a lookat the FPGA MMC-Card Config project.Tools-----Downloading the configuration data to the card is a straight forwardprocess. The images have to be written starting at dedicated locations. Forthe provided toplevel designs, these locations are multiples of 256 K. I.e. 0,0x40000, 0x80000 and so forth.dd (part of the GNU coreutils) serves this purpose:$ dd if=ram_loader.bin of=/dev/sdX bs=512$ dd if=pongrom_6.bin of=/dev/sdX bs=512 seek=512$ dd if=pacman.bin of=/dev/sdX bs=512 seek=1024The name of the device node depends on how the card reader is attached to thekernel. For Linux systems this is most often something like /dev/sdX with Xranging from a-z. Please note that it is essential to use the device withoutany trailing numbers as they refer to partitions leading to wrong offsets fordata written to the card.All this works perfectly for my Spartan IIe device as this FPGA expects theconfiguration data as it is delivered from the card: Consecutive bytes eachwith its most significant bit first. Altera devices like the FLEX family aredifferent here. They expect the bytes with least significant bitfirst. Therefore, the configuration data has to be swapped bitwise before itis written to the card. Michael Libeskind kindly provided a program thataccimplishes this task. Find it in sw/misc/bit_reverse.c.Verification------------The spi_boot core comes with a simple testbench that simulates an SD/MMCcard. All four implementations of the core are verified there in parallelwhile transferring the data for several sets.You should normally not need to run the testbench. But in case you modifiedthe VHDL code the testbench gives some hints if the design has been broken.Directory Structure-------------------The core's directory structure follows the proposal of OpenCores.org.spi_boot|\--+-- doc : Documentation| || \-- src : Source files of documentation|+-- rtl| || \-- vhdl : VHDL code containing the RTL description| of the core.|+-- bench| || \-- vhdl : VHDL testbench code.|\-- sim|\-- rtl_sim : Directory for running simulations.RAM Loader----------Directory rtl/vhdl/ram_loader contains the sample design which loads the nextimage from the card and stores its contents to external asynchronousRAM. After reading 64 KB it triggers a new configuration process for the finalFPGA design.Refer to the code for the mechanisms involved.Compiling the VHDL Code-----------------------VHDL compilation and simulation tasks take place inside in sim/rtl_simdirectory. The project setup supports only the GHDL simulator (seehttp://ghdl.free.fr).To compile the code simply type at the shell$ makeThis should result in a file called tb_behav_c0 which can be executed as anyother executable.The basic simple sequence list can be found in COMPILE_LIST. This can beuseful to quickly set up the analyze stage of any compiler orsynthesizer. Especially when synthesizing the code, you want to skip the VHDLconfigurations in *-c.vhd and everything below the bench/ directory.References----------* SanDisk SD Card Product Manualhttp://www.sandisk.com/pdf/oem/ProdManualSDCardv1.9.pdf* SanDisk MMC Product Manualhttp://www.sandisk.com/pdf/oem/manual-rs-mmcv1.0.pdf* Toshiba SD Card Specificationhttp://i.cmpnet.com/chipcenter/memory/images/prod055.pdf* BurchEDhttp://burched.biz/* FPGA MMC-Card Config projecthttp://www.opencores.org/projects.cgi/web/mmcfpgaconfig/overview
