Modifying WRS firmware
This page describes how you can generate you own WRS firmware to be used by the WRS PTS v1.0.
WR Switch firmware is build from 3 main repositories:
- SoftPLL LM32 firmware: git:https://www.ohwr.org/hdl-core-lib/wr-cores/wrpc-sw.git
- FPGA firmware: git:https://www.ohwr.org/white-rabbit/wr-switch-hdl.git
- Software package: git:https://www.ohwr.org/white-rabbit/wr-switch-sw.git
Please follow the procedure below to clone all the above repositories
and build a complete WRS firmware:
The procedure assumes that all the repositories are fetched in
<your_location> directory.
1. Clone SoftPLL LM32 firmware repository and use branch wrs-pts-v1.0:
$ git clone git:https://www.ohwr.org/hdl-core-lib/wr-cores/wrpc-sw.git
$ cd wrpc-sw
$ git checkout wrs-pts-v1.0
$ git submodule init
$ git submodule update
2. Load default configuration for WRS SoftPLL firmware:
$ make wr_switch_defconfig
3. Modify the source code according to your needs
4. Compile
$ make
5. At this stage, if your compilation was successful, rt_cpu.elf file was created.
6. Go back to your main location and clone branch wrs-pts-v1.0 of the FPGA firmware repository:
$ cd <your_location>
$ git clone git:https://www.ohwr.org/white-rabbit/wr-switch-hdl.git
$ cd wr-switch-hdl
$ git checkout wrs-pts-v1.0
$ git submodule init
$ git submodule update
7. Modify VHDL sources according to your needs
8. Go to the synthesis directory:
$ cd syn/pts_scb
9. Synthesize the design using either the hdlmake tool or just open the project file pts_scb.xise in Xilinx ISE to start the bitstream generation.
10. At this stage, if your synthesis was successful, pts_scb_top.bin file was created.
11. Go back to your main location and clone branch wrs-pts-v1.0 of the WRS software package repository:
$ cd <your_location>
$ mkdir wr-switch-sw
$ git clone git:https://www.ohwr.org/white-rabbit/wr-switch-sw.git repo
$ cd repo
$ git checkout wrs-pts-v1.0
12. Include Softpll firmware binary built in step 5:
$ cp <your_location>/wrpc-sw/rt_cpu.elf <your_location>/wr-switch-sw/repo/binaries/
13. Modify software sources according to your needs.
14. Build software package including custom FPGA firmware synthesized in step 10:
$ cd <your_location>/wr-swtich-sw
$ WRS_PTS_GW="<your_location>/wr-switch-hdl/syn/pts_scb/pts_scb_top.bin" repo/build/wrs_build-all
15. At this stage , if your compilation was successful, *.tar file was created. This is a complete WR Switch firmware than can be copied to the PTS location.