• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Digital Implementation
  3. "generate statements" in RTLCompilation

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 91
  • Views 518
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

"generate statements" in RTLCompilation

Kamal Kundu
Kamal Kundu over 15 years ago

Hello,

 I have used generate statements exhaustively in RTL which were easily understood by DC. But I am wondering how can we utilize same verilog code (with generate statements) in RTL Compiler.

The code example is as below :

=============================

  generate if (xyz == 1'b1) begin :

  module M( .A(A), .B(B))      ;
   end


   endgenerate

==============================

All ideas/suggestions/solutions are welcome!

Thanks

  • Cancel
  • grasshopper
    grasshopper over 15 years ago

     Hi Kamal,

    you must have a typo being that you used generate statements exhaustively. The code provided is not compliant with LRM hence it will likely not compile in RTL Compiler or most other self-respecting synthesis tools.Can you clarify what your module declaration is trying to do? It does not even have a proper port declaration (BTW, port declarations are ilegal in generate blocks)

    Following is a simple example you can try that illustrates what I think you are trying to do. Just read with read_hdl -v2001 or read_hdl -sv, elab, and synthesize and should produce expected results

    module top (
                  input wire clk, in,
           output wire out
                  );
       parameter xyz = 1'b1;

       generate
           if (xyz == 1'b1) begin
              dummy d1 (.in(in), .clk(clk), .out(out) );
           end
           else begin
              assign out = in && clk;
           end
       endgenerate

    endmodule // top

    module dummy (
                    input wire clk, in,
             output reg out
             );

    always @(posedge clk) begin
           out <= in;
    end

    endmodule
                   
    drop an email if you still have questions

    regards,

    gh-

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information