Skip to content

Commit 5f5ea8f

Browse files
[Arc] Allow top-level logic in LowerState; detect clock edges (#6142)
Make the `LowerState` pass allow operations to remain in the top-level `arc.model` op after state lowering. This is necessary for lowering the model op into an `eval` function in the future. Make use of this new flexibility by inserting logic into the model that detects edges on the clocks of the `arc.clock_tree` ops. The clock trees no longer trigger on the clock itself, but are given an "enable" signal that indicates whether a clock edge has been observed. In the future, we'll want to schedule the ops in the `arc.model` and lower it to a separate `eval` function, instead of throwing it away. In doing so the user will no longer have to manually call clock functions, but can call a singular `eval` function instead. A centralized function that performs model execution will also allow us to properly simulate clock edges occurring at the same time -- something which is impossible today. Together with the `arc.clock_domain` op, this `eval` function will make the entire clock detection and grouping a performance optimization instead of a required transformation. Theoretically, even if we did not separate state with the same clock into dedicated clock functions, we'll still be able to generate an `eval` function, with all logic inlined. This will ultimately make the Arc dialect more robust and the transforms more composable.
1 parent d87474f commit 5f5ea8f

File tree

4 files changed

+249
-204
lines changed

4 files changed

+249
-204
lines changed

include/circt/Dialect/Arc/ArcPasses.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def LowerState : Pass<"arc-lower-state", "mlir::ModuleOp"> {
158158
let constructor = "circt::arc::createLowerStatePass()";
159159
let dependentDialects = [
160160
"arc::ArcDialect", "mlir::scf::SCFDialect", "mlir::func::FuncDialect",
161-
"mlir::LLVM::LLVMDialect"
161+
"mlir::LLVM::LLVMDialect", "comb::CombDialect"
162162
];
163163
}
164164

0 commit comments

Comments
 (0)