aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2020-05-25 09:14:00 -0700
committerGitHub <noreply@github.com>2020-05-25 09:14:00 -0700
commit59b355fb85cb7cda4a25696850bb3caffce3115f (patch)
tree29bb187608d8810118d959d3aed162aa24778b41 /tests
parentae11156c90eec958cd9ab631a28c41eccc105e56 (diff)
parentc5a9abba11a2e69a5e9944c179f7dba3d24f417a (diff)
downloadyosys-59b355fb85cb7cda4a25696850bb3caffce3115f.tar.gz
yosys-59b355fb85cb7cda4a25696850bb3caffce3115f.tar.bz2
yosys-59b355fb85cb7cda4a25696850bb3caffce3115f.zip
Merge pull request #2044 from YosysHQ/eddie/fix2037
verilog: allow attributes on behavioural statements (including null statement)
Diffstat (limited to 'tests')
-rw-r--r--tests/verilog/bug2037.ys58
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/verilog/bug2037.ys b/tests/verilog/bug2037.ys
new file mode 100644
index 000000000..4b629ba92
--- /dev/null
+++ b/tests/verilog/bug2037.ys
@@ -0,0 +1,58 @@
+logger -expect-no-warnings
+read_verilog <<EOT
+module test ();
+ localparam y = 1;
+ always @(*)
+ if (y) (* foo *) ;
+endmodule
+EOT
+select -assert-none a:* a:src %d
+
+
+design -reset
+logger -expect-no-warnings
+read_verilog <<EOT
+module test ();
+ localparam y = 1;
+ always @(*)
+ if (y) (* foo *) ; else (* bar *) ;
+endmodule
+EOT
+select -assert-none a:* a:src %d
+
+
+design -reset
+logger -expect-no-warnings
+read_verilog <<EOT
+module test ();
+ localparam y = 1;
+ generate if (y) (* foo *) ; endgenerate
+endmodule
+EOT
+select -assert-none a:*
+
+
+design -reset
+logger -expect-no-warnings
+read_verilog <<EOT
+module test ();
+ localparam y = 1;
+ generate if (y) (* foo *) ; else (* bar *); endgenerate
+endmodule
+EOT
+select -assert-none a:*
+
+
+design -reset
+read_verilog <<EOT
+module test ();
+ localparam y = 1;
+ reg x = 1'b0;
+ always @(*) begin
+ if (y)
+ (* foo *) x <= 1'b1;
+ else
+ (* bar *) x = 1'b0;
+ end
+endmodule
+EOT