-
Notifications
You must be signed in to change notification settings - Fork 632
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
AXI4 to Tilelink converter at RoCC Module #1187
Comments
Try |
Thank you @jerryz123 for comment. |
Two things:
AFAIK, Diplomacy won't work like you expect it to in the LazyModuleImp.
You're connecting a source to another source. If you wanna use your source, simply ignore the TLClientNode. If that source points to some sink outside of this (probably system xbar? I haven't looked at LazyRoCC's code yet), you need to point your source to that as well (assuming it's a xbar or add a xbar if necessary). |
LazyRoCC code snippet: abstract class LazyRoCC(
val opcodes: OpcodeSet,
val nPTWPorts: Int = 0,
val usesFPU: Boolean = false
)(implicit p: Parameters) extends LazyModule {
val module: LazyRoCCModuleImp
val atlNode: TLNode = TLIdentityNode()
val tlNode: TLNode = TLIdentityNode()
}
class LazyRoCCModuleImp(outer: LazyRoCC) extends LazyModuleImp(outer) {
val io = IO(new RoCCIO(outer.nPTWPorts))
}
/** Mixins for including RoCC **/
trait HasLazyRoCC extends CanHavePTW { this: BaseTile =>
val roccs = p(BuildRoCC).map(_(p))
roccs.map(_.atlNode).foreach { atl => tlMasterXbar.node :=* atl }
roccs.map(_.tlNode).foreach { tl => tlOtherMastersNode :=* tl }
nPTWPorts += roccs.map(_.nPTWPorts).sum
nDCachePorts += roccs.size
}
It looks like the LazyRocc atlnode is already an identity node. Don't override that with a ClientNode! Just replace memoryTap with atlNode. Probably to get diplomacy to work as intended, you'll want to move those diplomatic connections to the LazyModule. |
Thank @michael-etzkorn for comment. You pointed out two things from my code.
I got error as below:
Secondly, i understood your explaination about two sources connecting to each other. Initial code was wrong. My intention is to connect source and sink as below. Source from mAccelerator is memAXI4Node. Sink i want to connect is system xbar. i would be very appreciated if you could try these code file or write down some samples code so that i can try on my own. |
So I might be off here, but intuition tells me you're seeing that error because the diplomatic connections have to be above the declaration of the module. Move the master node declaration outside of the implementation as well. val memAXI4Node = AXI4MasterNode(Seq(AXI4MasterPortParameters(
masters = Seq(AXI4MasterParameters(
name = "rocc_maxi4",
))
))
) should be in the outer module. Reference it from within the LazyModuleImp as Also, there should also be no reason to override module because it's an abstract member of class mAccelerator(opcodes: OpcodeSet) (implicit p: Parameters) extends LazyRoCC(opcodes)
{
val memAXI4Node = AXI4MasterNode(Seq(AXI4MasterPortParameters(
masters = Seq(AXI4MasterParameters(
name = "rocc_maxi4",
))
))
)
(atlNode := AXI4ToTL() := AXI4UserYanker(Some(2)) := AXI4Fragmenter() := memAXI4Node)
lazy val module = Module(new mAcceleratorModuleImp(this))
} Then you could replace the declaration in ModuleImp with Your config is the first time I've seen that approach with a key so I don't know if that works, but since Jerry didn't comment on it, I assume that's how |
@michael-etzkorn
|
I'm still not quite sure how I feel about referring to a node within the The opposite is usually done i.e. within As a general rule of thumb
The override was probably to turn the identity node into a TLClient for that use case, but here you can just use the identity node. I like to think of Identity Nodes as a sort of way point node between a source and a sink. Perfect for what you were trying to do which is connect an AXI source to some TL Node that can be connected to memory by a Tile. Glad the design's elaborating! Best of luck with the rest of your project! |
@michael-etzkorn thank you for your help. |
I don't believe
|
thank you |
Yeah, I was looking at this for a separate issue. There needs to be a better error message here. I can help look into that soon enough. Coherence is a cache concept for ensuring clients accessing separate caches can still access the most recent data by whatever memory ordering model is being used. The caches are said to be https://en.wikipedia.org/wiki/Cache_coherence Using the Broadcast Manager should be more lightweight than the L2 Inclusive Cache. Footnotes
|
My config is as follow
Error is as follow:
|
From your comment, i can imagine that core is client 1 and my RoCC module is client 2. I do not think my design needs coherent. Thank you |
Is the Broadcast Manager with your RoCC also facing timing issues? I haven't had a chance to look into how to remove the L2 Cache more than Hopefully @jerryz123 can weigh. It seems like this may involve chipsalliance/rocket-chip#2978 or I'm just missing something with taking out the coherence manager. |
Use WithBroadcastManager instead of WithNBanks and WithIncoherentBusTopology |
With @jerryz123 's suggestion, i was able to run simulation with my config as follow:
However, when trying to insert this config into FPGA project, i got error like this #1169
|
from what @michael-etzkorn commented on #1169, i added signals prot and cache on
However, it still shows the same error relating to ddr memory connection at this class
|
It has to be done on the |
@michael-etzkorn i added the following lines to class WithDDRMem and it worked
However, i still wonder if the value is correct. My system using L1 cache only. therefore, i assumed that system needs "read and write allocate". according to table A4-5 Memory type encoding of AXI4 specification. |
Background Work
Chipyard Version and Hash
Release: 1.5.0
Hash: a6a6a6
OS Setup
Ex: Output of
uname -a
andlsb_release -a
LSB Version: core-9.20170808ubuntu1-noarch:printing-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
Other Setup
Ex: Prior steps taken / Documentation Followed / etc...
Current Behavior
I want to create an converter to my AXI4 interface of my RoCC module to connect with Crossbar L2 memory.
You can see whole implementation as below.
AXI4 is converted and transferred into node atlNode of RoCC interfaces to connect with crossbar L2 memory of the system.
[my Module] w. AXI4 interface of RoCC module <-> AXI4ToTL node <-> atlNode (Tilelink node) of crossbar L2 memory.
The default RoCC interface signals may be classified into the following groups of signals
The extended RoCC interface can provide for the following groups of signals
However, it keeps printing error saying that "The following node was incorrectly connected as a source to TOP.memoryTap"
mRocketConfig.log
Expected Behavior
How to connect custom accelerator module with AXI4 interface with RoCC interface atlNode
Other Information
No response
The text was updated successfully, but these errors were encountered: