procedural assignment - 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

208


36
 
1
module EX_procedural_assignment2;
2
3
  byte unsigned count, value;
4
5
  initial begin
6
    // At time 2, evaluate RHS and schedule assignment for 1 time slot
7
    // later - LHS changes at time 3
8
    #2 value <= #1  count;
9
  
10
    // 6 time steps later (time 8), evaluate RHS and schedule assignment
11
    // for 3 time slots further on (time 11)
12
    #6 value <= #3  count;
13
  end
14
15
  initial begin
16
    // blocking assignment of RHS at time 5
17
    #5 value  =     count;  
18
  
19
    // at time 6, evaluate the RHS and schedule the assignment for 
20
    // the NBA region 7 time slots later (time 13)
21
    #1 value <= #7  count;
22
  
23
    // at time 10, evaluate the RHS and schedule the assignment for 
24
    // the active region 3 time slots later (time 13)
25
    #4 value  = #3  count; 
26
  
27
    // the NB assignment 'wins' because the NBA region occurs after 
28
    // the active region in the time step.
29
    #10 $stop;
30
  end
31
32
  assign #1 count = count + 1;
33
34
  always @(value) $display("%4t: Value = %0d", $time, value);
35
36
endmodule
xxxxxxxxxx
1
 
1
// Code your design here
2
52 views and 0 likes     
 
Another complete SystemVerilog example for procedural assignment topic.

Another complete SystemVerilog example for procedural assignment topic.

180:0