Skip to content
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

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

treewide: Add idma to ethernet #3

wants to merge 12 commits into from

Conversation

alex96295
Copy link
Collaborator

@alex96295 alex96295 commented Feb 16, 2024

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 or clk_gen_hyper is up to discussion with the system's maintainers (for now: Al-Sqr and Cheshire).

  1. There are (many) other smaller things that we will point out during the review

When this PR will be ready

  • We need to strengthen standalone verification (add random tests other then directed 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.

@alex96295 alex96295 added the enhancement New feature or request label Feb 16, 2024
@chaoqun-liang
Copy link

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
Copy link
Collaborator Author

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)
Copy link
Collaborator Author

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

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
Copy link
Collaborator Author

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

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",
Copy link
Collaborator Author

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?

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

Copy link
Collaborator Author

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure. thanks!

// Solderpad Hardware License, Version 0.51, see LICENSE for details.
// SPDX-License-Identifier: SHL-0.51


Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing authorship

// Authors:
// blabla

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 : )

Copy link
Collaborator Author

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

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 : )

package eth_idma_pkg;

/// Ethernet reg typedefs
parameter int AW_REGBUS = 32;
Copy link
Collaborator Author

@alex96295 alex96295 Feb 23, 2024

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

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;
Copy link
Collaborator Author

@alex96295 alex96295 Feb 23, 2024

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?

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.

@@ -0,0 +1,102 @@
// Copyright 2023 ETH Zurich and University of Bologna.
Copy link
Collaborator Author

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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling typo, Ethernet


logic idma_req_valid, req_ready, idma_rsp_ready, rsp_valid;

localparam idma_pkg::error_cap_e ErrorCap = ErrorHandling ? ERROR_HANDLING : NO_ERROR_HANDLING;
Copy link
Collaborator Author

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?

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

Copy link
Collaborator Author

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.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing /, remove

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright 2024

// Authors:
// - Jonathan Kimmitt <[email protected]>
// - Thiemo Zaugg <[email protected]>
// See LICENSE for license details.
Copy link
Collaborator Author

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

`AXI_STREAM_ASSIGN(rx_framing_slave_dv, rx_axis_rx_big);
// ------------------------ BEGINNING OF SIMULATION ------------------------

initial begin
Copy link
Collaborator Author

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

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.

// ------------------------ BEGINNING OF SIMULATION ------------------------

initial begin
while (!done) begin
Copy link
Collaborator Author

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)?

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 : (

@alex96295
Copy link
Collaborator Author

@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 }
Copy link
Collaborator Author

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

Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants