Commit 86751f6f authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

sims/nic/corundum: increase ethernet stream width

We had this set to 64bit which is too small for 100G. Bumped it up to
512.
parent 46b08b52
...@@ -622,11 +622,12 @@ class EthernetTx { ...@@ -622,11 +622,12 @@ class EthernetTx {
top.tx_axis_tready = 1; top.tx_axis_tready = 1;
if (top.tx_axis_tvalid) { if (top.tx_axis_tvalid) {
/* iterate over all 8 bytes */ /* iterate over all bytes on the bus */
for (size_t i = 0; i < 8; i++) { uint8_t *txbus = (uint8_t *) &top.tx_axis_tdata;
if ((top.tx_axis_tkeep & (1 << i)) != 0) { for (size_t i = 0; i < sizeof(top.tx_axis_tdata); i++) {
if ((top.tx_axis_tkeep & (1ULL << i)) != 0) {
assert(packet_len < 2048); assert(packet_len < 2048);
packet_buf[packet_len++] = (top.tx_axis_tdata >> (i * 8)); packet_buf[packet_len++] = txbus[i];
} }
} }
...@@ -705,12 +706,12 @@ class EthernetRx { ...@@ -705,12 +706,12 @@ class EthernetRx {
std::cout << "rx from " << fifo_pos_rd << std::endl; std::cout << "rx from " << fifo_pos_rd << std::endl;
#endif #endif
top.rx_axis_tkeep = 0; top.rx_axis_tkeep = 0;
top.rx_axis_tdata = 0; uint8_t *rdata = (uint8_t *) &top.rx_axis_tdata;
size_t i; size_t i;
for (i = 0; i < 8 && packet_off < fifo_lens[fifo_pos_rd]; i++) { for (i = 0; i < sizeof(top.rx_axis_tdata) &&
top.rx_axis_tdata |= ((uint64_t)fifo_bufs[fifo_pos_rd][packet_off]) packet_off < fifo_lens[fifo_pos_rd]; i++) {
<< (i * 8); rdata[i] = fifo_bufs[fifo_pos_rd][packet_off];
top.rx_axis_tkeep |= (1 << i); top.rx_axis_tkeep |= (1ULL << i);
packet_off++; packet_off++;
} }
top.rx_axis_tvalid = 1; top.rx_axis_tvalid = 1;
......
...@@ -135,7 +135,7 @@ module interface # ...@@ -135,7 +135,7 @@ module interface #
// DMA RAM pipeline stages // DMA RAM pipeline stages
parameter RAM_PIPELINE = 2, parameter RAM_PIPELINE = 2,
// Width of AXI stream interfaces in bits // Width of AXI stream interfaces in bits
parameter AXIS_DATA_WIDTH = 64, parameter AXIS_DATA_WIDTH = 512,
// AXI stream tkeep signal width (words per cycle) // AXI stream tkeep signal width (words per cycle)
parameter AXIS_KEEP_WIDTH = AXIS_DATA_WIDTH/8, parameter AXIS_KEEP_WIDTH = AXIS_DATA_WIDTH/8,
// Max transmit packet size // Max transmit packet size
......
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