veripool / verilog-mode

Verilog-Mode for Emacs with Indentation, Hightlighting and AUTOs. Master repository for pushing to GNU, verilog.com and veripool.org.
http://veripool.org/verilog-mode
GNU General Public License v3.0
253 stars 90 forks source link

Using regex/glob for module/instance in AUTO_TEMPLATE #1675

Closed engrvns closed 4 years ago

engrvns commented 4 years ago

The current AUTO_TEMPLATE is defined as -

/ module AUTO_TEMPLATE ( ... ); /

If you need the same AUTO_TEMPLATE rules for multiple modules the syntax would be -

/ module1 AUTO_TEMPLATE module2 AUTO_TEMPLATE ( /

If we can use regex/glob patterns for module names so the same AUTO_TEMPLATE can apply for multiple modules matching pattern

The question than is can we use "regex/glob patterns for module names"?

P.S: This when combined this with concept of extensions of AUTO_TEMPLATEs becomes very useful.

wsnyder commented 4 years ago

Interesting idea, but at present difficult to implement and it would be O(n^2) as you'd need to match every template to every module expanded, which would be slow. So I'd prefer to table this.