Forum Discussion

keegandent's avatar
keegandent
Icon for New Contributor rankNew Contributor
2 years ago

Error (10742): Verilog HDL error: constant expression cannot contain a hierarchical identifier

It seems this issue may not have been resolved, at least not in a way that applies to SystemVerilog `interface` objects.

This is a toy example, but I can provide Quartus project upon request. I am using 23.1.1std.

The following code, given a defined interface with a parameter DATA_WIDTH_BYTES...

module foo (
    input logic clk,
    input logic arstn,
    axis.s s_axis,
    axis.m m_axis
);
    localparam DATA_WIDTH = s_axis.DATA_WIDTH_BYTES * 8;
    ...
endmodule

...will produce the following error:

Error (10742): Verilog HDL error at foo.sv(7): constant expression cannot contain a hierarchical identifier

This doesn't seem to violate any SystemVerilog language standards; indeed Verilator and Vivado synthesize the design without complaint.

12 Replies

  • Hi,


    I hope you're doing well. May I know if the issue has been resolved, or if you still require assistance with this case?


    Best regards,

    Richard Tan


    • keegandent's avatar
      keegandent
      Icon for New Contributor rankNew Contributor
      So this issue still exists as far as I can tell, and it renders SystemVerilog interfaces somewhat useless as structures.
  • Could you share a simplified project that could duplicate the error?


    We sincerely apologize for the inconvenience caused by the delay in addressing your Forum queries. Due to an unexpected back-end issue in our system, your Forum case, did not reach us as intended. As a result, we have a backlog of cases that we are currently working through.

    Please be assured that we are doing everything we can to resolve this as quickly as possible. This will take some time, and we appreciate your patience and understanding during this period of time. Your case will be attended by AE soonest possible.

    Thank you again for your patience and understanding, and we are committed to provide you with the best possible support.


    Regards,

    Richard Tan



    • keegandent's avatar
      keegandent
      Icon for New Contributor rankNew Contributor

      That is completely understandable. I do have a major demonstration tomorrow, so I will likely have to use the weekend to create a simple project that demonstrates the issue. It shouldn't take me longer than an hour or so. Thanks for your patience!

    • keegandent's avatar
      keegandent
      Icon for New Contributor rankNew Contributor

      I have attached a Quartus archive of an example project. You should be able to see it creates the error message:

      Error (10742): Verilog HDL error at axis_thrower.sv(6): constant expression cannot contain a hierarchical identifier

      This should not be the case. With both Vivado and Verilator, the expression is allowed because their compilers deduce what is obviously constant at compile-time. Without support for this feature, interfaces are largely useless as their associated metadata has to be passed via separate channels regardless.

  • Unfortunately, modport interfaces are not supported in Quartus Standard. Consequently, any struct (SystemVerilog) used in a port list must have all members defined as either in or out directions.


    Additionally, Quartus Prime Standard Edition has limited support for SystemVerilog.

    Reference: https://www.intel.com/content/www/us/en/programmable/quartushelp/17.0/mapIdTopics/jka1465580578171.htm


    If the same design is compiled in Quartus Pro, it should compile successfully.


    Regards,

    Richard Tan


  • Dropping a note to ask if my last reply was helpful to you.

    Do you need any further assistance from my side?


    Regards,

    Richard Tan


  • We noticed that we haven't received a response from you regarding the latest previous question/reply/answer, and will now transitioning your inquiry to our community support. We apologize for any inconvenience this may cause and we appreciate your understanding.


    If you have any further questions or concerns, please don't hesitate to reach out. Please login to ‘https://supporttickets.intel.com’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support.


    The community users will be able to help you on your follow-up questions.


    Thank you for reaching out to us!


    Best Regards,

    Richard Tan


  • I'm having a similar issue that happens only in quartus 23.

    I'm receiving a parameter to a module as followed : "Parameter = '{x: 'h0, y: 'hfff}"

    and I later use it for a local param like this: "localparam something = Parameter.x"

    The errors I receive is "constant expression cannot contain a hierarchical identifier" and "x is not a constant"

    How can I resolve this in a way that I won't have to go back to older quartus version?