SystemVerilog mode

x
 
1
 // Literals 1'b0 1'bx 1'bz 16'hDC78 'hdeadbeef 'b0011xxzz 1234 32'd5678 3.4e6 -128.7 // Macro definition `define BUS_WIDTH = 8; // Module definition module block( input clk, input rst_n, input [`BUS_WIDTH-1:0] data_in, output [`BUS_WIDTH-1:0]
2
            data_out ); always @(posedge clk or negedge rst_n) begin if (~rst_n) begin data_out
3
            <=8 'b0;
4
    end else begin
5
      data_out <= data_in;
6
    end
7
    
8
    if (~rst_n)
9
      data_out <= 8'b0; else data_out <=d ata_in; if (~rst_n) begin data_out <=8 'b0;
10
      end
11
    else
12
      begin
13
        data_out <= data_in;
14
      end
15
16
  end
17
  
18
endmodule
19
20
// Class definition
21
class test;
22
23
  /**
24
   * Sum two integers
25
   */
26
  function int sum(int a, int b);
27
    int result = a + b;
28
    string msg = $sformatf("%d + %d = %d", a, b, result);
29
    $display(msg);
30
    return result;
31
  endfunction
32
  
33
  task delay(int num_cycles);
34
    repeat(num_cycles) #1;
35
  endtask
36
  
37
endclass
38
39

Syntax highlighting and indentation for the Verilog and SystemVerilog languages (IEEE 1800).

Configuration options:

MIME types defined: text/x-verilog and text/x-systemverilog.