Edit code - EDA Playground
Warning! This exercise has been opened in another tab; autosave has been disabled. Close this tab or refresh to reactivate.

 Languages & Libraries

 Tools & Simulators

 Examples

205


19
 
1
//-------------------------------------------------------------------------
2
//                      www.verificationguide.com
3
//-------------------------------------------------------------------------
4
class packet;
5
  rand bit [3:0] addr;
6
  
7
  constraint addr_range { soft addr > 6; }  
8
endclass
9
10
module soft_constr;
11
  initial begin
12
    packet pkt;
13
    pkt = new();
14
    repeat(2) begin
15
      pkt.randomize() with { addr < 6;};
16
      $display("\taddr = %0d",pkt.addr);
17
    end
18
  end
19
endmodule
2
 
1
// Code your design here
2
2411 views and 0 likes     
A short description will be helpful for you to remember your playground's details
 
100:0