|
|
# White Rabbit PTP Core
|
|
|
# White Rabbit PTP Core
|
|
|
|
|
|
![](/project/white-rabbit/uploads/aa23f1f5f7cb8fe34b18cb9506b85c21/wrpc_box.png)
|
|
|
|
|
|
![](/uploads/ef980fb072e46909b6c5eb4aab1b93fc/wrpc_inside.png)
|
|
|
|
|
|
## 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 it you can add the $PATH variable modifications to
|
|
|
your .bashrc file. Thus the hdlmake and lm32 toolchain directory 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
|
|
|
```
|
|
|
|
|
|
5\. create Makefile for synthesis using hdlmake:
|
|
|
|
|
|
```
|
|
|
$ cd wr-cores/syn/spec_1_1/wr_core_demo/
|
|
|
$ hdlmake
|
|
|
```
|
|
|
|
|
|
6\. synthesize the project:
|
|
|
|
|
|
```
|
|
|
$ make
|
|
|
```
|
|
|
|
|
|
7\. 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:
|
|
|
|
|
|
8\. go back to the wrpc directory created in the 1st step:
|
|
|
|
|
|
```
|
|
|
$ cd ../../../../
|
|
|
```
|
|
|
|
|
|
9\. download the lm32 toolchain:
|
|
|
|
|
|
```
|
|
|
$ wget http://www.das-labor.org/files/madex/lm32_linux_i386.tar.bz2
|
|
|
```
|
|
|
|
|
|
10\. unpack the toolchain:
|
|
|
|
|
|
```
|
|
|
$ tar xjf lm32_linux_i386.tar.bz2
|
|
|
```
|
|
|
|
|
|
11\. add toolchain binaries to PATH variable:
|
|
|
|
|
|
```
|
|
|
$ export PATH=`pwd`/lm32/bin:$PATH
|
|
|
```
|
|
|
|
|
|
12\. clone the git repo with software for WR PTP Core:
|
|
|
|
|
|
```
|
|
|
$ git clone git://github.com/twlostow/wr-core-software.git
|
|
|
```
|
|
|
|
|
|
13\. clone the PTP daemon repo to the directory of WRPC software:
|
|
|
|
|
|
```
|
|
|
$ cd wr-core-software
|
|
|
$ git clone git://gnudd.com/ptp-noposix.git
|
|
|
```
|
|
|
|
|
|
14\. 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
|
|
|
```
|
|
|
|
|
|
15\. 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
|
|
|
|
|
|
|
|
|
|
|
|
### Files
|
... | ... | |