AXI4 VIP development and integration - #688
Conversation
01fb3d1 to
3863316
Compare
rswarbrick
left a comment
There was a problem hiding this comment.
Thank you very much for doing this (and getting my completely untested code working...)
Do you think you could cherry-pick the various fixes in "axi agent compilation fixes" to the commits that made the mistakes? Since we don't use squash merge in Mocha, this is a way to avoid putting Rupert's silly mistakes into the history :-)
Hey Rupert, Sure, I can merge the patches into your commits. This would also encompass the handshaking bugfix commit, for a total of two commits :) |
This is the first step towards a simple AXI agent. It will only have to handle the subset of AXI that is in use in the blocks in question (which work by translating to TLUL, so they aren't doing anything particularly exciting). In this commit, we're just defining interfaces for the five channels (which are AW, W, B, AR and R). Co-authored-by: tchilikov-semify <christian.tchilikov@semify-eda.com>
The axi_read_request_item and axi_read_data_item classes are intended to be randomised (when a sequence wishes to send either read requests or data responses). The axi_read_item class can be used by a monitor that sees a read request and then one or more responses. Co-authored-by: tchilikov-semify <christian.tchilikov@semify-eda.com>
When the agent is representing an AXI Manager, this will be useful for the B and R channels. Co-authored-by: tchilikov-semify <christian.tchilikov@semify-eda.com>
These drive write requests (AW) and write data (W) and also drive the write response channel (B). Co-authored-by: tchilikov-semify <christian.tchilikov@semify-eda.com>
Co-authored-by: tchilikov-semify <christian.tchilikov@semify-eda.com>
Co-authored-by: tchilikov-semify <christian.tchilikov@semify-eda.com>
For an example use-case, suppose you are reading with AR / R
transfers. You send an AR transfer with some ARID that will have a
burst with k beats. Now you want consume read data with that many (k)
R transfers using the some ID.
To do so:
- Run k axi_mgr_read_data_seq sequences, calling on_response() after
each finishes.
- (In parallel) call wait_for_response() k times.
The trick is that these sequences might respond with different IDs,
but that doesn't matter: the sequences are just actings as tokens to
allow *something* to come back.
3863316 to
0d44df6
Compare
|
Hey @rswarbrick, In the meanwhile, I've folded the old compilation bugfixes commit into the respective commits that you made, so the commit history should be clear of bugs now. |
a5c0dab to
6550b3a
Compare
|
The AXI driver has been ran past the ARM axi4 protocol assertions using the axi_sram.sv of mocha as a DUT as a preliminary validity check. The driver exercised the majority of the testcases from #667 and the assertions did not fire or indicate incorrect behavior, suggesting correct functionality thus far. |
To do so, we add a (pretty trivial) reg_adapter and a sequencer in a layered vseq that runs the resulting translated items. Co-authored-by: tchilikov-semify <christian.tchilikov@semify-eda.com>
c90d65e to
b5b685e
Compare
rswarbrick
left a comment
There was a problem hiding this comment.
Here are some notes about the "fix axi handshaking" and "multi-beat transaction support" commits.
These both look really good: I like the code, and it's just some nitty notes about comments.
rswarbrick
left a comment
There was a problem hiding this comment.
Two more minor notes about "add multi-beat transaction support"
rswarbrick
left a comment
There was a problem hiding this comment.
A minor note about error messages in "add clk_rst_if to axi interfaces". (I really like this change though!)
rswarbrick
left a comment
There was a problem hiding this comment.
Some notes about the (excellent!) change that adds axi_widths_pkg. They're all about alignment: sorry - very boring.
rswarbrick
left a comment
There was a problem hiding this comment.
One specific question: Is there a good reason to use dv_base_agent for the IP? It's designed to a very specific OpenTitan shape, as chosen by the DV lead at the time.
It's also actively against my design for this agent. If someone more important than me mandates that we use the class, I guess we have to. If not, I'd prefer we didn't.
| parameter int UserWidth = 1, | ||
| parameter uvm_pkg::uvm_active_passive_enum IsActive = uvm_pkg::UVM_ACTIVE, | ||
| parameter string InstId = "axi_mgr", // names the published axi_agent_cfg | ||
| parameter string CfgScope = "*" // config_db publish scope glob |
There was a problem hiding this comment.
Is this design following a pattern for which you have a reference? I'm slightly surprised that you don't set things in the config db from the testbench, rather than the interface that gets instantiated.
There was a problem hiding this comment.
Yes! The intent of this file is perhaps quite unclear from the perspective of this PR... Its purpose is to take the shape of the AXI peripherals used in mocha. In our agent, the AXI bus is represented by 5 interfaces, which map to the channels. In mocha, the AXI devices have ports which are represented by 2 interfaces, basically inputs and outputs (req and resp). This interface bridges the two.
| // clear, the payload is randomised instead: still meaningless, but defined. | ||
| // | ||
| // Defaults set, so an idle channel drives X. | ||
| bit drive_x_when_idle = 1'b1; |
There was a problem hiding this comment.
I'm repeating myself here, but I think this should be set by calling a setter on the agent, which calls a setter on each of the drivers.
Note that you wrote earlier that the agent config just contained a list of virtual interfaces. I wasn't convinced. I'm still not :-)
There was a problem hiding this comment.
Yes perhaps an agent wide config permeated into the configs... You were right in this regard. 😉
For my understanding, are you proposing that the agent reads this config and then calls the setters of the drivers, rather than passing the config directly to the drivers? This value is a genuine agent-wide knob, so I think it should live in the config. Is this what you had in mind?
b5b685e to
34e89c4
Compare
Honestly - its not strictly needed. This was a suggestion from an internal review that Martin did with Claude, which he told me to implement if it seems fitting. I thought it was fitting, since I saw that other mocha TBs use the dv base classes, but honestly I don't have a strong opinion on this (and honestly, I think the less dependencies an independent agent has, the better). Shall I remove it? |
34e89c4 to
70f76a5
Compare
Merge per-channel reset monitors into a unified reset monitor by introducing a shared clock and reset interface to the agent.
Add AXI transaction monitor which snoops the 5 channels and rebuilds AXI transactions, then broadcasts them. Monitor is built unconditionally.
70f76a5 to
da139c9
Compare
|
Hey @rswarbrick - thanks for the in depth review again! It seems this PR is starting to come together 😄 I think I've addressed most of your comments. There's still 1 or 2 open questions, but I've re-triggered another review. Thanks! |
This PR does a few things:
This was tested with the top level CVA6-based test cases.
Will close issue #168