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

confused using AUTO_TEMPLATE with regexp for instance name and pin name #612

Closed
veripoolbot opened this issue Feb 4, 2013 · 1 comment
Closed
Assignees
Labels

Comments

@veripoolbot
Copy link
Collaborator

@veripoolbot veripoolbot commented Feb 4, 2013


Author Name: David Rogoff
Original Redmine Issue: 612 from https://www.veripool.org
Original Date: 2013-02-04
Original Assignee: Wilson Snyder (@wsnyder)


Hi Wilson.

This one is obviously beyond my ELISP understanding (which doesn't take much). I can use regexp to get part of the instance name and use it in the pin name net. I can use regexp in pin names. I can even use both, but when I then try and use the internal variable and functions (e.g. downcast), I'm lost and can't get it to work.

module aaa
  (input logic clock,
    input logic reset,
 
    input logic [5:0] D_in,
    input logic [4:0] D2_in,
 
    ouput logic [5:0] D_out
    );
 
endmodule // aaa
 
 
 
module bbb;
 
 
  // Just rename clock/reset
 
  /* aaa AUTO_TEMPLATE "aaa_\([a-z_]+\)" (
    .clock (clk),
    .reset (rst),
    )*/
  aaa aaa_ABc
     (/*AUTOINST*/
      // Interfaces
      .D_out                             (D_out[5:0]),
      // Inputs
      .clock                             (clk),                   // Templated
      .reset                             (rst),                   // Templated
      .D_in                              (D_in[5:0]),
      .D2_in                             (D2_in[4:0]));
 

Rename other ports to portname_instextension

 /* aaa AUTO_TEMPLATE "aaa_\([a-z_]+\)" (
   .clock (clk),
   .reset (rst),
   .\(.*\)                              (\1_@[]),
   )*/
 aaa aaa_ABc
    (/*AUTOINST*/
     // Interfaces
     .D_out                             (D_out_ABc[5:0]),        // Templated
     // Inputs
     .clock                             (clk),                   // Templated
     .reset                             (rst),                   // Templated
     .D_in                              (D_in_ABc[5:0]),         // Templated
     .D2_in                             (D2_in_ABc[4:0]));       // Templated

Lowercase port names

  /* aaa AUTO_TEMPLATE "aaa_\([a-z_]+\)" (
    .clock (clk),
    .reset (rst),
    .\(.*\)                              (@"(downcase vl-name)"[]),
    )*/
  aaa aaa_ABc
     (/*AUTOINST*/
      // Interfaces
      .D_out                             (d_out[5:0]),            // Templated
      // Inputs
      .clock                             (clk),                   // Templated
      .reset                             (rst),                   // Templated
      .D_in                              (d_in[5:0]),             // Templated
      .D2_in                             (d2_in[4:0]));           // Templated
 

Lowercase port names AND add inst extension to name

  /* aaa AUTO_TEMPLATE "aaa_\([a-z_]+\)" (
    .clock (clk),
    .reset (rst),
    .\(.*\)                              (\1_@"(downcase vl-name)"[]),
    )*/
  aaa aaa_ABc
     (/*AUTOINST*/
      // Interfaces
      .D_out                             (D_out_d_out[5:0]),      // Templated
      // Inputs
      .clock                             (clk),                   // Templated
      .reset                             (rst),                   // Templated
      .D_in                              (D_in_d_in[5:0]),        // Templated
      .D2_in                             (D2_in_d2_in[4:0]));     // Templated
 

doesn't work.

@veripoolbot
Copy link
Collaborator Author

@veripoolbot veripoolbot commented Feb 4, 2013


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2013-02-04T19:31:46Z


Once you use @"..." normal @ substitution doesn't occur as it would make a mess. So once in lisp do everything in lisp:

 .\(.*\)       (\1_@"(downcase (concat vl-name \\"_\\" vl-cell-name))"[]),                            
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.