Skip to content

Commit

Permalink
update tests and remove compile-ref pass
Browse files Browse the repository at this point in the history
  • Loading branch information
rachitnigam committed Aug 23, 2023
1 parent 06be720 commit 2272d97
Show file tree
Hide file tree
Showing 16 changed files with 136 additions and 444 deletions.
12 changes: 5 additions & 7 deletions calyx-opt/src/default_passes.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//! Defines the default passes available to [PassManager].
use crate::passes::{
AttributePromotion, Canonicalize, CellShare, ClkInsertion, CollapseControl,
CombProp, CompileEmpty, CompileInvoke, CompileRef, CompileRepeat,
CompileStatic, CompileSync, CompileSyncWithoutSyncReg, ComponentInliner,
DataPathInfer, DeadAssignmentRemoval, DeadCellRemoval, DeadGroupRemoval,
DiscoverExternal, Externalize, GoInsertion, GroupToInvoke, GroupToSeq,
HoleInliner, InferShare, LowerGuards, MergeAssign, Papercut, ParToSeq,
CombProp, CompileEmpty, CompileInvoke, CompileRepeat, CompileStatic,
CompileSync, CompileSyncWithoutSyncReg, ComponentInliner, DataPathInfer,
DeadAssignmentRemoval, DeadCellRemoval, DeadGroupRemoval, DiscoverExternal,
Externalize, GoInsertion, GroupToInvoke, GroupToSeq, HoleInliner,
InferShare, LowerGuards, MergeAssign, Papercut, ParToSeq,
RegisterUnsharing, RemoveIds, ResetInsertion, SimplifyStaticGuards,
SimplifyWithControl, StaticInliner, StaticPromotion, SynthesisPapercut,
TopDownCompileControl, TopDownStaticTiming, UnrollBounded, WellFormed,
Expand Down Expand Up @@ -49,7 +49,6 @@ impl PassManager {
pm.register_pass::<SimplifyWithControl>()?;
pm.register_pass::<TopDownStaticTiming>()?;
pm.register_pass::<TopDownCompileControl>()?;
pm.register_pass::<CompileRef>()?;
pm.register_pass::<CompileSync>()?;
pm.register_pass::<CompileSyncWithoutSyncReg>()?;

Expand Down Expand Up @@ -149,7 +148,6 @@ impl PassManager {
[
"validate",
CompileSync,
CompileRef,
SimplifyWithControl,
CompileInvoke,
"compile",
Expand Down
2 changes: 1 addition & 1 deletion calyx-opt/src/passes/compile_invoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl Visitor for CompileInvoke {
dump_ports::dump_ports_to_signature(
comp,
|cell| cell.borrow().is_reference(),
false,
true,
);

// Hold onto the cells so they don't get dropped.
Expand Down
245 changes: 0 additions & 245 deletions calyx-opt/src/passes/compile_ref.rs

This file was deleted.

2 changes: 0 additions & 2 deletions calyx-opt/src/passes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ mod collapse_control;
mod comb_prop;
mod compile_empty;
mod compile_invoke;
mod compile_ref;
mod compile_repeat;
mod compile_static;
mod component_iniliner;
Expand Down Expand Up @@ -53,7 +52,6 @@ pub use collapse_control::CollapseControl;
pub use comb_prop::CombProp;
pub use compile_empty::CompileEmpty;
pub use compile_invoke::CompileInvoke;
pub use compile_ref::CompileRef;
pub use compile_repeat::CompileRepeat;
pub use compile_static::CompileStatic;
pub use component_iniliner::ComponentInliner;
Expand Down
8 changes: 4 additions & 4 deletions tests/passes/compile-invoke/compile-invoke.expect
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ component main(@go go: 1, @clk clk: 1, @reset reset: 1) -> (@done done: 1) {
}
wires {
group invoke0<"static"=4> {
exp0.base = r.out;
exp0.exp = 4'd3;
exp0.go = 1'd1;
invoke0[done] = exp0.done;
exp0.base = r.out;
exp0.exp = 4'd3;
}
group invoke1<"static"=4> {
exp0.base = w.out;
exp0.exp = 4'd3;
exp0.go = 1'd1;
invoke1[done] = exp0.done;
exp0.base = w.out;
exp0.exp = 4'd3;
w.in = 32'd10;
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/passes/compile-invoke/compile-static-invoke.expect
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ component main(@go go: 1, @clk clk: 1, @reset reset: 1) -> (@done done: 1) {
}
wires {
static<4> group static_invoke {
exp0.go = 1'd1;
exp0.base = r.out;
exp0.exp = 4'd3;
exp0.go = 1'd1;
}
}
control {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,39 @@ component main(@go go: 1, @clk clk: 1, @reset reset: 1) -> (@done done: 1) {
i = incr();
value = std_reg(32);
}
wires {}
wires {
group invoke0 {
value.in = i.value_in;
value.write_en = i.value_write_en;
i.value_out = value.out;
i.value_done = value.done;
i.go = 1'd1;
invoke0[done] = i.done;
}
}
control {
seq {
invoke i(
value_out = value.out,
value_done = value.done
)(
value_in = value.in,
value_write_en = value.write_en
);
invoke0;
}
}
}
component incr(@go go: 1, @clk clk: 1, @reset reset: 1, value_out: 32, value_done: 1) -> (@done done: 1, value_in: 32, value_write_en: 1) {
cells {
ih = incr_helper();
}
wires {}
wires {
group invoke0 {
value_in = ih.value_in;
value_write_en = ih.value_write_en;
ih.value_out = value_out;
ih.value_done = value_done;
ih.go = 1'd1;
invoke0[done] = ih.done;
}
}
control {
seq {
invoke ih(
value_out = value_out,
value_done = value_done
)(
value_in = value_in,
value_write_en = value_write_en
);
invoke0;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// -p validate -p compile-ref
// -p validate -p compile-invoke
import "primitives/compile.futil";

component main() -> () {
cells {
i = incr();
Expand Down
Loading

0 comments on commit 2272d97

Please sign in to comment.