Menu

#928 No support for passing arrays (SystemVerilog)

devel
open
nobody
None
5
2015-03-25
2013-04-18
No

input [7:0] tx_data_buffer [29:0];

Produces:
error: Invalid variable list in port declaration.

Discussion

  • Cary R.

    Cary R. - 2013-04-18
    • summary: 2D array fails as input --> No support for passing arrays (SystemVerilog)
    • Group: v0.9 --> devel
     
  • Cary R.

    Cary R. - 2013-04-18

    Passing arrays is only supported in SystemVerilog and V0.9 does not and never will support this. The development version does not support this as shown either, though it can use a packed array to the same effect (e.g. input [7:0][29:0] tx_data_buffer). Packed arrays are fairly new additions so they may not be 100%, but we try to fix bugs in existing functionality before we add new functionality.

     
  • David Poole

    David Poole - 2015-03-03

    Are there any current plans to support arrays to modules? I'm hitting an assert in evaluate.cc (most current code). I'm working on a collection of existing code that uses arrays heavily.

    Mask_window.v:16: assert: elaborate.cc:6243: failed assertion netnet->pin_count()==1

    Thank you very much for Icarus Verilog. Has made my life much easier!

    /* Small test case to recreate Icarus Verilog assertion failure.
     *
     * davep 02-Mar-2015
     */
    
    module Mask_window
    #(
        parameter WIN_WIDTH = 7,
        parameter WIN_HEIGHT = 7,
        parameter WIN_DWIDTH = 2
    )
    (
        input Clk,
        input nReset,
    
        output reg [WIN_DWIDTH-1:0] win_data [WIN_HEIGHT-1:0][WIN_WIDTH-1:0]
    );
    
        always @(posedge Clk or negedge nReset)
        begin : foo
            integer i,j;
    
            if( !nReset ) begin : bar
                for( i=0 ; i<WIN_HEIGHT ; i=i+1 )
                    for( j=0 ; j<WIN_WIDTH ; j=j+1 )
                        win_data[i][j] <= {WIN_DWIDTH{1'b0}};
            end else
            begin : baz
                /* something silly */
                for( i=0 ; i<WIN_HEIGHT ; i=i+1 )
                    for( j=0 ; j<WIN_WIDTH ; j=j+1 )
                        win_data[i][j] <= i+j;
            end
        end
    endmodule
    
     
  • Vascom

    Vascom - 2015-03-25

    Please add support of multidimensional arrays in iverilog.
    May be via additional parameter to command line.

     
  • Cary R.

    Cary R. - 2015-03-25

    There are plans to add this functionality, but it takes time and we don't always have much of that available since real work often gets in the way of us working on Icarus.

    Multidimensional arrays are supported in the development branch with some limitations regarding how the bounds checking works, etc.

     

Log in to post a comment.