Test new Tcl methods

This commit is contained in:
Martin Povišer 2024-11-04 16:18:50 +01:00
parent cba9460cba
commit 23922faecc
3 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,16 @@
yosys read_verilog tcl_apis.v
if {[rtlil::get_attr -string -mod top foo] != "bar"} {
error "bad top module attribute"
}
if {[rtlil::get_attr -bool top w dont_touch] != 1} {
error "bad w wire attribute"
}
if {[rtlil::get_param -int top inst PARAM] != 4} {
error "bad parameter"
}
rtlil::set_attr -true -mod top marked
yosys select -assert-any A:marked

11
tests/various/tcl_apis.v Normal file
View File

@ -0,0 +1,11 @@
module m;
parameter PARAM = 0;
endmodule
(* foo="bar" *)
module top;
(* dont_touch *)
wire w;
m #(.PARAM(4)) inst();
endmodule

View File

@ -0,0 +1 @@
yosys tcl tcl_apis.tcl