How about AUTOINCLUDE?
Added by Leith Johnson about 1 year ago
I've learned that almost all of my clients are allergic to include files. Freqeuently, I'm not even fully informed about why. Mine is not to reason why.
My last job had two large paramater definition files that were included as needed in various places. The client and myself were quite pleased with this structure until the client tried to turn the block into secure IP.
Apparently there is some issue with encyrpted file names, blah, blah. To our combined dismay, the easiest to do was go in and replace the includes with flat copies of the include files in about 15 places. Nobody was happy about this.
Something like /*AUTOINCLUDE <filename> */ simply copies the named file starting on the next line following the AUTOINCLUDE and appends an // End of automatics at the end? Killing the AUTOs gets rid of the include file while editing.
With this, common functions etc. can be defined/maintained in one place. Language processors don't know anything about it. The actual source files will have duplicated code, but at least it can be killed during editing.
Any thoughts?
Leith Johnson
Replies (3)
RE: How about AUTOINCLUDE? - Added by Wilson Snyder about 1 year ago
You can do that now using
/*AUTOINSERTLISP(insert (shell-command-to-string "cat filename"))*/
You can also write lisp code to do it directly (insert-file) which will be more efficient.
RE: How about AUTOINCLUDE? - Added by Leith Johnson about 1 year ago
Fabulous!
/*AUTOINSERTLISP (insert-file-contents "foo.vh")*/
does the trick.
Some sort of //verilog-library-incdir:() might be a nice touch.
Thanks for the help.
Leith Johnson
RE: RE: How about AUTOINCLUDE? - Added by Wilson Snyder about 1 year ago
If I understand your incdir request right, then this should work. It'll use the normal search path that the AUTOS recognise
/*AUTOINSERTLISP (insert-file-contents (car (verilog-library-filenames "foo.vh")))*/
You'll get an odd error if the file doesn't exist.
(1-3/3)
![[logo]](/img/veripool_small.png)