... | ... | @@ -7,6 +7,12 @@ project](https://www.ohwr.org/project/wr-cores/wikis) provides support |
|
|
for the [VFC-HD board](https://www.ohwr.org/project/vfc-hd/wikis), an
|
|
|
FMC carrier board based on an Arria V FPGA from Altera.
|
|
|
|
|
|
## Gateware
|
|
|
|
|
|
The main ingredient of the WR PTP core is the FPGA gateware. The WR PTP
|
|
|
core in the form of a parametrisable VHDL module, to be instantiated in
|
|
|
your own design.
|
|
|
|
|
|
By using this module, the user gains the benefit of instantiating all
|
|
|
the necessary components of the WR PTP core (including the core itself,
|
|
|
the PHY, PLLs, etc.) in one go, without having to delve into the
|
... | ... | @@ -19,12 +25,6 @@ suggested to use this code as a reference, and to consider using the |
|
|
internally in this module) for instantiating the PHY and (optionally)
|
|
|
the PLLs.
|
|
|
|
|
|
## Gateware
|
|
|
|
|
|
The main ingredient of the WR PTP core is the FPGA gateware. The WR PTP
|
|
|
core in the form of a parametrisable VHDL module, to be instantiated in
|
|
|
your own design.
|
|
|
|
|
|
### Getting it
|
|
|
|
|
|
The FPGA gateware is available on the
|
... | ... | @@ -46,467 +46,12 @@ project, is located under |
|
|
A VHDL package with the definition of the module can be found under
|
|
|
[board/wr\_board\_pkg.vhd](https://www.ohwr.org/project/wr-cores/tree/dlamprid-vfchd/).
|
|
|
|
|
|
#### Module Generics
|
|
|
|
|
|
There are five generics provided for the parametrisation of the module.
|
|
|
|
|
|
<table>
|
|
|
<tbody>
|
|
|
<tr class="odd">
|
|
|
<td><strong>name</strong></td>
|
|
|
<td><strong>type</strong></td>
|
|
|
<td><strong>default</strong></td>
|
|
|
<td><strong>description</strong></td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td>g_simulation</td>
|
|
|
<td>integer</td>
|
|
|
<td>0</td>
|
|
|
<td>This can be set to 1 to enable faster simulation, by speeding up some of the initialisation processes.</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td>g_pcs16_bit</td>
|
|
|
<td>boolean</td>
|
|
|
<td>false</td>
|
|
|
<td>The VFC-HD makes use of the <a href="platform-arria5">Altera Arria V platform</a> for WhiteRabbit, which provides the possibility to configure the PCS of the PHY either as 8bit or 16bit. The default is to use the 8bit PCS, but this generic can be used to override it.</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td>g_fabric_iface</td>
|
|
|
<td>string</td>
|
|
|
<td>"plain"</td>
|
|
|
<td>The WR PTP core provides a [fabric" interface towards the FPGA. The default value for this generic will leave the fabric interface as is. If instead it is set to "streamers", a <a href="WR-Streamers">WhiteRabbit streamer</a> module will be attached to it. In the future, it is foreseen to have a third option here, for instantiating an "Etherbone core](https://www.ohwr.org/project/etherbone-core/wikis).</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td>g_streamer_width</td>
|
|
|
<td>integer</td>
|
|
|
<td>32</td>
|
|
|
<td>In case <code>g_fabric_iface = "streamers"</code>, then this generic defines the data width for the streamer interface. Otherwise, it is ignored.</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td>g_dpram_initf</td>
|
|
|
<td>string</td>
|
|
|
<td>"default"</td>
|
|
|
<td>This generic can point to the path of the Altera memory initialisation file (.mif) containing the software binary for the embedded CPU of the WR PTP core. If provided, it will be included in the final FPGA bitstream and the embedded CPU will be properly initialised every time the FPGA is programmed with the bitstream.</td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
#### Module Ports
|
|
|
|
|
|
The following table lists all the input/output ports of the module. Note
|
|
|
that depending on the values of the module generics (`g_fabric_iface` in
|
|
|
particular), not all ports are required.
|
|
|
|
|
|
<table>
|
|
|
<tbody>
|
|
|
<tr class="odd">
|
|
|
<td align="center"><strong>name</strong></td>
|
|
|
<td><strong>direction</strong></td>
|
|
|
<td><strong>type</strong></td>
|
|
|
<td><strong>description</strong></td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center"><strong>Clocks/resets</strong></td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">clk_board_125m_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>125 MHz clock input from the VFC-HD board (OSC2 output on the board).</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">clk_board_20m_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>20 MHz clock input from the VFC-HD board (OSC3 output on the board).</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">areset_n_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>Reset input, active low. Can be asynchronous.</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">clk_sys_62m5_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>62.5MHz system clock output.</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">clk_ref_125m_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>125MHz WR reference clock output.</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">rst_sys_62m5_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>Active high reset output, synchronous to clk_sys_62m5_o.</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center"><strong>SPI interfaces to DACs</strong></td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">dac_ref_sync_n_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>SPI CSn for main (ref) VCXO</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">dac_dmtd_sync_n_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>SPI CSn for helper (DMTD) VCXO</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">dac_din_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>SPI MOSI</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">dac_sclk_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>SPI CLK</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center"><strong>SFP I/O for transceiver and SFP management info from VFC-HD</strong></td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">sfp_tx_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>SFP TX</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">sfp_rx_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>SFP RX</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">sfp_det_valid_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
<td><em>High</em> if both of the following are true:<br />
|
|
|
1. SFP is detected (plugged in)<br />
|
|
|
2. The part number has been successfully read after the SFP detection</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">sfp_data_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic_vector</td>
|
|
|
<td>The VFC-HD board implements I2C multiplexers to provide access to the numerous SFP interfaces (as well as other I2C-controlled peripherals).<br />
|
|
|
The <a href="https://gitlab.cern.ch/dlamprid/VFC-HD/tree/master">VFC-HD project</a> provides an additional module (in Verilog) which takes care of accessing the SFP information and making it available to the WR PTP code, in the form of a 16 byte vendor Part Number (128 bits std_logic_vector, ASCII encoded, first character byte in bits 127 downto 120).</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center"><strong>I2C EEPROM</strong></td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">eeprom_sda_b</td>
|
|
|
<td>inout</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>Bidirectional I2C SDA line.</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">eeprom_scl_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>Normally, this should also be bidirectional, but VFC-HD defines SCL as output, which works because the EEPROM is the only device connected on this I2C bus.</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center"><strong>Onewire interface</strong></td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">onewire_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>Data input from the onewire interface.</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">onewire_oen_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>Output enable to the onewire interface. When this is asserted, the instantiating module should drive the onewire data output to ground.</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center"><strong>External WB interface</strong></td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wb_adr_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic_vector</td>
|
|
|
<td>Wishbone slave interface, operating in "Pipelined" mode, with word granularity. It provides access to all the Wishbone peripherals inside the WR PTP core.<br />
|
|
|
VHDL records are not used here, to facilitate integration of the module into Verilog-based projects (such as the VFC-HD).</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wb_dat_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic_vector</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wb_dat_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic_vector</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wb_sel_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic_vector</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wb_we_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wb_cyc_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wb_stb_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wb_ack_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wb_int_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wb_err_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wb_rty_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wb_stall_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center"><strong>WR fabric interface <em><span class=""plain"@ = @g_fabric_iface when used only"></span></em></strong></td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wrf_src_adr_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic_vector</td>
|
|
|
<td>Pipelined Wishbone master interface. It passes all the Ethernet frames received from a physical link to a slave interface implemented in a user-defined module.<br />
|
|
|
VHDL records are not used here, to facilitate integration of the module into Verilog-based projects (such as the VFC-HD).</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wrf_src_dat_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic_vector</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wrf_src_cyc_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wrf_src_stb_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wrf_src_we_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wrf_src_sel_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic_vector</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wrf_src_ack_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wrf_src_stall_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wrf_src_err_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wrf_src_rty_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wrf_snk_adr_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic_vector</td>
|
|
|
<td>Pipelined Wishbone slave interface. It receives Ethernet frames from a master interface implemented in a user-defined module, and sends them to a physical link.<br />
|
|
|
VHDL records are not used here, to facilitate integration of the module into Verilog-based projects (such as the VFC-HD).</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wrf_snk_dat_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic_vector</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wrf_snk_cyc_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wrf_snk_stb_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wrf_snk_we_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wrf_snk_sel_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic_vector</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wrf_snk_ack_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wrf_snk_stall_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wrf_snk_err_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wrf_snk_rty_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center"><strong>WR streamers <em><span class=""streamers"@ = @g_fabric_iface when used only"></span></em></strong></td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wrs_tx_data_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic_vector</td>
|
|
|
<td>Data word to be sent over the physical link. The width of the vector is equal to g_streamer_width parameter.</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wrs_tx_valid_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>An '1' indicates that the tx_data_i contains a valid data word.</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wrs_tx_dreq_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>Synchronous data request: when '1', the user may send a data word in the following clock cycle.</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wrs_tx_last_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>An '1' indicates the last data word in a larger block of samples.</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wrs_tx_flush_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>When asserted, the streamer will immediately send out all the data that is stored in its TX buffer.</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wrs_rx_first_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>An '1' indicates the first data word of the data block on wrs_rx_data_o.</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wrs_rx_last_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>An '1' indicates the last data word of the data block on wrs_rx_data_o.</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wrs_rx_data_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic_vector</td>
|
|
|
<td>Data word received from the physical link. The width of the vector is equal to g_streamer_width parameter.</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">wrs_rx_valid_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>An '1' indicates that rx_data_o is outputting a valid data word.</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">wrs_rx_dreq_i</td>
|
|
|
<td>in</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>Synchronous data request input: when '1', the streamer may output another data word in the subsequent clock cycle.</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center"><strong>WRPC timing interface and status</strong></td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">pps_p_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>1-PPS (Pulse Per Second) signal generated in the clk_ref_125m_o clock domain and aligned to WR time, pulse generated when the cycle counter is 0 (beginning of each full TAI second).</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">tm_time_valid_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>If 1, the timecode generated by the WRPC is valid.</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">tm_tai_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic_vector</td>
|
|
|
<td>TAI part of the timecode (40 bits).</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">tm_cycles_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic_vector</td>
|
|
|
<td>Fractional part of each second represented by the state of counter clocked with the frequency 125 MHz (values from 0 to 124999999, each count is 8 ns).</td>
|
|
|
</tr>
|
|
|
<tr class="odd">
|
|
|
<td align="center">led_link_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>signal for driving Ethernet Link LED.</td>
|
|
|
</tr>
|
|
|
<tr class="even">
|
|
|
<td align="center">led_act_o</td>
|
|
|
<td>out</td>
|
|
|
<td>std_logic</td>
|
|
|
<td>signal for driving Ethernet Act LED.</td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
A [detailed description of all generics and ports](Board-vfc-hd-ports)
|
|
|
is also provided.
|
|
|
|
|
|
An example (Verilog) instantiation of this module can be found in the
|
|
|
[VFC-HD base
|
|
|
project](https://gitlab.cern.ch/dlamprid/VFC-HD/blob/master/Hdl/FpgaModules/SystemSpecific/VfcHdSystem.v).
|
|
|
|
|
|
## Software for the embedded CPU of the WR PTP core
|
|
|
|
... | ... | @@ -626,5 +171,5 @@ wiki](https://www.ohwr.org/project/vfc-hd/wikis). |
|
|
|
|
|
-----
|
|
|
|
|
|
19 December 2016
|
|
|
20 December 2016
|
|
|
|