SystemVerilog for loop - 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

209


39
 
1
module tb;
2
    initial begin
3
      
4
      // This for loop increments i from 0 to 9 and exit
5
      for (int i = 0 ; i < 10; i++) begin 
6
        
7
        // Let's create a condition such that the 
8
        // for loop 
9
        if (i == 7) 
10
          continue;
11
        
12
        $display ("Iteration [%0d]", i);
13
      end
14
    end
15
endmodule
16
17
18
19
20
/*
21
Simulation Log:
22
---------------
23
24
ncsim> run
25
Iteration [0]
26
Iteration [1]
27
Iteration [2]
28
Iteration [3]
29
Iteration [4]
30
Iteration [5]
31
Iteration [6]
32
Iteration [8]
33
Iteration [9]
34
ncsim: *W,RNQUIE: Simulation is complete.
35
ncsim> exit
36
*/
37
38
39
xxxxxxxxxx
1
 
1
// Code your design here
2
1572 views and 0 likes     
A short description will be helpful for you to remember your playground's details
 
100:0