File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
regression/verilog/replication Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 1
1
CORE broken-smt-backend
2
- main .v
3
- --bound 1
2
+ replication1 .v
3
+ --bound 0
4
4
^EXIT=0$
5
5
^SIGNAL=0$
6
6
--
Original file line number Diff line number Diff line change @@ -13,8 +13,12 @@ module main(in);
13
13
always assert property2:
14
14
{{ 1 { in }}, in } == { in, in };
15
15
16
- // replication of something boolean
16
+ // 0- replication
17
17
always assert property3:
18
+ {{ 0 { in }}, in } == { in };
19
+
20
+ // replication of something boolean
21
+ always assert property4:
18
22
{{ 1 { 1'b0 }}, in } == in;
19
23
20
24
endmodule
Original file line number Diff line number Diff line change @@ -1911,7 +1911,7 @@ exprt verilog_typecheck_exprt::convert_replication_expr(replication_exprt expr)
1911
1911
if (op1.type ().id ()==ID_bool)
1912
1912
op1 = typecast_exprt{op1, unsignedbv_typet{1 }};
1913
1913
1914
- unsigned width= get_width (expr.op1 ().type ());
1914
+ auto width = get_width (expr.op1 ().type ());
1915
1915
1916
1916
mp_integer op0 = convert_integer_constant_expression (expr.op0 ());
1917
1917
@@ -1921,12 +1921,8 @@ exprt verilog_typecheck_exprt::convert_replication_expr(replication_exprt expr)
1921
1921
<< " number of replications must not be negative" ;
1922
1922
}
1923
1923
1924
- if (op0==0 )
1925
- {
1926
- // ruled out by IEEE 1364-2001
1927
- throw errort ().with_location (expr.source_location ())
1928
- << " number of replications must not be zero" ;
1929
- }
1924
+ // IEEE 1800-2017 explicitly allows replication with
1925
+ // count zero.
1930
1926
1931
1927
{
1932
1928
expr.op0 ()=from_integer (op0, natural_typet ());
You can’t perform that action at this time.
0 commit comments