-
Notifications
You must be signed in to change notification settings - Fork 296
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
[Arc] Improve LowerState to never produce read-after-write conflicts #7703
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,11 +21,17 @@ using namespace mlir; | |
#define GET_TYPEDEF_CLASSES | ||
#include "circt/Dialect/Arc/ArcTypes.cpp.inc" | ||
|
||
unsigned StateType::getBitWidth() { return hw::getBitWidth(getType()); } | ||
unsigned StateType::getBitWidth() { | ||
if (llvm::isa<seq::ClockType>(getType())) | ||
return 1; | ||
return hw::getBitWidth(getType()); | ||
} | ||
|
||
LogicalResult | ||
StateType::verify(llvm::function_ref<InFlightDiagnostic()> emitError, | ||
Type innerType) { | ||
if (llvm::isa<seq::ClockType>(innerType)) | ||
return success(); | ||
Comment on lines
+33
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unnecessary since it is now handled in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah right, you're calling There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because that is not available at this point 😢 (it takes the type from the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let me fix that post-merge. |
||
if (hw::getBitWidth(innerType) < 0) | ||
return emitError() << "state type must have a known bit width; got " | ||
<< innerType; | ||
|
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.
Is this change required to run initialization?
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. In its current form, a call to the
initial
function only executesseq.initial
blocks and initializes the storage for states. It does not propagate those changes to outputs and side-effecting ops though. I wasn't sure if theinitial
function should also calleval
once after initialization (potentially triggering first state updates and other things to run immediately), or if the user might want more fine grained control over when the first eval happens. WDYT?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 I see that makes sense. I agree that we want to avoid implicitly calling
eval
frominitial