-
Notifications
You must be signed in to change notification settings - Fork 653
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
Serial-tilelink backing memory #673
Conversation
70369a2
to
6c5bce5
Compare
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.
Right now this seems a little strange to me. In my opinion there are really 2 choices to make:
Do you have a serial port going off chip?
What protocols does it support (in, out, in+out)?
This implementation often seems to end up with a strange duplication because its making the choice:
Do you have inward serial support?
Do you have outward serial support?
This ends up with duplicated code and sometimes RTL.
N.B. Usually we only build configurations that are in-only (simulation-only mostly), or in+out (almost all silicon).
I could imagine building an out-only system where jtag is used to do the in half and the serial port does the out half, but its not much more hardware to support in+out over the serial interface.
Also is there a testchipip PR with the changes here? |
I'll open a testchipip PR after the harnessbinders stuff goes in. The reason I split the two serial types is because serialized-TSI and serialized-TL are really two mostly orthogonal serial interfaces.
I don't think there is much duplication to support use-case 4. The At a general principle, I think each Trait-IOBinder-HarnessBinder "vertical" should correspond to an interface and its use case, rather than just the interface itself. For the same reason why we have separate traits/IOBinders/HarnessBinders/ for each external AXI4 type, we should have separate traits/IOBinders/HarnessBinders for serialized tilelink and serialized TSI. |
Personally, I've struggled enough with the LBWIF code that I think we should scrap it and implement a simpler protocol that doesn't make the host-side RTL dependent on the target configuration (no source/sink ID bits, no address bitwidth dependency, etc.) |
The solution is to deprecate support for the on-chip serial-adapter, and only support serialized-tilelink. |
I don't think so- if you are serializing tilelink your host RTL still needs to be aware of the chip's TL parameters. A more generic, higher-level transfer protocol (even one that has TL ports on either end), would get rid of that dependency. Even if you solved the problem of generating the host RTL automatically (as I/we have proposed in the past), you still run into trouble if you want to test multiple chips with the same FPGA bitstream. |
Sorry, I meant the solution to the duplication between Serial-TL and Serial-TSI. I agree improvements to the serialization protocol could reduce the host-dependency on the chip. Perhaps chiplink might be a place to look, but I think that might be over-engineered for our use case. |
I think you won't be able to get around a dependency on the chip RTL (without wasting on-chip hardware). The solution we talked about today is going to do the correct inspection of chip parameters from the harness side to ensure that everything matches up. |
Maybe we should support different serialization via a parameter? If it is constrained to TL on both ends and Clocked[SerialIO] in the middle people should be able to explore different variants. |
The testchipip PR I will open contains a |
I disagree, but maybe we should discuss what some reasonable tradeoffs would be in a separate forum |
Sure. We can take the discussion offline. |
I think it's fine to merge this in, but my main goal would be to prevent anyone from taping out with this, because that would then require supporting this for another year or two. We have an opportunity to break that cycle now, I think. |
As anyone looked at chiplink for serializing tilelink? |
It wasn't public last time I needed something like it. |
There seems to be stuff in sifive-blocks: https://github.com/sifive/sifive-blocks/blob/master/src/main/scala/devices/chiplink/ChipLink.scala And freedom references chiplink in a couple places. I think there is value in preserving this simpler protocol, as long as it works and the limitations are clear. |
I don't think this is a "Simple" protocol; I would argue it is actually overly complex. It may be simple in concept ("Just take tilelink and serialize it"), but it's extremely fragile and difficult to debug because there's so much context dependence to each 32-bit packet. |
Lets move this discussion to ucb-bar/testchipip#98 |
a6f4e37
to
0d8e871
Compare
I've removed the on-chip serial-adapter support. Now all designs use an external serial-adapter. |
50e31cc
to
269af01
Compare
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.
A few nitty comments, but LGTM.
(system: CanHavePeripherySerial, th: HasHarnessSignalReferences, ports: Seq[ClockedIO[SerialIO]]) => { | ||
ports.map { p => SerialAdapter.tieoff(Some(p.bits)) } | ||
Nil | ||
class WithSerialAdapterTiedOff extends OverrideHarnessBinder({ |
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.
These two classes are intended to be mutually exclusive, right?
I think if they aren't there is some potentially weird behavior where the SimSerial is still connected to success and FESVR but not connected to the chip.
I also wonder if we would ever get a request for WithSerialMemTiedOff
.
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.
Thinking about this a little bit more I think the SimSerial widget will just hang when there is no chip response so success will never go spuriously high.
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.
They are mutually exclusive. I
|
||
trait CanHaveHTIF { this: BaseSubsystem => | ||
// Advertise HTIF if system can communicate with fesvr | ||
if (this match { | ||
case _: CanHavePeripherySerial if p(SerialKey) => true | ||
case _: CanHavePeripheryTLSerial if p(SerialTLKey).nonEmpty => true |
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 you mix in WithSerialAdapterTiedOff
this should be false. Not sure if the keys value is able to change that, but I don't think so.
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.
WithSerialAdapterTiedOff is a harness-configuration fragment, so it should probably not affect this chip-generator code.
@@ -131,7 +131,7 @@ class FireSimSmallSystemConfig extends Config( | |||
new WithoutClockGating ++ | |||
new WithoutTLMonitors ++ | |||
new freechips.rocketchip.subsystem.WithExtMemSize(1 << 28) ++ | |||
new testchipip.WithTSI ++ | |||
new testchipip.WithDefaultSerialTL ++ |
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.
This small config seems like a good place to put a FireSim that test LBWIF. (reduces number of off-chip IOs of the modeled system by a lot)
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'm currently uncertain if FireSim configs without the AXI4 backing memory work correctly, since they use a separate channel to write the program binary into DRAM.
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.
They don't work correctly, issue opened here: firesim/firesim#627
80a22ca
to
6372af2
Compare
6372af2
to
b9622c5
Compare
This adds support for "LBWIF" backing memory through serialized tilelink. Default configs still use the AXI4 port, but more realistic "chip-like" configs can set the lbwif memory to be used as main backing memory.
Additionally, the SerialAdapter is moved offchip, as it should be considered a harness-level component that can access the chip through the serial TileLink port.
Adding support for other memory channels ("hbwif"), or using a different protocol for request serialization remains future work.