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

Question: regexp on @ in Auto template #309

Closed
veripoolbot opened this issue Dec 28, 2010 · 4 comments
Closed

Question: regexp on @ in Auto template #309

veripoolbot opened this issue Dec 28, 2010 · 4 comments
Labels

Comments

@veripoolbot
Copy link
Collaborator


Author Name: Amir peleg
Original Redmine Message: 424 from https://www.veripool.org


Hi ,
Can I add some regexp on the module instance name which store in the @ lisp variable

For example

  /* int_2  AUTO_TEMPLATE "\(.*\)"           
    (
    .en             (en[@]), *<- I need here to have only the index*
    .set        (@_set),      *<- I need to to have the full instance name (@)*
    );

Thanks
Amir

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Amir peleg
Original Date: 2010-12-28T10:21:12Z


Just typo fix

.set (@_set), <- I need to to have the full instance name

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2010-12-28T12:09:14Z


If I understand you want @ to have two meanings? Leave @ to be the number, and use a lisp template in the other one

  /* int_2  AUTO_TEMPLATE
    (
    .en         (en[@]),
    .set        (@"vl-cell-name"_set),
    ); */

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Amir peleg
Original Date: 2010-12-28T12:17:15Z


Thanks
It help :-)

anyway , for other use
there is away to parsing "vl-cell-name" with regexp in each port field ?

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2010-12-28T12:38:21Z


It's lisp, you can do anything :)

For clarity, I'd define the function to do the abstraction outside the template:

    /* AUTO_LISP(defun vl-getparam2 (strg)
     (string-match "[^0-9]*[0-9]+[^0-9]*\\([0-9]+\\)" strg)
     (match-string 1 strg))*/

    /* InstName AUTO_TEMPLATE (
     .out (@),
     .in (@"(vl-getparam2 vl-cell-name)"),
     );
     */

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

No branches or pull requests

1 participant