11read -vhdl bounds.vhd
2- verific -import work
3- select -assert-count 1 a:bottom_bound=5'bs11011
4- select -assert-count 1 a:top_bound=5'bs01010
5- select -assert-count 1 a:bottom_bound=5'bs11010
6- select -assert-count 1 a:top_bound=5'bs01011
2+ hierarchy -top test
3+
4+ # bit: not a scalar type
5+ select -assert-count 0 w:bit_in a:bottom_bound %i
6+ select -assert-count 0 w:bit_in a:top_bound %i
7+ select -assert-count 0 w:bit_out a:bottom_bound %i
8+ select -assert-count 0 w:bit_out a:top_bound %i
9+
10+ # bit_vector: not a scalar type
11+ select -assert-count 0 w:bit_vector_in a:bottom_bound %i
12+ select -assert-count 0 w:bit_vector_in a:top_bound %i
13+ select -assert-count 0 w:bit_vector_out a:bottom_bound %i
14+ select -assert-count 0 w:bit_vector_out a:top_bound %i
15+
16+ # bit_vector with to index: not a scalar type
17+ select -assert-count 0 w:bit_vector_in_to a:bottom_bound %i
18+ select -assert-count 0 w:bit_vector_in_to a:top_bound %i
19+ select -assert-count 0 w:bit_vector_out_to a:bottom_bound %i
20+ select -assert-count 0 w:bit_vector_out_to a:top_bound %i
21+
22+ # std_ulogic: not a scalar type
23+ select -assert-count 0 w:std_ulogic_in a:bottom_bound %i
24+ select -assert-count 0 w:std_ulogic_in a:top_bound %i
25+ select -assert-count 0 w:std_ulogic_out a:bottom_bound %i
26+ select -assert-count 0 w:std_ulogic_out a:top_bound %i
27+
28+ # std_ulogic_vector: not a scalar type
29+ select -assert-count 0 w:std_ulogic_vector_in a:bottom_bound %i
30+ select -assert-count 0 w:std_ulogic_vector_in a:top_bound %i
31+ select -assert-count 0 w:std_ulogic_vector_out a:bottom_bound %i
32+ select -assert-count 0 w:std_ulogic_vector_out a:top_bound %i
33+
34+ # std_ulogic_vector with to index: not a scalar type
35+ select -assert-count 0 w:std_ulogic_vector_in_to a:bottom_bound %i
36+ select -assert-count 0 w:std_ulogic_vector_in_to a:top_bound %i
37+ select -assert-count 0 w:std_ulogic_vector_out_to a:bottom_bound %i
38+ select -assert-count 0 w:std_ulogic_vector_out_to a:top_bound %i
39+
40+ # std_logic: not a scalar type
41+ select -assert-count 0 w:std_logic_in a:bottom_bound %i
42+ select -assert-count 0 w:std_logic_in a:top_bound %i
43+ select -assert-count 0 w:std_logic_out a:bottom_bound %i
44+ select -assert-count 0 w:std_logic_out a:top_bound %i
45+
46+ # std_logic_vector: not a scalar type
47+ select -assert-count 0 w:std_logic_vector_in a:bottom_bound %i
48+ select -assert-count 0 w:std_logic_vector_in a:top_bound %i
49+ select -assert-count 0 w:std_logic_vector_out a:bottom_bound %i
50+ select -assert-count 0 w:std_logic_vector_out a:top_bound %i
51+
52+ # std_logic_vector with to index: not a scalar type
53+ select -assert-count 0 w:std_logic_vector_in_to a:bottom_bound %i
54+ select -assert-count 0 w:std_logic_vector_in_to a:top_bound %i
55+ select -assert-count 0 w:std_logic_vector_out_to a:bottom_bound %i
56+ select -assert-count 0 w:std_logic_vector_out_to a:top_bound %i
57+
58+ # signed: not a scalar type
59+ select -assert-count 0 w:signed_in a:bottom_bound %i
60+ select -assert-count 0 w:signed_in a:top_bound %i
61+ select -assert-count 0 w:signed_out a:bottom_bound %i
62+ select -assert-count 0 w:signed_out a:top_bound %i
63+
64+ # signed with to index: not a scalar type
65+ select -assert-count 0 w:signed_in_to a:bottom_bound %i
66+ select -assert-count 0 w:signed_in_to a:top_bound %i
67+ select -assert-count 0 w:signed_out_to a:bottom_bound %i
68+ select -assert-count 0 w:signed_out_to a:top_bound %i
69+
70+ # unsigned: not a scalar type
71+ select -assert-count 0 w:unsigned_in a:bottom_bound %i
72+ select -assert-count 0 w:unsigned_in a:top_bound %i
73+ select -assert-count 0 w:unsigned_out a:bottom_bound %i
74+ select -assert-count 0 w:unsigned_out a:top_bound %i
75+
76+ # unsigned with to index: not a scalar type
77+ select -assert-count 0 w:unsigned_in_to a:bottom_bound %i
78+ select -assert-count 0 w:unsigned_in_to a:top_bound %i
79+ select -assert-count 0 w:unsigned_out_to a:bottom_bound %i
80+ select -assert-count 0 w:unsigned_out_to a:top_bound %i
81+
82+ # integer: scalar type
83+ select -assert-count 1 w:integer_in a:bottom_bound=32'b10000000000000000000000000000000 %i
84+ select -assert-count 1 w:integer_in a:top_bound=32'b01111111111111111111111111111111 %i
85+ select -assert-count 1 w:integer_out a:bottom_bound=32'b10000000000000000000000000000000 %i
86+ select -assert-count 1 w:integer_out a:top_bound=32'b01111111111111111111111111111111 %i
87+
88+ # integer with range: scalar type
89+ select -assert-count 1 w:integer_with_range_in a:bottom_bound=5'bs11011 %i
90+ select -assert-count 1 w:integer_with_range_in a:top_bound=5'bs01010 %i
91+ select -assert-count 1 w:integer_with_range_out a:bottom_bound=5'bs11010 %i
92+ select -assert-count 1 w:integer_with_range_out a:top_bound=5'bs01010 %i
93+
94+ # integer with single value range: scalar type
95+ select -assert-count 1 w:integer_single_value_in a:bottom_bound=3'bs101 %i
96+ select -assert-count 1 w:integer_single_value_in a:top_bound=3'bs101 %i
97+ select -assert-count 1 w:integer_single_value_out a:bottom_bound=3'bs101 %i
98+ select -assert-count 1 w:integer_single_value_out a:top_bound=3'bs101 %i
99+
100+ # integer with null range: scalar type
101+ # select -assert-count 1 w:integer_null_range_in a:bottom_bound=4'bs0111 %i
102+ # select -assert-count 1 w:integer_null_range_in a:top_bound=4'bs1111 %i
103+ select -assert-count 1 w:integer_null_range_out a:bottom_bound=2'bs00 %i
104+ select -assert-count 1 w:integer_null_range_out a:top_bound=2'bs11 %i
105+
106+ # natural: scalar type
107+ select -assert-count 1 w:natural_in a:bottom_bound=31'b0000000000000000000000000000000 %i
108+ select -assert-count 1 w:natural_in a:top_bound=31'b1111111111111111111111111111111 %i
109+ select -assert-count 1 w:natural_out a:bottom_bound=31'b0000000000000000000000000000000 %i
110+ select -assert-count 1 w:natural_out a:top_bound=31'b1111111111111111111111111111111 %i
111+
112+ # positive: scalar type
113+ select -assert-count 1 w:positive_in a:bottom_bound=31'b0000000000000000000000000000001 %i
114+ select -assert-count 1 w:positive_in a:top_bound=31'b1111111111111111111111111111111 %i
115+ select -assert-count 1 w:positive_out a:bottom_bound=31'b0000000000000000000000000000001 %i
116+ select -assert-count 1 w:positive_out a:top_bound=31'b1111111111111111111111111111111 %i
117+
118+
119+ # integer size changed in VHDL 2019
120+ design -reset
121+ read -vhdl2019 bounds.vhd
122+ hierarchy -top test
123+
124+ # integer: scalar type
125+ select -assert-count 1 w:integer_in a:bottom_bound=64'b1000000000000000000000000000000000000000000000000000000000000000 %i
126+ select -assert-count 1 w:integer_in a:top_bound=64'b0111111111111111111111111111111111111111111111111111111111111111 %i
127+ select -assert-count 1 w:integer_out a:bottom_bound=64'b1000000000000000000000000000000000000000000000000000000000000000 %i
128+ select -assert-count 1 w:integer_out a:top_bound=64'b0111111111111111111111111111111111111111111111111111111111111111 %i
129+
130+ # natural: scalar type
131+ select -assert-count 1 w:natural_in a:bottom_bound=63'b000000000000000000000000000000000000000000000000000000000000000 %i
132+ select -assert-count 1 w:natural_in a:top_bound=63'b111111111111111111111111111111111111111111111111111111111111111 %i
133+ select -assert-count 1 w:natural_out a:bottom_bound=63'b000000000000000000000000000000000000000000000000000000000000000 %i
134+ select -assert-count 1 w:natural_out a:top_bound=63'b111111111111111111111111111111111111111111111111111111111111111 %i
135+
136+ # positive: scalar type
137+ select -assert-count 1 w:positive_in a:bottom_bound=63'b000000000000000000000000000000000000000000000000000000000000001 %i
138+ select -assert-count 1 w:positive_in a:top_bound=63'b111111111111111111111111111111111111111111111111111111111111111 %i
139+ select -assert-count 1 w:positive_out a:bottom_bound=63'b000000000000000000000000000000000000000000000000000000000000001 %i
140+ select -assert-count 1 w:positive_out a:top_bound=63'b111111111111111111111111111111111111111111111111111111111111111 %i
141+
142+ design -reset
143+ read -sv bounds.sv
144+ hierarchy -top test
145+
146+ select -assert-count none a:bottom_bound
147+ select -assert-count none a:top_bound
0 commit comments