File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
comp/uvm/packet_generators Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,25 @@ class sequence_flowtest #(int unsigned ITEM_WIDTH) extends uvm_common::sequence_
177
177
ipv4 = ipv4.unique () with (item.address);
178
178
ipv6 = ipv6.unique () with (item.address);
179
179
mac = mac .unique () with (item.address);
180
+
181
+ // Tool doesnt support less address that 2
182
+ while (ipv4.size () < 2 ) begin
183
+ ipv4 = new [ipv4.size ()+ 1 ](ipv4);
184
+ std:: randomize (ipv4[ipv4.size ()- 1 ].address);
185
+ std:: randomize (ipv4[ipv4.size ()- 1 ].mask) with { ipv4[ipv4.size ()- 1 ].mask <= 32 ;} ;
186
+ end
187
+
188
+ while (ipv6.size () < 2 ) begin
189
+ ipv6 = new [ipv6.size ()+ 1 ](ipv6);
190
+ std:: randomize (ipv6[ipv6.size ()- 1 ].address);
191
+ std:: randomize (ipv6[ipv6.size ()- 1 ].mask) with { ipv6[ipv6.size ()- 1 ].mask <= 128 ;} ;
192
+ end
193
+
194
+ while (mac.size () < 2 ) begin
195
+ mac = new [mac.size ()+ 1 ](mac);
196
+ std:: randomize (mac[mac.size ()- 1 ].address);
197
+ std:: randomize (mac[mac.size ()- 1 ].mask) with { mac[mac.size ()- 1 ].mask <= 128 ;} ;
198
+ end
180
199
endfunction
181
200
182
201
function string get_ipv4_addresses ();
You can’t perform that action at this time.
0 commit comments