3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-23 14:23:41 +00:00

Add raise_error pass

Raise errors from attributes for testing.
I want it for bugpoint tests but it could be useful elsewhere.
This commit is contained in:
Krystine Sherwin 2025-05-13 15:14:33 +12:00
parent 50da04a75e
commit 107b768cdd
No known key found for this signature in database
5 changed files with 92 additions and 0 deletions

2
tests/bugpoint/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*.il
*.log

27
tests/bugpoint/err.ys Normal file
View file

@ -0,0 +1,27 @@
read_verilog -noblackbox << EOF
(* raise_error=7 *)
module top();
endmodule
(* raise_error="help me" *)
module other();
endmodule
module zzy();
endmodule
EOF
select -assert-mod-count 3 =*
design -stash read
# raise_error with int exits with status
design -load read
bugpoint -yosys ../../yosys -command raise_error -expect-return 7
select -assert-mod-count 1 =*
select -assert-mod-count 1 top
# raise_error with string prints message
design -load read
rename top abc
bugpoint -yosys ../../yosys -command raise_error -grep "help me"
select -assert-mod-count 1 =*
select -assert-mod-count 1 other