Commit 241ed653 authored by Benoit Rat's avatar Benoit Rat

doc: add standalone and what do you need section

parent 68918b68
% WR SPEC Starting Kit
% Benoit RAT, Jose Jimenez, Javier Diaz (Seven Solutions) & Miguel Jimenez (UGR)
% Benoit RAT, Jose Jimenez, Javier Diaz (Seven Solutions)
Introduction
=============
......@@ -86,8 +86,27 @@ System Setup
This section describes the main elements required to start with the White-Rabbit based
on the *"White Rabbit (SPEC-based) starting kit"*. The different
hardware elements and theirs connections are described in this section.
hardware elements and theirs connections are described in this section.
What do you need?
----------------
In order to use the white rabbit starting kit and setup the different
experiments you will need:
* An oscillocope with at least 150Mhz bandwitdh (500Mhz is recommanded).
* A PC with with at least two `PCIe x4` ports (`x8` & `x16` are also compatible)
* The Operative System Ubuntu 12.04 LTS 32bit (Long Term Support) with kernel `3.2.x.`
* Two mini-USB (B) cables (not provided with the kit).
> ***Note:*** This tutorial follow a configuration with two [SPEC+FMCDIO] boards connected in the two **PCIe x16** interfaces of the same computer. However, you can also use two different computers (if you do not have two **PCIe x4**) and follow this tutorial; you just need to replace all the commands with `wr1` or `0x0300` by the `wr0` and its corresponding bus_id on the second PC. The configuration with two separated PCs is more *"natural"* to understand how to communicate two different nodes using the starting kit,
but it requires more physical space to implement it.
![Configuration with one or two PCs](ssk_configs.png)
> ***Warning:*** This tutorial fully support the latest ubuntu LTS release. Other distro or kernel version might work, however we can not guarantee full compatibility and therefore full support. Please check the
[wr-starting-kit] wiki for a more detailed list of which distro has been tested.
Starting kit components
----------------
......@@ -95,7 +114,7 @@ Starting kit components
The starting kit is composed of various elements that you should find
in the package[^standardssk] :
* 2x [SPEC]s boards compatible with *PCIe x4* or more
* 2x [SPEC]s boards
* 2x [FMC-DIO]s 5CH TTL A
* 2x SFPs LC
......@@ -114,24 +133,23 @@ Physical configurations
-------------------
* Plug the [SPEC+FMCDIO] into your *PCIe x{4,8,16}* port.
* Plug the [SPEC+FMCDIO] into your `PCIe x{4,8,16}` port.
* You should also connect a micro-USB cable to the UART of the board.
(A Virtual UART is also available, but it is safer to use the physical
one).
* Connect the two [SPEC+FMCDIO] boards using the SFPs and the optical fiber cable (LC-LC)
* Run a linux distribution (This tutorial has been written using Ubuntu 12.04 and it is focused on
debian's like distribution).
* Start your Ubuntu LTS distribution.
* Prepare an oscilloscope with at least two input channels to access
the [FMCDIO] outputs.
> ***Note:*** This tutorial follow a configuration with two [SPEC+FMCDIO] boards connected in the two **PCIe x16** interfaces of the same computer.
> You can also use two different computers (if you do not have two **PCIe x4**) and follow this tutorial; you
> You can also use two different computers (if you do not have two **PCIe x4**) and follow this tutorial; you
just need to replace all the commands with `wr1` or `0x0300` by the `wr0` and its corresponding bus_id on the second PC.
The configuration with two separated PCs is more *"natural"* to
understand how to communicate two different nodes using the starting kit,
The configuration with two separated PCs is more *"natural"* to
understand how to communicate two different nodes using the starting kit,
but it requires more physical space to implement it.
![Configuration with one or two PCs](ssk_configs.png)
......@@ -1320,122 +1338,35 @@ By default the SPEC+DIO should be configured to be run in GM setup, but if you a
You can also run GM in a full standalone mode in order to transmit WR clock without the need of a PC.
First you need to flash the SPEC with the latest bitstream you can find the package:
http://www.sevensols.com/dl/wr-nic/bin/latest_stable.tar.gz
To do so you need to generate a MSC file as follow:
Create PROM Files > SPI Flash > Single FPGA > 32M > MCS
And then, when asking for SPI/BPI, just add the `.msc` file and select
the corresponding SPI flash memory: `M25P32`.
Then:
* The setup of the cable is exactly the same as above, and you do not need to setup the mode because it is
correctly configured for GM by default at power up.
* Then you need to run grandmaster mode from wrc console, as above.
* (Optional) Finally, if you need to keep this configuration at power up, you can write a small script
on the EEPROM to boot in grandmaster mode.
Please refer to *Writing EEPROM and calibration* Section of the [wrpc.pdf] document.
Remote configuration of SPEC card
--------------------
You can also use SPEC card in standalone mode as we have seen before but... how can you configure spec card if you
do not use drivers? In wr-nic project, Etherbone core has been added to design and it allows to you configure
memory map with UDP/TCP packets. To ease this function, we have added a eb-mem script in scripts folder. This tool
uses Etherbone tools to connect with device and perform read/write operations.
~~~~~~{.sh}
## It shows you Device memory map
eb-mem.sh --scan --ip 10.10.10.10
## Read a memory address
eb-mem.sh --read --ip 10.10.10.10 --address 0x62000
## Write a memory address
eb-mem.sh --write --ip 10.10.10.10 --address 0x62000 --value 0x01
## Show help
eb-mem.sh --help
~~~~~~~~~~~~~
eb-mem can be used to configure DIO FMC card.
wrc# init erase
wrc# init add ptp stop
wrc# init add sfp detect
wrc# init add sfp match
wrc# init add mode gm
wrc# init add ptp start
~~~~~~
~~~~~~{.bash}
## Generate an inmediate pulse with max width
pulse_imm() {
ip=$1
ch=$2
len=$3
addr=0x62348
offset[0]=0x00
offset[1]=0x04
offset[2]=0x08
offset[3]=0x0c
offset[4]=0x10
addr=$(($addr+${offset[$ch]}))
eb-mem.sh --write --ip $ip --address $addr --value $len
addr=0x6235c
val=0xffffffff
mask[0]=0x01
mask[1]=0x02
mask[2]=0x04
mask[3]=0x08
mask[4]=0x10
val=$(($val & ${mask[$ch]}))
eb-mem.sh --write --ip $ip --address $addr --value $val
}
pulse_imm 10.10.10.10 1 0xffffffff
## Configure channel 1 as Output
config_ch_o() {
ip=$1
ch=$2
mask1[0]=0xfffffffc
mask1[1]=0xffffffcf
mask1[2]=0xfffffcff
mask1[3]=0xffffcfff
mask1[4]=0xfffcffff
mask2[0]=0x01
mask2[1]=0x10
mask2[2]=0x100
mask2[3]=0x1000
mask2[4]=0x10000
mask3[0]=0xfffffffb
mask3[1]=0xffffffbf
mask3[2]=0xfffffbff
mask3[3]=0xffffbfff
mask3[4]=0xfffbffff
eb-mem.sh --read --ip $ip --address 0x6233c > value.txt
value=`cat value.txt`
value=0x$value
value=$(($value & ${mask1[$ch]}))
eb-mem.sh --write --ip $ip --address 0x6233c --value $value
eb-mem.sh --read --ip $ip --address 0x6233c > value.txt
value=`cat value.txt`
value=0x$value
value=$(($value | ${mask2[$ch]}))
eb-mem.sh --write --ip $ip --address 0x6233c --value $value
eb-mem.sh --read --ip $ip --address 0x6233c > value.txt
value=`cat value.txt`
value=0x$value
value=$(($value & ${mask3[$ch]}))
eb-mem.sh --write --ip $ip --address 0x6233c --value $value
}
config_ch_o 10.10.10.10 1
Please refer to *Writing EEPROM and calibration* Section of the [wrpc.pdf] document.
~~~~~~~~~~~~~
FAQS & Bugs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment