Home > Community > Forums > Functional Verification > Verilog generics on vhdl instances

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Verilog generics on vhdl instances 

Last post Tue, Oct 1 2013 9:48 AM by muffi. 3 replies.
Started by fbochud 30 Sep 2013 09:52 AM. Topic has 3 replies and 4115 views
Page 1 of 1 (4 items)
Sort Posts:
  • Mon, Sep 30 2013 9:52 AM

    • fbochud
    • Not Ranked
    • Joined on Tue, Aug 20 2013
    • Posts 2
    • Points 40
    Verilog generics on vhdl instances Reply

     Hi,

    I'm trying to use verilog generic on my vhdl instance via the defparam option of ncelab and I get the following message:

    "Attempted propagation of defparam results to a non-Verilog instance"

    The generic in my dut instance are not set and use the default value. Is that not supported?

     

    Example: 

    module tb_top;

       parameter G_DATA_WIDTH = 8;

       wire [G_DATA_WIDTH-1:0] data_in;

       wire [G_DATA_WIDTH-1:0] data_out;

      [...]

       /* DUT */
       top #(.G_DATA_WIDTH (G_DATA_WIDTH))
       my_dut (
            .clk                 (clk),
            .data_in         (data_in),
            .data_out       (data_out),
         );

    endmodule

     Thank you for the help

    Florian

    • Post Points: 20
  • Tue, Oct 1 2013 1:09 AM

    • muffi
    • Top 500 Contributor
    • Joined on Tue, Aug 4 2009
    • Bangalore, Karnataka
    • Posts 21
    • Points 300
    Re: Verilog generics on vhdl instances Reply

    NC as a tool does not allow you to propagate the new value across the language boundary. The default initial value of the parameter is taken as its value.

    The defparam statement tries to re-propagate the value of G_DATA_WIDTH in the VHDL instance and this warning suggests that the tool is not able to do so and retains the value of G_DATA_WIDTH to be 8 only.

    A VHDL generic is an elaboration time constant and we do not have a way to re-evaluate it based on a new defparam statement.

    To work around this, you can use the "-gpg" flag or a combination of “-defparam/-generic” options .

    % irun -mess ...... -generic "tb_top.my_dut.G_DATA_WIDTH => 16"

    Or

    % irun -mess ...... -gpg "tb_top.my_dut:G_DATA_WIDTH => 16"

    • Post Points: 20
  • Tue, Oct 1 2013 2:14 AM

    • fbochud
    • Not Ranked
    • Joined on Tue, Aug 20 2013
    • Posts 2
    • Points 40
    Re: Verilog generics on vhdl instances Reply

    Thank you Muffi, it helps!

    But, that sounds like a missing feature for me, is there plans to support that later? Synopsys VCS and modelsim support that for instance. If one wants to migrate from one of these tools to cadence, this would give quite a lot of work to get the elaboration up and running. 

    Florian

    • Post Points: 20
  • Tue, Oct 1 2013 9:48 AM

    • muffi
    • Top 500 Contributor
    • Joined on Tue, Aug 4 2009
    • Bangalore, Karnataka
    • Posts 21
    • Points 300
    Re: Verilog generics on vhdl instances Reply

    Florian,

    Defparam is going to be a deprecated feature from the new Verilog LRM perspective. See section C.4.1 - Defparam statements.

    From a re-usability of code perspective, defparams are not the ideal solution and should be avoided.

    So using the "-gpg" or a combination of "-defparam/-generic" options should be a clean solution to avoid this warning

    -Muffi

    • Post Points: 5
Page 1 of 1 (4 items)
Sort Posts:
Started by fbochud at 30 Sep 2013 09:52 AM. Topic has 3 replies.