Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  IPC::Locker
  Parallel::Forker
  Voneline
General Info
  Papers

Issue #612

confused using AUTO_TEMPLATE with regexp for instance name and pin name

Added by David Rogoff about 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
Autos
% Done:

0%


Description

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.

History

#1 Updated by Wilson Snyder about 7 years ago

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))"[]),

#2 Updated by Wilson Snyder about 7 years ago

  • Status changed from New to Closed

Also available in: Atom