Skip to content
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

[Handshake] Add StaticLogic Dialect and Pipeline Operation #62

Merged
merged 11 commits into from Aug 4, 2020

Conversation

hanchenye
Copy link
Member

This patch introduces an experimental StaticLogic dialect for representing statically scheduled modules (e.g. a pipeline). For now, a pipeline operation and a simple lowering pass, which can convert sequential codes in each block into a pipeline operation, are designed in the StaticLogic dialect.

include/circt/Dialect/StaticLogic/StaticLogic.td Outdated Show resolved Hide resolved
include/circt/Dialect/StaticLogic/StaticLogic.h Outdated Show resolved Hide resolved
let cppNamespace = "";
}

def PipelineOp : Op<StaticLogic_Dialect, "pipeline", [FunctionLike, Symbol,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why FunctionLike? I was thinking that this was just a region inside the op.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. My thinking was all kinds of statically scheduled operations should be separate modules. But actually this isolation is not necessary to happen until further lowering these operations down to FIRRTL or etc. Before that, the pipeline operation is just kind of annotation and keeping things simple will make it easier to modify the pipeline structure.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even when lowering to FIRRTL, making them separate modules seems to be optional as well.

Comment on lines 146 to 149
/// This function converts all live-ins of a block into its arguments, and
/// converts all live-outs of a block into its return values. In this way, the
/// sequencial code inside of each block can be isolated and converted to a
/// function call.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems similar to the live variables analysis in StandardToHandshake. Perhaps this should get factored out rather than duplicating it again? Hmm... is this even required or can we just leave the flow between pipeline stages implicit as long as the blocks are a linear chain?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we can definitely factor this out as kind of canonicalization.

Since we will not isolate the pipeline operation as a function-like region, this analysis is no more necessary. We can just leave them implicit and all these stuff will happen automatically in the standard-to-handshake pass.

@hanchenye
Copy link
Member Author

For accommodating the standard-to-handshake lowering, the pipeline region is still isolated from above in this new version. If this is the case, I feel whether the pipeline operation is function-like or not doesn't have distinct differences.

Live-in/out analysis is removed, thus some flows between pipeline operations become implicit, and will not be handled until the standard-to-handshake lowering.

@stephenneuendorffer stephenneuendorffer merged commit 9ab7d66 into llvm:master Aug 4, 2020
@hanchenye hanchenye deleted the pipeline-operation branch August 5, 2020 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants