-
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
Diplomatic multiclock #614
Conversation
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.
Seems to be a reasonable first pass. I can see how this would be used for more complicated clock driving strategies at the top-level.
I agree with the TODOs in your initial comment, we should have a rational clock tile crossing example with the divider built in and an async tile crossing with two clocks driving from off chip.
3ef0e68
to
48e700e
Compare
48e700e
to
c023cf0
Compare
05e3385
to
ffd3b2d
Compare
ffd3b2d
to
56e1aeb
Compare
I cleaned this up substantially. Changes include
|
3b7edfd
to
f13e864
Compare
f13e864
to
578ae6f
Compare
f69b293
to
abc75e9
Compare
// The implicit clock and reset for the system is also, by convention, used for all the IOBinders | ||
// TODO: This may not be the right thing to do in all cases | ||
withClockAndReset(implicit_clock, implicit_reset) { | ||
val (_ports, _iocells, _harnessFunctions) = p(IOBinders).values.flatMap(f => f(lSystem) ++ f(lSystem.module)).unzip3 |
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 think we will want to understand how to generate the clock for the test harness side of things.
I don't think we want to have the parts inside the system punch their clock into the test harness.
Either the testharness module should be able to recover the clock from an explicit pin that would exist in a real ASIC (e.g. DDR or serial links with clock recovery), or it should explicitly require some configuration of the test harness component to work correctly (e.g. uart baud rate).
But we can discuss this more later.
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 generally agree with the thought here, but i think it gets tricky when we want to model IFs that might not actually be used in a tape out. If we look at memory system AXI4 as a example -- it really has no business going off chip in the first place. It seems to me that it would be OK in this case to add the IO since the IF is not really fit-for-tapeout in the first place.
|
||
simpleClockGroupSourceNode.map { n => n.out.unzip._1.map { out: ClockGroupBundle => | ||
out.member.elements.map { case (name, data) => | ||
// This is mega hacks, how are you actually supposed to do this? |
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 can't be the way, it seems hackier than before there was diplomatic clocking.
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.
💀
At least everything is contained in one place now.
|
||
def success = io.success | ||
def harnessReset = this.reset.asBool | ||
ldut.harnessFunctions.foreach(_(this)) |
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.
None of the IOBinders depended on being called before the success val is set right?
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 don't think so? IOBinders can either set or read the success signal. Are you envisioning a case where the order of evaluation matters?
@@ -17,6 +17,7 @@ class AbstractConfig extends Config( | |||
new chipyard.config.WithBootROM ++ // use default bootrom | |||
new chipyard.config.WithUART ++ // add a UART | |||
new chipyard.config.WithL2TLBs(1024) ++ // use L2 TLBs | |||
new chipyard.config.WithNoSubsystemDrivenClocks ++ // drive the subsystem diplomatic clocks from ChipTop instead of using implicit 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.
Glad we an abstract config 👍
I would be tempted to make the default config the divided version, since that is more "realistic".
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.
That would be cool, if only it worked 😢
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 think we should do that once it does work.
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.
Mostly nits. Cleaning up and unifying the firesim/chipyard handling is going to depend on what SiFive suggests.
// The implicit clock and reset for the system is also, by convention, used for all the IOBinders | ||
// TODO: This may not be the right thing to do in all cases | ||
withClockAndReset(implicit_clock, implicit_reset) { | ||
val (_ports, _iocells, _harnessFunctions) = p(IOBinders).values.flatMap(f => f(lSystem) ++ f(lSystem.module)).unzip3 |
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 generally agree with the thought here, but i think it gets tricky when we want to model IFs that might not actually be used in a tape out. If we look at memory system AXI4 as a example -- it really has no business going off chip in the first place. It seems to me that it would be OK in this case to add the IO since the IF is not really fit-for-tapeout in the first place.
Debug.tieoffDebug(debugPortOpt, resetctrlOpt, Some(psdPort))(system.p) | ||
// tieoffDebug doesn't actually tie everything off :/ | ||
debugPortOpt.foreach { d => | ||
d.clockeddmi.foreach({ cdmi => cdmi.dmi.req.bits := DontCare; cdmi.dmiClock := th.clock }) | ||
// TODO: Using harness clock/reset will be incorrect when systemClock =/= harnessClock |
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.
But the harness is expected to provide the clock here right, so this becomes a debug module configuration problem?
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 are right. I blanket applied this comment everywhere harnessClock was referenced in the IOBinders, but this case should actually not be using the harnessClock at all.
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.
So it turns out the way we drive the debug module clocks is pretty wrong, debug.clock should not be punched off-chip to be driven.
We should fix the WithSimDebug and WithTiedOffDebug IOBinders in another PR.
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.
Sounds good.
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 think there is probably some confusion between the DMI_DTM signals going off chip (which is only intended as a simulation config) and the JTAG_DTM version which has a pretty clear set of signals that should go off-chip (and is intended to be actually implemented in the real world). Perhaps this confusion is carried through to the IOBinders?
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.
Yeah that is accurate. I think the problem is that we are plumbing through the entire DebugIO
bundle, instead of just DebugIO.systemjtag
or DebugIO.clockeddmi
.
DebugIO.clock
appears to require a clock which is synchronous to the Tilelink buses (https://github.com/chipsalliance/rocket-chip/blob/3176ed81c2bfa1a24622c511a1e4b0777bc9377c/src/main/scala/devices/debug/Debug.scala#L1775-L1780), so it should not be generated offchip. I feel like we should be calling Debug.connectClockAndReset
somewhere within the chip...
@@ -106,8 +106,8 @@ class BoomF1Tests extends FireSimTestSuite("FireSim", "DDR3FRFCFSLLC4MB_FireSimL | |||
class RocketNICF1Tests extends FireSimTestSuite("FireSim", "WithNIC_DDR3FRFCFSLLC4MB_FireSimRocketConfig", "BaseF1Config") | |||
// Multiclock tests | |||
class RocketMulticlockF1Tests extends FireSimTestSuite( | |||
"FireSimMulticlockPOC", | |||
"FireSimQuadRocketMulticlockConfig", | |||
"FireSim", |
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 is going to require changing the ini
s.
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 will do this when I regenerate AGFIs
87bbc63
to
ce81f02
Compare
@davidbiancolin @colinschmidt |
I'm fine with that -- but you should put a failing require or assert in the divided config. |
Yeah. Merging is fine as we have plenty of time before the next release. |
ce81f02
to
e275a45
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.
LGTM
Related issue:
chipsalliance/rocket-chip#1795
Type of change: new feature
Impact: rtl change