White Rabbit PTP Core
WR PTP Core external interfaces
WR PTP Core block diagram
Building WR PTP Core:
To perform the steps below you would need a computer with Linux operating system. Building WR PTP Core firmware consist of two steps: synthesizing HDL project and compiling LM32 firmware. The former requires hdlmake tool (https://www.ohwr.org/project/hdl-make) while the latter lm32 toolchain. The step-by-step procedure is listed below. Please notice that you can add the $PATH variable modifications to your .bashrc file. Thus the hdlmake and lm32 toolchain directories would be always automatically added to $PATH.
1. create a new directory
$ mkdir wrpc
$ cd wrpc
Synthesizing HDL:
2. clone the hdlmake git repo:
$ git clone git:https://www.ohwr.org/misc/hdl-make.git
3. add hdlmake binary location to PATH variable so it could be called from any location:
$ export PATH=`pwd`/hdl-make:$PATH
4. clone wr-cores git repo which contains HDL core for WR PTP Core:
$ git clone git:https://www.ohwr.org/hdl-core-lib/wr-cores.git
$ cd wr-cores
5. the newest version of WR PTP Core is currently stored in wishbonized branch of wr-cores repo, so it is recommended to change local branch from master to wishbonized:
$ git checkout wishbonized
6. create Makefile for synthesis using hdlmake:
$ cd syn/spec_1_1/wr_core_demo/
$ hdlmake
7. synthesize the project:
$ make
8. as the result the spec_top.bin file would be generated. It can be loaded to SPEC as described here: https://www.ohwr.org/project/spec-sw/wikis/documents
Compiling LM32 firmware:
9. go back to the wrpc directory created in the 1st step:
$ cd ../../../../
10. download the lm32 toolchain from ohwr:
$ wget https://www.ohwr.org/project/wr-cores/uploads/a2e8eeba448fbc8d580e68004e6f6c7f/lm32.tar.xz
11. unpack the toolchain:
$ tar xJf lm32.tar.xz
12. add toolchain binaries to PATH variable:
$ export PATH=`pwd`/lm32/bin:$PATH
13. clone the git repo with software for WR PTP Core:
$ git clone git:https://www.ohwr.org/hdl-core-lib/wr-cores/wrpc-sw.git
$ cd wrpc-sw
14. clone the PTP daemon repo to the directory of WRPC software:
$ git clone -b v3-switch_for_wrpc git://gnudd.com/ptp-noposix.git
15. compile the LM32 firmware, you can decide whether the firmware is compiled for WRPC Master or Slave by running one of the following commands
$ make WRMODE=master
$ make WRMODE=slave
17. as the result the wrc.bin file would be generated. It can be loaded to SPEC as described here: https://www.ohwr.org/project/spec-sw/wikis/documents