-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
treewide: Add idma to ethernet #3
base: main
Are you sure you want to change the base?
Conversation
internal clk gen removed : ) |
Bender.yml
Outdated
common_verification : { git: "https://github.com/pulp-platform/common_verification.git", version: 0.2.3 } | ||
register_interface : { git: "https://github.com/pulp-platform/register_interface.git", version: 0.4.2 } | ||
common_cells: { git: "https://github.com/pulp-platform/common_cells.git", version: 1.32.0 } | ||
idma: { git: "[email protected]:pulp-platform/iDMA.git", rev: "a80fcac" } # branch: cl/idma-eth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we are pointing to main
now, so update the comment
README.md
Outdated
@@ -17,6 +17,12 @@ used. | |||
`pulp-ethernet` is intended for use with https://github.com/pulp-platform/ariane | |||
(a RISCV Linux-capable soft core). | |||
|
|||
## Generate iDMA with AXIS support (Terminal) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to
## Generate iDMA
since we generate it with all protocols
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i also updated the make rules in the readme as i can see they are modified in the mk
@@ -18,18 +18,18 @@ | |||
|
|||
REGTOOL ?= regtool.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add also the commands to generate the register list as markdown file? This command should make it: https://github.com/pulp-platform/carfield/blob/main/carfield.mk#L236
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! i will include it in my next commit.
} | ||
] | ||
}, | ||
{ name: "src_addr", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prepend idma-specific registers with idma_
Also, design question to be discussed with @thommythomaso
AFAIU, this register file for ethernet-idma contains also the registers of the 'idma' part.
Since the idma already comes with its register file in different flavors, should we reuse that, and add the ethernet-specific registers as separate RF?
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, i was suggested to have a unified reg file at the beggining
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replying to this before you change something: let's keep things like now (1 register file) :) in the future we can decouple and reuse the RF, now let's focus on functionality. I just wanted to point it out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure. thanks!
rtl/eth_idma_pkg.sv
Outdated
// Solderpad Hardware License, Version 0.51, see LICENSE for details. | ||
// SPDX-License-Identifier: SHL-0.51 | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing authorship
// Authors:
// blabla
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i removed this eth_idma_pkg in another cleaner branch to leave the axi and register interface related typedef open to the users. [https://github.com/pulp-platform/pulp-ethernet/blob/cl/eth_idma/rtl/eth_idma_wrap.sv] check it out to see if it makes sense to you : )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you prefer; for me, the less files the better, unless the information really needs to stay in a package for portability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
understood. then i will remove it : )
rtl/eth_idma_pkg.sv
Outdated
package eth_idma_pkg; | ||
|
||
/// Ethernet reg typedefs | ||
parameter int AW_REGBUS = 32; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming conventions for tunable parameters according to the coding style-guide in System Verilog that we follow recommends using camel case: https://github.com/lowRISC/style-guides/blob/master/VerilogCodingStyle.md#summary-2
@chaoqun-liang can you please apply this to all parameters of this repo? I see that sometimes you do it, and sometimes you don't, needs to be consistent
rtl/eth_idma_pkg.sv
Outdated
typedef struct packed { | ||
axi_aw_chan_t aw_chan; | ||
logic[max_width(axi_aw_chan_width, axis_t_chan_width)-axi_aw_chan_width:0] padding; | ||
} axi_write_aw_chan_padded_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why this padding is required? Is it to handle the case where axi stream width is larger than axi?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the padding type is required in the meta channel definition in idma backend.
rtl/eth_idma_pkg.sv
Outdated
@@ -0,0 +1,102 @@ | |||
// Copyright 2023 ETH Zurich and University of Bologna. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright 2024
)( | ||
input logic clk_i, | ||
input logic rst_ni, | ||
/// Etherent Internal clocks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling typo, Ethernet
rtl/eth_idma_wrap.sv
Outdated
|
||
logic idma_req_valid, req_ready, idma_rsp_ready, rsp_valid; | ||
|
||
localparam idma_pkg::error_cap_e ErrorCap = ErrorHandling ? ERROR_HANDLING : NO_ERROR_HANDLING; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does Cap
in ErrorCap
mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to idma_pkg, it stands for error handling capability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment please?
rtl/eth_top.sv
Outdated
@@ -1,4 +1,4 @@ | |||
// Copyright 2023 ETH Zurich and University of Bologna. | |||
/// Copyright 2023 ETH Zurich and University of Bologna. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing /
, remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright 2024
rtl/framing_top.sv
Outdated
// Authors: | ||
// - Jonathan Kimmitt <[email protected]> | ||
// - Thiemo Zaugg <[email protected]> | ||
// See LICENSE for license details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restore original license header and authors, append your name if you did modify the file
target/sim/src/eth_tb.sv
Outdated
`AXI_STREAM_ASSIGN(rx_framing_slave_dv, rx_axis_rx_big); | ||
// ------------------------ BEGINNING OF SIMULATION ------------------------ | ||
|
||
initial begin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use this module in common_verification
to generate the clock: https://github.com/pulp-platform/common_verification/blob/master/src/clk_rst_gen.sv
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! i will use it to generate the in-phase 125Mhz. for the phase shifted one, i guess i need to stick with this.
target/sim/src/eth_tb.sv
Outdated
// ------------------------ BEGINNING OF SIMULATION ------------------------ | ||
|
||
initial begin | ||
while (!done) begin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why guarding this with while (!done)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry that was from the original tb i started buidling on. forgot to remove it : (
@chaoqun-liang I left some initial (minor) comments I'll give another round after we add the modifications to get it 'working' on FPGA |
Bender.yml
Outdated
common_cells: { git: "https://github.com/pulp-platform/common_cells.git", version: 1.32.0 } | ||
axi_stream: { git: "[email protected]:pulp-platform/axi_stream.git", rev: "472751f550e3918215603e21734fe0ece3c66f79" } | ||
axi : { git: "[email protected]:pulp-platform/axi.git", version: 0.39.1 } | ||
axi_mem_if : { git: [email protected]:pulp-platform/axi_mem_if.git, version: 0.2.1 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I am not mistaken, axi_mem_if
is not required anymore; if so, please remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a "axi to mem" module is required, we have several in the axi
repo (axi_to_mem_*
), but iirc this was before adding the dma, when ethernet had buffers inside
This PR adds idma to ethernet with an AXI stream interface
@chaoqun-liang This PR is a draft, and I will review it with @thommythomaso next week.
Note that there is a CI associated with it, that runs on this mirror (https://iis-git.ee.ethz.ch/github-mirror/pulp-ethernet). The CI runs your standalone test and elaboration in gf22 technology
First comments
The main issue to fix is the clock generation logic. Two main concerns on the current implementation:
The clock generation is handled internally. We prefer to expose the clock signals with different phases and handle clock generation logic in the system where ethernet is integrated~~
The way the eth clock is generated right now is behavioral and non-synthesizable (
fll_dummy
). Anyway, we are going to remove the clock generation logic and handle it outside of the IP, using clock dividers to get the clock frequency. Whether to use delay lines orclk_gen_hyper
is up to discussion with the system's maintainers (for now: Al-Sqr and Cheshire).When this PR will be ready
We need to strengthen standalone verification (add
random
tests other thendirected
tests)We need to have evidence of the IP working in-system via FPGA prototyping. This means:
Al-Saqr, on the FPGA where it is deployed
Cheshire, on the FPGA where it is deployed
We need to have a synthesizable design (run elab and compilation through the CI)
Since we already have directed verification for 1., we can focus on 2. for the moment. 3. is always important.