File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed
Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 1- module main ;
1+ module main (input i);
2+
3+ // 1800 2017 6.20.6
24 const bit my_true2 = 1 ;
35 const var my_true3 = 1 ;
4- const logic my_true4 = 1 ;
6+
7+ // the value on the RHS does _not_ need to be constant
8+ const logic my_true4 = i;
9+
510endmodule
Original file line number Diff line number Diff line change 1+ KNOWNBUG
2+ const2.sv
3+
4+ ^EXIT=10$
5+ ^SIGNAL=0$
6+ --
7+ ^warning: ignoring
8+ --
9+ Should be rejected owing to assignment to const variable.
Original file line number Diff line number Diff line change 1+ module main (input clk, input [31 : 0 ] data);
2+
3+ // The value need not be constant.
4+ const reg [31 : 0 ] data_const = data;
5+
6+ // 1800 2017 6.20.6
7+ always @ (posedge clk)
8+ // But can't assign to it.
9+ data_const = 123 ;
10+
11+ endmodule
You can’t perform that action at this time.
0 commit comments