1
0
mirror of https://github.com/aolofsson/oh.git synced 2025-01-30 02:32:53 +08:00

Adding documentation to elink top level module

This commit is contained in:
Andreas Olofsson 2015-04-17 22:10:14 -04:00
parent 4c06e4be61
commit 18b2c489b0
4 changed files with 233 additions and 266 deletions

View File

@ -1,133 +1,8 @@
/*
########################################################################
EPIPHANY CONFIGURATION REGISTER (32bit access)
ELINK CONFIGURATION REGISTER FILE
########################################################################
-------------------------------------------------------------
ESYSRESET ***Elink reset***
[0] 0 - elink active
1 - elink in reset
-------------------------------------------------------------
ESYSTX ***Elink transmitter configuration***
[0] 0 - link TX disable
1 - link TX enable
[1] 0 - normal pass through transaction mode
1 - mmu mode
[3:2] 00 - normal mode
01 - gpio drive mode
10 - reserved
11 - reserved
[7:4] Transmit control mode for eMesh
[8] AXI slave read timeout enable
-------------------------------------------------------------
ESYSRX ***Elink receiver configuration***
[0] 0 - link RX disable
1 - link RX enable
[1] 0 - normal transaction mode
1 - mmu mode
[3:2] 00 - normal mode
01 - gpio sample mode (drive rd wait pins from registers)
10 - reserved
11 - reserved
-------------------------------------------------------------
ESYSCLK ***Epiphany clock frequency setting***
[0] Enable CCLK
[1] Enable TX_LCLK
[2] CCLK PLL bypass mode (cclk is set to clkin)
[3] LCLK PLL bypass mode (lclk is set to clkin)
[7:4] CCLK PLL Divider (1<<reg)
0000 - CLKIN/1
0001 - CLKIN/2
0010 - CLKIN/4
0011 - CLKIN/8
0100 - CLKIN/16
0101 - CLKIN/32
0110 - CLKIN/64
0111 - CLKIN/128
1xxx - RESERVED
[11:8] Elink PLL Divider (1<<reg)
0000 - CLKIN/1
0001 - CLKIN/2
0010 - CLKIN/4
0011 - CLKIN/8
0100 - CLKIN/16
0101 - CLKIN/32
0110 - CLKIN/64
0111 - CLKIN/128
1xxx - RESERVED
[15:12] PLL Frequency
0000 -
0001 -
0010 -
0011 -
0100 -
0101 -
0110 -
0111 -
1000 -
1001 -
1010 -
1011 -
1100 -
1101 -
1110 -
1111 -
-------------------------------------------------------------
ESYSCOREID ***CORE ID***
[5:0] Column ID-->default at powerup/reset
[11:6] Row ID
-------------------------------------------------------------
ESYSLATFORM ***Platform ID (read only)***
[7:0] Platform model number
-------------------------------------------------------------
ESYSDATAIN ***Data on elink input pins
[7:0] rx_data[7:0]
[8] tx_frame
[9] tx_wait_rd
[10] tx_wait_wr
-------------------------------------------------------------
ESYSDATAOUT ***Data on eLink output pins
[7:0] tx_data[7:0]
[8] tx_frame
[9] rx_wait_rd
[10] rx_wait_wr
-------------------------------------------------------------
ESYSDEBUG ***Various debug signals from elink
[31] embox_not_empty
//RX signals
[30] emesh_rx_rd_wait
[29] emesh_rx_wr_wait
[28] esaxi_emrr_rd_en
[27] emrr_full
[26] emrr_progfull
[25] emrr_wr_en
[24] emaxi_emrq_rd_en
[23] emrq_progfull
[22] emrq_wr_en
[21] emaxi_emwr_rd_en
[20] emwr_progfull
[19] emwr_wr_en (rx)
//TX signals
[18] e_tx_rd_wait
[17] e_tx_wr_wait
[16] emrr_rd_en
[15] emaxi_emrr_prog_full
[14] emaxi_emrr_wr_en
[13] emrq_rd_en
[12 esaxi_emrq_prog_full
[11] esaxi_emrq_wr_en
[10] emwr_rd_en
[9] esaxi_emwr_prog_full
[8] esaxi_emwr_wr_en
##########Sticky signals below#############
[7] reserved
[6] emrr_full (rx)
[5] emrq_full (rx)
[4] emwr_full (rx)
[3] emaxi_emrr_full (tx)
[2] esaxi_emrq_full (tx)
[1] esaxi_emwr_full (tx)
[0] embox_full (mailbox)
########################################################################
*/
module ecfg (/*AUTOARG*/

View File

@ -1,3 +1,226 @@
/*
########################################################################
DESCRIPTION
########################################################################
The "eLink" is a low latency chip to chip interface used by for communication
between Epiphany chips and FPGAs. The interface "should" achieve a peak
throughput of 8 Gbit/s in FPGAs with 24 available LVDS signal pairs.
SIGNAL | DESCRIPTION
---------------|--------------
TXO_FRAME | Packet framing signal. Rising edge signals new packet.
TXO_LCLK | A clock aligned in the center of the data eye
TXO_DATA[7:0] | Dual data rate (DDR) that transmits packet
TXI_RD_WAIT | Push back signal for read transactions
TXI_WR_WAIT | Push back signal for write transactions
A symmetrical set of signals exit on the receiver side.
The elink has a 64 bit data AXI master and 32-bit data AXI slave interface
for connecting to a standard AXI network.
PACKET SUBFIELD | DESCRIPTION
----------------|----------------
access | Indicates a valid packet
write | A write transaction. Access & ~write indicates a read.
datamode[1:0] | Datasize (00=8b,01=16b,10=32b,11=64b)
ctrlmode[3:0] | Various packet modes for the Epiphany chip
dstraddr[31:0] | Address for write, read-request, or read-respones transaction
data[31:0] | Data for write transation, return data for read response
srcaddr[31:0] | Return address for read-request, upper data for 64 bit write
More gory details:
The elink was born out of a need to connect multiple Epiphany chips together
and uses the eMesh 104 bit atomic packet structure for communication.
The eMesh atomic patcket consists of the following sub fields.
The number of bytes to be received is determined by the data of the first
valid byte (byte0) and the level of the FRAME signal. The data captured
on the rising edge of the LCLK is considered to be byte0 if the FRAME control
captured at the same cycle (rising edge) is high but was low at the rising
edge of the previous LCLK cycle. The cycle after the last byte of the
transaction (byte8 or byte12) will determine if the receiver should go into
data streaming mode based on the level of the FRAME control signal. If the
FRAME signal is low, the transaction is complete. If the FRAME control
signal stays high, the eLink goes into streaming mode, meaning that the
last byte of the previous transaction (byte8 or byte12) will be followed
by byte5 of the new transaction.
The WAIT_RD and WAIT_WR signals are used to stall transmission when a receiver
is unable to accept more transactions. The receiver will raise its WAIT output
signal on the second rising edge of LCLK input following the capturing rising
edge of the last transaction byte (byte8 or byte12) but will be ready to
accept one more full transaction (byte0 through byte8/byte12). The WAIT
signal seen by the transmitter is assumed to be of the unspecified phase
delay (while still of the LCLK clock period) and therefore has to be sampled
with the two-cycle synchronizer. Once synchronized to the transmitter's LCLK
clock domain, the WAIT control signals will prevent new transaction from
being transmitted. If the transaction is in the middle of the transmission
when the synchronized WAIT control goes high, the transmission process is to
be completed without interruption. The txo_* interface driven out from the
E16G301 uses a divided version of the core cock frequency (RXI_WE_CCLK_{P,N}).
The transmit clock is automatically aligned in the middle of the data eye
by the eLink on chip transmit logic. The receiver logic assumes the clock is
aligned at the center of the receiver data eye. The wait signals are used
to indicate to the transmit logic that no more transactions can be received
because the receiver buffer full.
########################################################################
ELINK MEMORY MAP
########################################################################
The elink has an parameter called 'ELINKID' that can be configured by
the module instantiating the elink.
REGISTER | ADDRESS | NOTES
------------| -------------|------
ESYSRESET | 0xF0000 | Soft reset
ESYSTX | 0xF0004 | Elink tranmit config
ESYSRX | 0xF0008 | Elink receiver config
ESYSCLK | 0xF000C | Clock config
ESYSCOREID | 0xF0010 | ID to drive to Epiphany chip
ESYSVERSION | 0xF0014 | Platform version
ESYSDATAIN | 0xF0018 | Direct data from elink receiver
ESYSDATAOUT | 0xF001C | Direct data for elink transmitter
ESYSDEBUG | 0xF0020 | Various debug signals
---------------------------------------------------------------------------
EMBOXLO | 0xC0004 | Lower 32 bits of 64 bit wide mail box fifo
EMBOXHI | 0xC0008 | Upper 32 bits of 64 bit wide mail box fifo
---------------------------------------------------------------------------
ESYSMMURX | 0xE0000 | Start of receiver MMU lookup table
ESYSMMUTX | 0xD0000 | Start of transmit MMU lookup table (tbd)
########################################################################
ELINK CONFIGURATION REGISTER (32bit access)
########################################################################
-------------------------------------------------------------
ESYSRESET ***Elink reset***
[0] 0 - elink active
1 - elink in reset
-------------------------------------------------------------
ESYSTX ***Elink transmitter configuration***
[0] 0 - link TX disable
1 - link TX enable
[1] 0 - normal pass through transaction mode
1 - mmu mode
[3:2] 00 - normal mode
01 - gpio drive mode
10 - reserved
11 - reserved
[7:4] Transmit control mode for eMesh
[8] AXI slave read timeout enable
-------------------------------------------------------------
ESYSRX ***Elink receiver configuration***
[0] 0 - link RX disable
1 - link RX enable
[1] 0 - normal transaction mode
1 - mmu mode
[3:2] 00 - normal mode
01 - gpio sample mode (drive rd wait pins from registers)
10 - reserved
11 - reserved
-------------------------------------------------------------
ESYSCLK ***Epiphany clock frequency setting***
[0] Enable CCLK
[1] Enable TX_LCLK
[2] CCLK PLL bypass mode (cclk is set to clkin)
[3] LCLK PLL bypass mode (lclk is set to clkin)
[7:4] CCLK PLL Divider (1<<reg)
0000 - CLKIN/1
0001 - CLKIN/2
0010 - CLKIN/4
0011 - CLKIN/8
0100 - CLKIN/16
0101 - CLKIN/32
0110 - CLKIN/64
0111 - CLKIN/128
1xxx - RESERVED
[11:8] Elink PLL Divider (1<<reg)
0000 - CLKIN/1
0001 - CLKIN/2
0010 - CLKIN/4
0011 - CLKIN/8
0100 - CLKIN/16
0101 - CLKIN/32
0110 - CLKIN/64
0111 - CLKIN/128
1xxx - RESERVED
[15:12] PLL Frequency
0000 -
0001 -
0010 -
0011 -
0100 -
0101 -
0110 -
0111 -
1000 -
1001 -
1010 -
1011 -
1100 -
1101 -
1110 -
1111 -
-------------------------------------------------------------
ESYSCOREID ***CORE ID***
[5:0] Column ID-->default at powerup/reset
[11:6] Row ID
-------------------------------------------------------------
ESYSLATFORM ***Platform ID (read only)***
[7:0] Platform model number
-------------------------------------------------------------
ESYSDATAIN ***Data on elink input pins
[7:0] rx_data[7:0]
[8] tx_frame
[9] tx_wait_rd
[10] tx_wait_wr
-------------------------------------------------------------
ESYSDATAOUT ***Data on eLink output pins
[7:0] tx_data[7:0]
[8] tx_frame
[9] rx_wait_rd
[10] rx_wait_wr
-------------------------------------------------------------
ESYSDEBUG ***Various debug signals from elink
[31] embox_not_empty
//RX signals
[30] emesh_rx_rd_wait
[29] emesh_rx_wr_wait
[28] esaxi_emrr_rd_en
[27] emrr_full
[26] emrr_progfull
[25] emrr_wr_en
[24] emaxi_emrq_rd_en
[23] emrq_progfull
[22] emrq_wr_en
[21] emaxi_emwr_rd_en
[20] emwr_progfull
[19] emwr_wr_en (rx)
//TX signals
[18] e_tx_rd_wait
[17] e_tx_wr_wait
[16] emrr_rd_en
[15] emaxi_emrr_prog_full
[14] emaxi_emrr_wr_en
[13] emrq_rd_en
[12 esaxi_emrq_prog_full
[11] esaxi_emrq_wr_en
[10] emwr_rd_en
[9] esaxi_emwr_prog_full
[8] esaxi_emwr_wr_en
##########Sticky signals below#############
[7] reserved
[6] emrr_full (rx)
[5] emrq_full (rx)
[4] emwr_full (rx)
[3] emaxi_emrr_full (tx)
[2] esaxi_emrq_full (tx)
[1] esaxi_emwr_full (tx)
[0] embox_full (mailbox)
########################################################################
*/
module elink(/*AUTOARG*/
// Outputs
colid, rowid, chip_resetb, cclk_p, cclk_n, rxo_wr_wait_p,
@ -33,7 +256,8 @@ module elink(/*AUTOARG*/
parameter MW = 44;
parameter INC_PLL = 1; //include pll
parameter INC_SPI = 1; //include spi block
parameter ELINKID = 12'h810; //elink ID (used for registers)
/****************************/
/*CLK AND RESET */
/****************************/
@ -50,7 +274,7 @@ module elink(/*AUTOARG*/
output [3:0] colid; //epiphany colid
output [3:0] rowid; //epiphany rowid
output chip_resetb; //chip reset for Epiphany (active low)
output cclk_p, cclk_n; //high speed clock (1GHz) to Epiphany
output cclk_p, cclk_n; //high speed clock (1GHz) to Epiphany
//Receiver
input rxi_lclk_p, rxi_lclk_n; //link rx clock input
@ -70,8 +294,8 @@ module elink(/*AUTOARG*/
/*AXI master interface */
/*****************************/
//Clock and reset
input m_axi_aclk;
input m_axi_aresetn;
input m_axi_aclk; //axi master clock
input m_axi_aresetn; //axi master reset (active low)
//Read address channel
output [31:0] m_axi_araddr; //read address
@ -95,19 +319,19 @@ module elink(/*AUTOARG*/
output [2:0] m_axi_awsize;
output m_axi_awvalid;
//Buffered write response channel
//Write response channel
output m_axi_bready;
input [1:0] m_axi_bresp;
input m_axi_bvalid;
//Read channel
//Read data channel
input [63:0] m_axi_rdata;
input m_axi_rlast; //indicates last transfer of a burst
output m_axi_rready; //read ready signal
input [1:0] m_axi_rresp;
input m_axi_rvalid;
//Write channel
//Write data channel
output [63:0] m_axi_wdata;
output m_axi_wlast; //indicates last transfer of a burs
input m_axi_wready; //response ready

View File

@ -1,4 +1,3 @@
module erx_io (/*AUTOARG*/
// Outputs
rxo_wr_wait_p, rxo_wr_wait_n, rxo_rd_wait_p, rxo_rd_wait_n,

View File

@ -1,131 +0,0 @@
/*
Copyright (C) 2014 Adapteva, Inc.
Contributed by Andreas Olofsson <andreas@adapteva.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.This program is distributed in the hope
that it will be useful,but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. You should have received a copy
of the GNU General Public License along with this program (see the file
COPYING). If not, see <http://www.gnu.org/licenses/>.
*/
module esaxi_cfg (/*AUTOARG*/
// Outputs
s_axi_arready, s_axi_awready, s_axi_bresp, s_axi_bvalid,
s_axi_rdata, s_axi_rresp, s_axi_rvalid, s_axi_wready, mi_clk,
mi_en, mi_we, mi_addr, mi_din,
// Inputs
s_axi_aclk, s_axi_aresetn, s_axi_araddr, s_axi_arprot,
s_axi_arvalid, s_axi_awaddr, s_axi_awprot, s_axi_awvalid,
s_axi_bready, s_axi_rready, s_axi_wdata, s_axi_wstrb, s_axi_wvalid,
mi_rd_data
);
parameter RFAW = 13;
/*****************************/
/*AXI 32 bit lite interface */
/*****************************/
input s_axi_aclk;
input s_axi_aresetn;
//read address channel
input [15:0] s_axi_araddr;
input [2:0] s_axi_arprot;
output s_axi_arready;
input s_axi_arvalid;
//write address channel
input [15:0] s_axi_awaddr;
input [2:0] s_axi_awprot;
output s_axi_awready;
input s_axi_awvalid;
//buffered read response channel
input s_axi_bready;
output [1:0] s_axi_bresp;
output s_axi_bvalid;
//read channel
output [31:0] s_axi_rdata;
input s_axi_rready;
output [1:0] s_axi_rresp;
output s_axi_rvalid;
//write channel
input [31:0] s_axi_wdata;
output s_axi_wready;
input [3:0] s_axi_wstrb;
input s_axi_wvalid;
/*****************************/
/*Simple memory interface */
/*****************************/
output mi_clk;
output mi_en;
output [3:0] mi_we;
output [15:0] mi_addr;
output [31:0] mi_din;
input [31:0] mi_rd_data;
`ifdef TARGET_XILINX
/*axi_bram_ctrl_16b AUTO_TEMPLATE (
//Outputs
.bram_rst_a (),
.bram_clk_a (mi_clk),
.bram_en_a (mi_en),
.bram_we_a (mi_we[3:0]),
.bram_addr_a (mi_addr[15:0]),
.bram_wrdata_a (mi_din[31:0]),
.bram_rddata_a (mi_rd_data[31:0]),
);
*/
axi_bram_ctrl_16b axi_bram_ctrl_16b(/*AUTOINST*/
// Outputs
.s_axi_awready (s_axi_awready),
.s_axi_wready (s_axi_wready),
.s_axi_bresp (s_axi_bresp[1:0]),
.s_axi_bvalid (s_axi_bvalid),
.s_axi_arready (s_axi_arready),
.s_axi_rdata (s_axi_rdata[31:0]),
.s_axi_rresp (s_axi_rresp[1:0]),
.s_axi_rvalid (s_axi_rvalid),
.bram_rst_a (), // Templated
.bram_clk_a (mi_clk), // Templated
.bram_en_a (mi_en), // Templated
.bram_we_a (mi_we[3:0]), // Templated
.bram_addr_a (mi_addr[15:0]), // Templated
.bram_wrdata_a (mi_din[31:0]), // Templated
// Inputs
.s_axi_aclk (s_axi_aclk),
.s_axi_aresetn (s_axi_aresetn),
.s_axi_awaddr (s_axi_awaddr[15:0]),
.s_axi_awprot (s_axi_awprot[2:0]),
.s_axi_awvalid (s_axi_awvalid),
.s_axi_wdata (s_axi_wdata[31:0]),
.s_axi_wstrb (s_axi_wstrb[3:0]),
.s_axi_wvalid (s_axi_wvalid),
.s_axi_bready (s_axi_bready),
.s_axi_araddr (s_axi_araddr[15:0]),
.s_axi_arprot (s_axi_arprot[2:0]),
.s_axi_arvalid (s_axi_arvalid),
.s_axi_rready (s_axi_rready),
.bram_rddata_a (mi_rd_data[31:0])); // Templated
`endif // `ifdef TARGET_XILINX
endmodule // esaxi_cfg
// Local Variables:
// verilog-library-directories:("." "../../stubs/hdl")
// End: