Home > Community > Forums > Logic Design > Passing Defines during read_hdl

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: *

 Passing Defines during read_hdl 

Last post Mon, Apr 16 2007 7:34 AM by archive. 2 replies.
Started by archive 16 Apr 2007 07:34 AM. Topic has 2 replies and 1320 views
Page 1 of 1 (3 items)
Sort Posts:
  • Mon, Apr 16 2007 7:34 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    Passing Defines during read_hdl Reply

    I'm looking to see how to pass defines during the read_hdl RC command.  Below is an example.  I've tried many variations but just can't seem to get it working.

    read_hdl -sv -define {tpd} -top genmemory_mp {../../common/rtl/csco_routines.v   ../rtl/genmemory_mp.v}


    Originally posted in cdnusers.org by bryan
    • Post Points: 0
  • Mon, Apr 16 2007 8:40 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: Passing Defines during read_hdl Reply

    Hi Bryan,

    tried something similar and it worked as expected. I wonder if it is something in the RTL or maybe try without the -top option. I did a man on read_hdl and it seems to indicate that -top is related with structural netlists. Since you have an `ifdef I am assuming it is not structural although not necessarily the case. I usually read_hdl everything and specify the top on the elaborate command but RC seems to do a pretty good job figuring it out by itself anyhow. Here is my short example if you find it useful:


    module define_hdl (
    input wire in, clk,
    output wire out
    );

    reg pipe0;

    `ifdef use_neg_edge
    always @(negedge clk) begin
    pipe0 <= in;
    end // always @ (negedge clk)
    `else
    always @(posedge clk) begin
    pipe0 <= in;
    end // always @ (posedge clk)
    `endif

    assign out = pipe0;

    endmodule // define_hdl

    good luck,
    gh-


    Originally posted in cdnusers.org by grasshopper
    • Post Points: 0
  • Tue, Apr 17 2007 12:23 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: Passing Defines during read_hdl Reply

    Well, I tried the exact same command today and it works. Not sure what was going on but none the less, problem resolved.


    Originally posted in cdnusers.org by bryan
    • Post Points: 0
Page 1 of 1 (3 items)
Sort Posts:
Started by archive at 16 Apr 2007 07:34 AM. Topic has 2 replies.