Skip to content

Commit 23922fa

Browse files
committed
Test new Tcl methods
1 parent cba9460 commit 23922fa

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

tests/various/tcl_apis.tcl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
yosys read_verilog tcl_apis.v
2+
3+
if {[rtlil::get_attr -string -mod top foo] != "bar"} {
4+
error "bad top module attribute"
5+
}
6+
7+
if {[rtlil::get_attr -bool top w dont_touch] != 1} {
8+
error "bad w wire attribute"
9+
}
10+
11+
if {[rtlil::get_param -int top inst PARAM] != 4} {
12+
error "bad parameter"
13+
}
14+
15+
rtlil::set_attr -true -mod top marked
16+
yosys select -assert-any A:marked

tests/various/tcl_apis.v

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module m;
2+
parameter PARAM = 0;
3+
endmodule
4+
5+
(* foo="bar" *)
6+
module top;
7+
(* dont_touch *)
8+
wire w;
9+
10+
m #(.PARAM(4)) inst();
11+
endmodule

tests/various/tcl_apis.ys

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
yosys tcl tcl_apis.tcl

0 commit comments

Comments
 (0)