Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replacing parameter with actual values #1498

Closed
veripoolbot opened this issue Sep 3, 2019 · 3 comments
Closed

replacing parameter with actual values #1498

veripoolbot opened this issue Sep 3, 2019 · 3 comments

Comments

@veripoolbot
Copy link
Collaborator


Author Name: Ronen ddd
Original Redmine Issue: 1498 from https://www.veripool.org


is it a way to use the verilog-mode to parse the instance module and use actual signal values and not parameters ?
same way that it replace 'define with actual values

instead of:
.rresp_0 (rresp_0[AXI_RESPW-1:0]), // Templated

use
.rresp_0 (rresp_0[2:0]),

Thanks

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-09-03T17:03:51Z


See https://www.veripool.org/projects/verilog-mode/wiki/Faq#How-do-I-propagate-parameters-to-pin-connections

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Ronen ddd
Original Date: 2019-09-04T09:02:25Z


Wilson Snyder wrote:

See https://www.veripool.org/projects/verilog-mode/wiki/Faq#How-do-I-propagate-parameters-to-pin-connections

Hi Wilson,

I dont want to propogate the parameters to pin,
I want to propogate the parameter's value into the pin:

in the internal module we do have parameters
instead of .a (a_bus[DW-1:0]) ----> .a (a_bus[15:0]

Thx,
Ronen

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-09-04T10:48:12Z


Ah, try this:

module InstMod ( ins, outs );
    parameter WIDTH;
    output [WIDTH-1:0] ins;
endmodule

module test_top;
    parameter TOP_WIDTH = 3;
    /* AUTO_LISP(defun my-param-range ()
                  (concat "[" vh-TOP_WIDTH ":0]"))*/

    /* InstMod AUTO_TEMPLATE(
         .WIDTH(@"vh-TOP_WIDTH"),
         .ins(ins@"(my-param-range)"),
       ) */

    InstMod mod
     #(/*AUTOINSTPARAM*/
       // Parameters
       .WIDTH                            (3))                     // Templated
     (/*AUTOINST*/
      // Outputs
      .ins                               (ins[3:0]));              // Templated

endmodule

// Local Variables:
// verilog-auto-read-includes:t
// End:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant