From 427babc6fb7761c0d735daa15c784738a6e8a481 Mon Sep 17 00:00:00 2001 From: Nathaniel Navarro Date: Thu, 6 Jun 2024 15:02:46 -0400 Subject: [PATCH] Generalize where `wire_inliner` looks for `go` and `done` ports. (#2114) * Generalize wire inliner to look for ports with a given attributes as opposed to hardcoded and signals * formatting wire_inliner generalization * trigger CI --- calyx-opt/src/passes/wire_inliner.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/calyx-opt/src/passes/wire_inliner.rs b/calyx-opt/src/passes/wire_inliner.rs index c730ccf944..b6ca13d683 100644 --- a/calyx-opt/src/passes/wire_inliner.rs +++ b/calyx-opt/src/passes/wire_inliner.rs @@ -63,13 +63,21 @@ impl Visitor for WireInliner { let this = Rc::clone(&comp.signature); let mut builder = ir::Builder::new(comp, sigs); let group = &data.group; + let this_go_port = this + .borrow() + .find_unique_with_attr(ir::NumAttr::Go)? + .unwrap(); + let this_done_port = this + .borrow() + .find_unique_with_attr(ir::NumAttr::Done)? + .unwrap(); structure!(builder; let one = constant(1, 1); ); - let group_done = guard!(group["done"]); + let group_done = guard!(group[this_done_port.borrow().name]); let assigns = build_assignments!(builder; - group["go"] = ? this["go"]; + group["go"] = ? this[this_go_port.borrow().name]; this["done"] = group_done ? one["out"]; ); comp.continuous_assignments.extend(assigns);