mirror of
https://github.com/YosysHQ/yosys
synced 2026-05-22 18:09:41 +00:00
Make out of tree build testing possible
This commit is contained in:
parent
5c6de04467
commit
c0779f488a
37 changed files with 131 additions and 119 deletions
|
|
@ -1,29 +1,29 @@
|
|||
write_file fail.temp << EOF
|
||||
logger -expect error "Missing -script or -command option." 1
|
||||
bugpoint -suffix fail -yosys ../../yosys
|
||||
bugpoint -suffix fail -yosys ${YOSYS}
|
||||
EOF
|
||||
exec -expect-return 0 -- ../../yosys -qq mods.il -s fail.temp
|
||||
exec -expect-return 0 -- ${YOSYS} -qq mods.il -s fail.temp
|
||||
|
||||
write_file fail.temp << EOF
|
||||
logger -expect error "do not crash on this design" 1
|
||||
bugpoint -suffix fail -yosys ../../yosys -command "dump"
|
||||
bugpoint -suffix fail -yosys ${YOSYS} -command "dump"
|
||||
EOF
|
||||
exec -expect-return 0 -- ../../yosys -qq mods.il -s fail.temp
|
||||
exec -expect-return 0 -- ${YOSYS} -qq mods.il -s fail.temp
|
||||
|
||||
write_file fail.temp << EOF
|
||||
logger -expect error "returned value 3 instead of expected 7" 1
|
||||
bugpoint -suffix fail -yosys ../../yosys -command raise_error -expect-return 7
|
||||
bugpoint -suffix fail -yosys ${YOSYS} -command raise_error -expect-return 7
|
||||
EOF
|
||||
exec -expect-return 0 -- ../../yosys -qq mods.il -s fail.temp
|
||||
exec -expect-return 0 -- ${YOSYS} -qq mods.il -s fail.temp
|
||||
|
||||
write_file fail.temp << EOF
|
||||
logger -expect error "not found in the log file!" 1
|
||||
bugpoint -suffix fail -yosys ../../yosys -command raise_error -grep "nope"
|
||||
bugpoint -suffix fail -yosys ${YOSYS} -command raise_error -grep "nope"
|
||||
EOF
|
||||
exec -expect-return 0 -- ../../yosys -qq mods.il -s fail.temp
|
||||
exec -expect-return 0 -- ${YOSYS} -qq mods.il -s fail.temp
|
||||
|
||||
write_file fail.temp << EOF
|
||||
logger -expect error "not found in stderr log!" 1
|
||||
bugpoint -suffix fail -yosys ../../yosys -command raise_error -err-grep "nope"
|
||||
bugpoint -suffix fail -yosys ${YOSYS} -command raise_error -err-grep "nope"
|
||||
EOF
|
||||
exec -expect-return 0 -- ../../yosys -qq mods.il -s fail.temp
|
||||
exec -expect-return 0 -- ${YOSYS} -qq mods.il -s fail.temp
|
||||
|
|
|
|||
|
|
@ -6,35 +6,35 @@ design -stash base
|
|||
|
||||
# everything is removed by default
|
||||
design -load base
|
||||
bugpoint -suffix mods -yosys ../../yosys -command raise_error -expect-return 3
|
||||
bugpoint -suffix mods -yosys ${YOSYS} -command raise_error -expect-return 3
|
||||
select -assert-count 1 w:*
|
||||
select -assert-mod-count 1 =*
|
||||
select -assert-none c:*
|
||||
|
||||
# don't remove wires
|
||||
design -load base
|
||||
bugpoint -suffix mods -yosys ../../yosys -command raise_error -expect-return 3 -modules -cells
|
||||
bugpoint -suffix mods -yosys ${YOSYS} -command raise_error -expect-return 3 -modules -cells
|
||||
select -assert-count 3 w:*
|
||||
select -assert-mod-count 1 =*
|
||||
select -assert-none c:*
|
||||
|
||||
# don't remove cells or their connections
|
||||
design -load base
|
||||
bugpoint -suffix mods -yosys ../../yosys -command raise_error -expect-return 3 -wires -modules
|
||||
bugpoint -suffix mods -yosys ${YOSYS} -command raise_error -expect-return 3 -wires -modules
|
||||
select -assert-count 5 w:*
|
||||
select -assert-mod-count 1 =*
|
||||
select -assert-count 4 c:*
|
||||
|
||||
# don't remove cells but do remove their connections
|
||||
design -load base
|
||||
bugpoint -suffix mods -yosys ../../yosys -command raise_error -expect-return 3 -wires -modules -connections
|
||||
bugpoint -suffix mods -yosys ${YOSYS} -command raise_error -expect-return 3 -wires -modules -connections
|
||||
select -assert-count 1 w:*
|
||||
select -assert-mod-count 1 =*
|
||||
select -assert-count 4 c:*
|
||||
|
||||
# don't remove modules
|
||||
design -load base
|
||||
bugpoint -suffix mods -yosys ../../yosys -command raise_error -expect-return 3 -wires -cells
|
||||
bugpoint -suffix mods -yosys ${YOSYS} -command raise_error -expect-return 3 -wires -cells
|
||||
select -assert-count 1 w:*
|
||||
select -assert-mod-count 3 =*
|
||||
select -assert-none c:*
|
||||
|
|
@ -42,7 +42,7 @@ select -assert-none c:*
|
|||
# can keep wires
|
||||
design -load base
|
||||
setattr -set bugpoint_keep 1 w:w_b
|
||||
bugpoint -suffix mods -yosys ../../yosys -command raise_error -expect-return 3
|
||||
bugpoint -suffix mods -yosys ${YOSYS} -command raise_error -expect-return 3
|
||||
select -assert-count 2 w:*
|
||||
select -assert-mod-count 1 =*
|
||||
select -assert-none c:*
|
||||
|
|
@ -50,7 +50,7 @@ select -assert-none c:*
|
|||
# a wire with keep won't keep the cell/module containing it
|
||||
design -load base
|
||||
setattr -set bugpoint_keep 1 w:w_o
|
||||
bugpoint -suffix mods -yosys ../../yosys -command raise_error -expect-return 3
|
||||
bugpoint -suffix mods -yosys ${YOSYS} -command raise_error -expect-return 3
|
||||
select -assert-count 1 w:*
|
||||
select -assert-mod-count 1 =*
|
||||
select -assert-none c:*
|
||||
|
|
@ -58,7 +58,7 @@ select -assert-none c:*
|
|||
# can keep cells (and do it without the associated module)
|
||||
design -load base
|
||||
setattr -set bugpoint_keep 1 c:c_a
|
||||
bugpoint -suffix mods -yosys ../../yosys -command raise_error -expect-return 3
|
||||
bugpoint -suffix mods -yosys ${YOSYS} -command raise_error -expect-return 3
|
||||
select -assert-count 1 w:*
|
||||
select -assert-mod-count 1 =*
|
||||
select -assert-count 1 c:*
|
||||
|
|
@ -66,7 +66,7 @@ select -assert-count 1 c:*
|
|||
# can keep modules
|
||||
design -load base
|
||||
setattr -mod -set bugpoint_keep 1 m_a
|
||||
bugpoint -suffix mods -yosys ../../yosys -command raise_error -expect-return 3
|
||||
bugpoint -suffix mods -yosys ${YOSYS} -command raise_error -expect-return 3
|
||||
select -assert-count 1 w:*
|
||||
select -assert-mod-count 2 =*
|
||||
select -assert-none c:*
|
||||
|
|
@ -77,7 +77,7 @@ write_file script.temp << EOF
|
|||
select -assert-none w:w_a %co* w:w_c %ci* %i
|
||||
EOF
|
||||
design -load base
|
||||
bugpoint -suffix mods -yosys ../../yosys -script script.temp -grep "Assertion failed"
|
||||
bugpoint -suffix mods -yosys ${YOSYS} -script script.temp -grep "Assertion failed"
|
||||
select -assert-count 5 w:*
|
||||
select -assert-mod-count 2 =*
|
||||
select -assert-count 2 c:*
|
||||
|
|
|
|||
|
|
@ -4,18 +4,18 @@ design -stash err_q
|
|||
|
||||
# processes get removed by default
|
||||
design -load err_q
|
||||
bugpoint -suffix procs -yosys ../../yosys -command raise_error -expect-return 4
|
||||
bugpoint -suffix procs -yosys ${YOSYS} -command raise_error -expect-return 4
|
||||
select -assert-none p:*
|
||||
|
||||
# individual processes can be kept
|
||||
design -load err_q
|
||||
setattr -set bugpoint_keep 1 p:proc_a
|
||||
bugpoint -suffix procs -yosys ../../yosys -command raise_error -expect-return 4
|
||||
bugpoint -suffix procs -yosys ${YOSYS} -command raise_error -expect-return 4
|
||||
select -assert-count 1 p:*
|
||||
|
||||
# all processes can be kept
|
||||
design -load err_q
|
||||
bugpoint -suffix procs -yosys ../../yosys -command raise_error -expect-return 4 -wires
|
||||
bugpoint -suffix procs -yosys ${YOSYS} -command raise_error -expect-return 4 -wires
|
||||
select -assert-count 2 p:*
|
||||
|
||||
# d and clock are connected after proc
|
||||
|
|
@ -26,24 +26,24 @@ select -assert-count 3 w:clock %co
|
|||
|
||||
# no assigns means no d
|
||||
design -load err_q
|
||||
bugpoint -suffix procs -yosys ../../yosys -command raise_error -expect-return 4 -assigns
|
||||
bugpoint -suffix procs -yosys ${YOSYS} -command raise_error -expect-return 4 -assigns
|
||||
proc
|
||||
select -assert-count 1 w:d %co
|
||||
|
||||
# no updates means no clock
|
||||
design -load err_q
|
||||
bugpoint -suffix procs -yosys ../../yosys -command raise_error -expect-return 4 -updates
|
||||
bugpoint -suffix procs -yosys ${YOSYS} -command raise_error -expect-return 4 -updates
|
||||
proc
|
||||
select -assert-count 1 w:clock %co
|
||||
|
||||
# can remove ports
|
||||
design -load err_q
|
||||
select -assert-count 5 x:*
|
||||
bugpoint -suffix procs -yosys ../../yosys -command raise_error -expect-return 4 -ports
|
||||
bugpoint -suffix procs -yosys ${YOSYS} -command raise_error -expect-return 4 -ports
|
||||
select -assert-none x:*
|
||||
|
||||
# can keep ports
|
||||
design -load err_q
|
||||
setattr -set bugpoint_keep 1 i:d o:q
|
||||
bugpoint -suffix procs -yosys ../../yosys -command raise_error -expect-return 4 -ports
|
||||
bugpoint -suffix procs -yosys ${YOSYS} -command raise_error -expect-return 4 -ports
|
||||
select -assert-count 2 x:*
|
||||
|
|
|
|||
|
|
@ -24,21 +24,21 @@ logger -check-expected
|
|||
design -load read
|
||||
setattr -mod -unset raise_error def other
|
||||
dump
|
||||
bugpoint -suffix error -yosys ../../yosys -command raise_error -expect-return 7
|
||||
bugpoint -suffix error -yosys ${YOSYS} -command raise_error -expect-return 7
|
||||
select -assert-mod-count 1 =*
|
||||
select -assert-mod-count 1 top
|
||||
|
||||
# raise_error -always still uses 'raise_error' attribute if possible
|
||||
design -load read
|
||||
setattr -mod -unset raise_error def other
|
||||
bugpoint -suffix error -yosys ../../yosys -command "raise_error -always" -expect-return 7
|
||||
bugpoint -suffix error -yosys ${YOSYS} -command "raise_error -always" -expect-return 7
|
||||
select -assert-mod-count 1 =*
|
||||
select -assert-mod-count 1 top
|
||||
|
||||
# raise_error with string prints message and exits with 1
|
||||
design -load read
|
||||
setattr -mod -unset raise_error top def
|
||||
bugpoint -suffix error -yosys ../../yosys -command raise_error -grep "help me" -expect-return 1
|
||||
bugpoint -suffix error -yosys ${YOSYS} -command raise_error -grep "help me" -expect-return 1
|
||||
select -assert-mod-count 1 =*
|
||||
select -assert-mod-count 1 other
|
||||
|
||||
|
|
@ -46,18 +46,18 @@ select -assert-mod-count 1 other
|
|||
design -load read
|
||||
setattr -mod -unset raise_error top
|
||||
delete other
|
||||
bugpoint -suffix error -yosys ../../yosys -command raise_error -expect-return 1
|
||||
bugpoint -suffix error -yosys ${YOSYS} -command raise_error -expect-return 1
|
||||
select -assert-mod-count 1 =*
|
||||
select -assert-mod-count 1 def
|
||||
|
||||
# raise_error -stderr prints to stderr and exits with 1
|
||||
design -load read
|
||||
setattr -mod -unset raise_error top def
|
||||
bugpoint -suffix error -yosys ../../yosys -command "raise_error -stderr" -err-grep "help me" -expect-return 1
|
||||
bugpoint -suffix error -yosys ${YOSYS} -command "raise_error -stderr" -err-grep "help me" -expect-return 1
|
||||
select -assert-mod-count 1 =*
|
||||
select -assert-mod-count 1 other
|
||||
|
||||
# empty design can raise_error -always
|
||||
design -reset
|
||||
bugpoint -suffix error -yosys ../../yosys -command "raise_error -always" -grep "ERROR: No 'raise_error' attribute found" -expect-return 1
|
||||
bugpoint -suffix error -yosys ../../yosys -command "raise_error -always -stderr" -err-grep "No 'raise_error' attribute found" -expect-return 1
|
||||
bugpoint -suffix error -yosys ${YOSYS} -command "raise_error -always" -grep "ERROR: No 'raise_error' attribute found" -expect-return 1
|
||||
bugpoint -suffix error -yosys ${YOSYS} -command "raise_error -always -stderr" -err-grep "No 'raise_error' attribute found" -expect-return 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue