TS-7600 FPGA Programming
|Note:||We do not provide support for the opencores under our free support, however we do offer custom FPGA programming services. If interested please contact us.|
We provide an open version of the Verilog project that contains the functionality of the default FPGA bitstream. The FPGA bitstream is built using Lattice Diamond which is free and runs under Windows or Linux (Redhat). This allows you to modify the verilog and create a jedec file with your custom logic. The jedec is converted to a vme file which is loaded from the SD card and used to reprogram the SRAM of the FPGA on every startup. This requires approximately a second during startup to reprogram, but allows you to recover by removing the bitstream file from the SD card in the case of a faulty bitstream.
The opencore FPGA sources are available here. Custom logic can be built by implementing a wishbone compatible core, or by extending the cores we already have connected.
The ts7600_top.v file is used to connect all of the wishbone cores, and map any DIO. The syscon.v is used for most common system configuration registers. As a simple example these next steps will modify the submodel ID located at 0x02 in the syscon.v.
Open up the Lattice diamond tools and open the .ldf file to open the project. On the bottom left there are 3 tabs to control the left panel (Files, Process, and Hierarchy). Go to Files, and double click syscon.v. At line 131 is:
localparam model = 16'h7600; localparam submodel = 4'h0; localparam revision = 4'h1;
You can edit the custom value to:
localparam submodel = 4'h1;
The custom register is not used by any default software and is a safe register to use for a custom version number. Do not change the model number or the revision number, many of our initramfs scripts rely on this to identify the current board. The default bitstream will always use 0 for the submodel value.
Save the file and go to the "Process" tab. Double click "Place & Route Trace" to begin synthesizing the bitstream. This will take approximately 5-10 minutes. Once this is finished open the "Reports" tab from the top open file list. Under "Analysis Reports" click on "Place & Route Trace". This is used to verify timing of your build. Under "Preference Summary" make sure none of the clock domains list errors. If timing is not met this will cause seemingly random issues with the bitstream which will usually present first as SD corruption.
Once the timing has been verified, double click "JECEC File" on the "Process" tab to build the jed file. Once this is finished there will be a "ts4710_default.jed" in the project folder. In order for the board to use this it must be converted to a vme file. This is generated using "jed2vme":
jed2vme ts7600_default.jed | bzip2 > ts7600-fpga.vme.bz2
|WARNING:||Generating a VME using Lattice's tools can generate a flash bitstream which WILL render your board unbootable.|
Once this is built it should be placed on the second partition of the SD card as "/ts/ts<model>-fpga.vme.bz2" This should match your macrocontroller's model such as "/ts/ts7600-fpga.vme.bz2".
A bitstream can be tested at any time by loading it with the following command:
tshwctl --loadfpga ts7600-fpga.vme.bz2
Once it is loaded on the SD card the board can be booted normally. The green and red LEDs will shut off during programming, and then turn back on after the bitstream has been reloaded. During the time it is programming, the NBUS lock is held and no other applications will attempt to issue a bus cycle while the FPGA is not completely up and running. Once it has reloaded you can use tshwctl to verify the register has changed:
On the default bitstream this will return submodel=0x0, with the modified version above it will read submodel=0x1