Werner's Miscellanea
Sign in or create your account | Project List | Help
Werner's Miscellanea Git Source Tree
Root/
| 1 | jtag-boot (for Milkymist One) |
| 2 | ============================= |
| 3 | |
| 4 | This collection of scripts talks via JTAG to the FPGA of a Milkymist One. |
| 5 | It makes the FPGA load a bitstream (FPGA configuration) from NOR. |
| 6 | |
| 7 | |
| 8 | Elements involved |
| 9 | ----------------- |
| 10 | |
| 11 | The mkboot script generates a very short bitstream that instructs the |
| 12 | configuration subsystem of the FPGA to perform the boot operation. |
| 13 | |
| 14 | A bitstream is a sequence of instructions for the configuration subsystem. |
| 15 | Bitstreams are used for various purposes, for example, the configuration |
| 16 | data of the FPGA is also contained in a (much larger) bitstream. |
| 17 | |
| 18 | mkboot also adds the minimum set of headers of the ".bit" format to the |
| 19 | bitstream. This allows the bitstream to be transferred to the FPGA via |
| 20 | JTAG, using the UrJTAG utility. |
| 21 | |
| 22 | UrJTAG is controlled via the boot.jtag script, which performs the basic |
| 23 | initialization of the JTAG system, defines a few chip-specific constants, |
| 24 | and then loads and executes the bitstream generated by mkboot. |
| 25 | |
| 26 | |
| 27 | Bitstream content and format |
| 28 | ---------------------------- |
| 29 | |
| 30 | The bitstream instructs the configuration subsystem of the to erase the |
| 31 | present FPGA configuration, load a new one from NOR, and then let the |
| 32 | FPGA "run" it. |
| 33 | |
| 34 | The structure of this kind of bitstream is described on Table 7-1 on page |
| 35 | 126, section "IPROG Reconfiguration", of [1]. The format of the bitstream |
| 36 | is described in the section "Configuration packets" starting at page 88 |
| 37 | of [1]. |
| 38 | |
| 39 | The NOR address from where the configuration bitstream will be loaded was |
| 40 | obtained from the M1 standby bitstream, starting around line 205 of [2]. |
| 41 | |
| 42 | Finally, the format of the .bit file was simply taken from the function |
| 43 | xlx_bitstream_load_bit of [3]. This is the same function in UrJTAG that |
| 44 | loads the file with the "pld load" command. |
| 45 | |
| 46 | [1] Xilinx. "Spartan-6 FPGA Configuration User Guide" |
| 47 | http://www.xilinx.com/support/documentation/user_guides/ug380.pdf |
| 48 | [2] https://github.com/milkymist/milkymist/blob/master/boards/milkymist-one/standby/standby.v |
| 49 | [3] http://urjtag.git.sourceforge.net/git/gitweb.cgi?p=urjtag/urjtag;a=blob_plain;f=urjtag/src/pld/xilinx_bitstream.c;hb=HEAD |
| 50 | |
| 51 | |
| 52 | System state and behaviour |
| 53 | -------------------------- |
| 54 | |
| 55 | This process differs from a regular boot in that it should be able to |
| 56 | boot the FPGA into the "regular" bitstream (or the "rescue" bitstream) |
| 57 | from any state, including after a failed attempt to load the "standby" |
| 58 | bitstream. |
| 59 | |
| 60 | The successful booting of FlickerNoise with jtag-boot does therefore not |
| 61 | mean that the M1 would be able to boot regularly. E.g., if the standby |
| 62 | bitstream is corrupted, the M1's FPGA initialization - without using |
| 63 | JTAG - would fail at this first step. |
| 64 |
Branches:
master
