mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 00:55:32 +00:00
Merge pull request #2045 from YosysHQ/eddie/fix2042
verilog: error if no direction given for task arguments, default to input in SV mode
This commit is contained in:
commit
5bcde7ccc3
6 changed files with 107 additions and 1 deletions
3
tests/verilog/.gitignore
vendored
Normal file
3
tests/verilog/.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
/*.log
|
||||
/*.out
|
||||
/run-test.mk
|
59
tests/verilog/bug2042-sv.ys
Normal file
59
tests/verilog/bug2042-sv.ys
Normal file
|
@ -0,0 +1,59 @@
|
|||
read_verilog -sv <<EOT
|
||||
module Task_Test_Top
|
||||
(
|
||||
input a,
|
||||
output b
|
||||
);
|
||||
|
||||
task SomeTaskName(a);
|
||||
b = ~a;
|
||||
endtask
|
||||
|
||||
always @*
|
||||
SomeTaskName(a);
|
||||
|
||||
assert property (b == ~a);
|
||||
|
||||
endmodule
|
||||
EOT
|
||||
proc
|
||||
sat -verify -prove-asserts
|
||||
|
||||
|
||||
design -reset
|
||||
read_verilog -sv <<EOT
|
||||
module Task_Test_Top
|
||||
(
|
||||
input a,
|
||||
output b, c
|
||||
);
|
||||
|
||||
task SomeTaskName(x, output y, z);
|
||||
y = ~x;
|
||||
z = x;
|
||||
endtask
|
||||
|
||||
always @*
|
||||
SomeTaskName(a, b, c);
|
||||
|
||||
assert property (b == ~a);
|
||||
assert property (c == a);
|
||||
|
||||
endmodule
|
||||
EOT
|
||||
proc
|
||||
sat -verify -prove-asserts
|
||||
|
||||
|
||||
design -reset
|
||||
logger -expect error "syntax error, unexpected TOK_ENDTASK, expecting ';'" 1
|
||||
read_verilog -sv <<EOT
|
||||
module Task_Test_Top
|
||||
(
|
||||
);
|
||||
|
||||
task SomeTaskName(a)
|
||||
endtask
|
||||
|
||||
endmodule
|
||||
EOT
|
11
tests/verilog/bug2042.ys
Normal file
11
tests/verilog/bug2042.ys
Normal file
|
@ -0,0 +1,11 @@
|
|||
logger -expect error "task/function argument direction missing" 1
|
||||
read_verilog <<EOT
|
||||
module Task_Test_Top
|
||||
(
|
||||
);
|
||||
|
||||
task SomeTaskName(a)
|
||||
endtask
|
||||
|
||||
endmodule
|
||||
EOT
|
20
tests/verilog/run-test.sh
Executable file
20
tests/verilog/run-test.sh
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
{
|
||||
echo "all::"
|
||||
for x in *.ys; do
|
||||
echo "all:: run-$x"
|
||||
echo "run-$x:"
|
||||
echo " @echo 'Running $x..'"
|
||||
echo " @../../yosys -ql ${x%.ys}.log $x"
|
||||
done
|
||||
for s in *.sh; do
|
||||
if [ "$s" != "run-test.sh" ]; then
|
||||
echo "all:: run-$s"
|
||||
echo "run-$s:"
|
||||
echo " @echo 'Running $s..'"
|
||||
echo " @bash $s"
|
||||
fi
|
||||
done
|
||||
} > run-test.mk
|
||||
exec ${MAKE:-make} -f run-test.mk
|
Loading…
Add table
Add a link
Reference in a new issue