Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  Voneline
  WFH
General Info
  Papers

Issue #1278

Unsupported LHS tristate construct: ARRAYSEL

Added by Rob Stoddard over 1 year ago. Updated over 1 year ago.

Status:
Confirmed
Priority:
Normal
Assignee:
-
Category:
Unsupported
% Done:

0%


Description

I am wondering what this actually means, I was under the impression that this is legal SystemVerilog. I am trying to instantiate the IO padring for my GPIOs using a parameter.

The error I get when I do this is:

%Error: <path><line>: Unsupported LHS tristate construct: ARRAYSEL

module GPIO_iop
#(
        parameter NumGPIOs = 4
)       (
        inout     p_gpio[NumGPIOs],
        input     do_gpio[NumGPIOs],
        output    di_gpio[NumGPIOs],
        input     do_gpio_hiz[NumGPIOs]
);

genvar i;
generate for(i = 0; i < NumGPIOs; i = i+1) begin: Gen_gpio_0

            IOBUF gpio ( .T(do_gpio_hiz[i]), .I(do_gpio[i]), .O(di_gpio[i]), .IO(p_gpio[i]));
        end
    endgenerate
endmodule

I also tried doing something like this, but got the exact same error:

module GPIONGeneralPurposeIOs_216_iop
#(
        parameter USERPARAM_NumGPIOs = 4
)       (
        inout     p_gpio[USERPARAM_NumGPIOs],
        input     do_gpio[USERPARAM_NumGPIOs],
        output    di_gpio[USERPARAM_NumGPIOs],
        input     do_gpio_hiz[USERPARAM_NumGPIOs]
);

IOBUF gpio[USERPARAM_NumGPIOs] ( .T(do_gpio_hiz), .I(do_gpio), .O(di_gpio), .IO(p_gpio));

endmodule

Am I doing something wrong, or is this a currently unsupported feature? If it is unsupported, how hard would it be to have it supported?

Thank you for your assistance in this matter.

History

#1 Updated by Wilson Snyder over 1 year ago

Any message with "Unsupported" generally means the language supports something but Verilator does not.

In this case, it's strange you are using unpacked arrays. Use packed arrays, e.g. "input [USEPARAM_NUMGPIOs] p_gpio".

#2 Updated by Rob Stoddard over 1 year ago

What I provided was a trifle example, as you probably know, I am writing software that generates RTL dynamically. Although I don't have an example of one, there is the chance the user will create a parameter-generated set of busses. Supposing the busses are 8 bits each, the user would have something like:

inout [7:0] p_busses [NumBusses];

of course I can do something like this, but it's a little more painful:

inout [8*NumBusses-1:0] p_busses;

I was just hoping to not have to do that.

#3 Updated by Udi Finkelstein over 1 year ago

You can use packed arrays instead:

inout [NumBusses-1:0][7:0]p_busses ;

#4 Updated by Wilson Snyder over 1 year ago

  • Status changed from New to Confirmed

Due to how the code currently works supporting arrays will be painful, so is unlikely to be improved in the short term, unless you are willing to commit a patch.

Using packed arrays in some form is the recommended workaround in the meantime.

Also available in: Atom