-
Notifications
You must be signed in to change notification settings - Fork 298
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
[Pipeline] add 'go' signal to pipeline #5455
Conversation
3c46836
to
34d0a28
Compare
CI failing due to lack of clock gate lowering which doesn't lower to an external module. |
e735b54
to
5e4035b
Compare
Reverted back to a |
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.
Looks sane.
If I'm way off base about stall
interactions, feel free to merge.
auto reg = builder.create<seq::CompRegOp>( | ||
stageTerminator->getLoc(), regIn.getType(), regIn, clock, regName, | ||
reset, Value(), StringAttr()); | ||
auto reg = builder.create<seq::CompRegClockEnabledOp>( |
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.
We probably don't want the CE on FPGAs. Unless it's being used to respond to backpressure (which I don't think it is), it is just a power optimization for ASICs. On FPGAs, it just adds fan-out and routing congestion.
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.
Good point. I'll change this to an input mux, and add the clock gating as a flag.
// Build valid register. The valid register is always reset to 0. | ||
auto validRegName = | ||
builder.getStringAttr(stageRegPrefix.strref() + "_valid"); | ||
rets.valid = builder.create<seq::CompRegOp>( |
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.
How does this interact with stall
? It has to just stay in place, right?
This looks fine for non-stalled pipelines.
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.
@@ -262,34 +323,23 @@ LogicalResult ReturnOp::verify() { | |||
// StageOp | |||
//===----------------------------------------------------------------------===// | |||
|
|||
SuccessorOperands StageOp::getSuccessorOperands(unsigned index) { |
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.
Does this have anything to do with adding go
? Doesn't look like it...
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.
Implicitly, it does. StageOp
no longer can comply with the getSuccessorOperands
since it doesn't provide an operand for the s#_valid
block argument to a given block - hence the removal.
This commit adds an explicit 'go' signal to the pipeline abstraction. This signal is used to indicate when the pipeline should start. The signal will propagate through each stage as the stage valid signal. As a result of this, each stage now has a `s#_valid : i1` signal as the last value in its block argument list. This value can be used within each stage for any operations which requires access to the pipeline control circuitry. Given that pipeline stage validity is now explicit within the block arguments of a stage, a `pipeline.stage` operation no longer has an `enable` signal. As a small 'bugfix' here, a `seq.clock_gate` is emitted to gate the pipeline stage separating registers on the pipeline stage valid signal.
eba4791
to
cfeb2e9
Compare
This commit adds an explicit 'go' signal to the pipeline abstraction. This signal is used to indicate when the pipeline should start. The signal will propagate through each stage as the stage valid signal. As a result of this, each stage now has a
s#_valid : i1
signal as the last value in its block argument list. This value can be used within each stage for any operations which requires access to the pipeline control circuitry.Given that pipeline stage validity is now explicit within the block arguments of a stage, a
pipeline.stage
operation no longer has anenable
signal. As a small 'bugfix' here, aseq.clock_gate
is emitted to gate the pipeline stage separating registers on the pipeline stage valid signal.