-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fcf6335
commit 607ae79
Showing
6 changed files
with
155 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import "primitives/core.futil"; | ||
import "primitives/memories/comb.futil"; | ||
component main(@go go: 1, @clk clk: 1, @reset reset: 1) -> (@done done: 1) { | ||
cells { | ||
@external a = comb_mem_d1(32, 1, 1); | ||
lt = std_lt(32); | ||
@control @generated @protected wr_a___main_group_probe = std_wire(1); | ||
@control @generated @protected a___wr_a___main_primitive_probe = std_wire(1); | ||
@control @generated @protected wr_b___main_group_probe = std_wire(1); | ||
@control @generated @protected wr_a___wr_b___main_se_probe = std_wire(1); | ||
} | ||
wires { | ||
group wr_a { | ||
a.addr0 = 1'd0; | ||
a.write_en = 1'd1; | ||
a.write_data = 32'd1; | ||
wr_a[done] = a.done; | ||
wr_a___main_group_probe.in = 1'd1; | ||
a___wr_a___main_primitive_probe.in = 1'd1; | ||
} | ||
group wr_b { | ||
wr_a[go] = lt.out ? 1'd1; | ||
wr_b[done] = wr_a[done]; | ||
wr_b___main_group_probe.in = 1'd1; | ||
wr_a___wr_b___main_se_probe.in = lt.out ? 1'd1; | ||
} | ||
comb group cond { | ||
lt.left = 32'd5; | ||
lt.right = 32'd9; | ||
} | ||
} | ||
control { | ||
wr_b; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// -p profiler-instrumentation | ||
|
||
import "primitives/core.futil"; | ||
import "primitives/memories/comb.futil"; | ||
|
||
|
50 changes: 50 additions & 0 deletions
50
tests/passes/profiler_instrumentation/profiler_instrumentation.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import "primitives/core.futil"; | ||
import "primitives/memories/comb.futil"; | ||
component main(@go go: 1, @clk clk: 1, @reset reset: 1) -> (@done done: 1) { | ||
cells { | ||
@external i = comb_mem_d1(32, 1, 1); | ||
lt = std_lt(32); | ||
lt_reg = std_reg(1); | ||
add = std_add(32); | ||
@control @generated @protected cond___main_group_probe = std_wire(1); | ||
@control @generated @protected lt_reg___cond___main_primitive_probe = std_wire(1); | ||
@control @generated @protected incr___main_group_probe = std_wire(1); | ||
@control @generated @protected i___incr___main_primitive_probe = std_wire(1); | ||
} | ||
wires { | ||
group cond { | ||
i.addr0 = 1'd0; | ||
lt.left = i.read_data; | ||
lt.right = 32'd8; | ||
lt_reg.in = lt.out; | ||
lt_reg.write_en = 1'd1; | ||
cond[done] = lt_reg.done; | ||
cond___main_group_probe.in = 1'd1; | ||
lt_reg___cond___main_primitive_probe.in = 1'd1; | ||
} | ||
group incr<"static"=1> { | ||
add.right = i.read_data; | ||
add.left = 32'd1; | ||
i.write_data = add.out; | ||
i.addr0 = 1'd0; | ||
i.write_en = 1'd1; | ||
incr[done] = i.done; | ||
incr___main_group_probe.in = 1'd1; | ||
i___incr___main_primitive_probe.in = 1'd1; | ||
} | ||
} | ||
control { | ||
seq { | ||
cond; | ||
while lt_reg.out { | ||
seq { | ||
incr; | ||
incr; | ||
cond; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
---STDERR--- | ||
[WARN calyx_frontend::attribute] The attribute @static is deprecated and will be ignored by the compiler. |
2 changes: 1 addition & 1 deletion
2
tests/passes/profiler_instrumentation/profiler_instrumentation.futil
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
tests/passes/profiler_instrumentation/triple-multi-component.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import "primitives/core.futil"; | ||
import "primitives/memories/comb.futil"; | ||
component identity(in: 32, @go go: 1, @clk clk: 1, @reset reset: 1) -> (out: 32, @done done: 1) { | ||
cells { | ||
r = std_reg(32); | ||
@control @generated @protected save___identity_group_probe = std_wire(1); | ||
@control @generated @protected r___save___identity_primitive_probe = std_wire(1); | ||
} | ||
wires { | ||
group save { | ||
r.in = in; | ||
r.write_en = 1'd1; | ||
save[done] = r.done; | ||
save___identity_group_probe.in = 1'd1; | ||
r___save___identity_primitive_probe.in = 1'd1; | ||
} | ||
out = r.out; | ||
} | ||
control { | ||
save; | ||
} | ||
} | ||
component middle(@go go: 1, @clk clk: 1, @reset reset: 1) -> (@done done: 1) { | ||
cells { | ||
id = identity(); | ||
current_value = std_reg(32); | ||
@control @generated @protected run_id___middle_group_probe = std_wire(1); | ||
@control @generated @protected id___run_id___middle_cell_probe = std_wire(1); | ||
@control @generated @protected use_id___middle_group_probe = std_wire(1); | ||
@control @generated @protected current_value___use_id___middle_primitive_probe = std_wire(1); | ||
} | ||
wires { | ||
group run_id { | ||
id.in = 32'd10; | ||
id.go = 1'd1; | ||
run_id[done] = id.done; | ||
run_id___middle_group_probe.in = 1'd1; | ||
id___run_id___middle_cell_probe.in = 1'd1; | ||
} | ||
group use_id { | ||
current_value.in = id.out; | ||
current_value.write_en = 1'd1; | ||
use_id[done] = current_value.done; | ||
use_id___middle_group_probe.in = 1'd1; | ||
current_value___use_id___middle_primitive_probe.in = 1'd1; | ||
} | ||
} | ||
control { | ||
seq { | ||
run_id; | ||
use_id; | ||
} | ||
} | ||
} | ||
component main(@go go: 1, @clk clk: 1, @reset reset: 1) -> (@done done: 1) { | ||
cells { | ||
mid = middle(); | ||
} | ||
wires {} | ||
control { | ||
seq { | ||
invoke mid()(); | ||
} | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
tests/passes/profiler_instrumentation/triple-multi-component.futil
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// -p profiler-instrumentation | ||
|
||
import "primitives/core.futil"; | ||
import "primitives/memories/comb.futil"; | ||
|
||
|