Forums » Using AUTOs »
regexp on @ in Auto template
Added by Amir peleg over 1 year ago
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
Replies (4)
RE: regexp on @ in Auto template - Added by Amir peleg over 1 year ago
Just typo fix
.set (@_set), <- I need to to have the full instance name
RE: regexp on @ in Auto template - Added by Wilson Snyder over 1 year ago
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), ); */
RE: regexp on @ in Auto template - Added by Amir peleg over 1 year ago
Thanks It help :-)
anyway , for other use there is away to parsing "vl-cell-name" with regexp in each port field ?
RE: regexp on @ in Auto template - Added by Wilson Snyder over 1 year ago
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)"),
);
*/
(1-4/4)
![[logo]](/img/veripool_small.png)