Forums » Using AUTOs »
auto not descending into `include files ...
Added by Clay Douglass about 2 years ago
I am working with some files that have the port list and input/output declaration in included files e.g.
xunit.ports.v:1: // Outputs
xunit.ports.v:2: foo,
xunit.ports.v:3: // Inputs
xunit.ports.v:4: bar
xunit.tinc.vs:1: input bar;
xunit.tinc.vs:2: output foo;
xunit.v:1:
xunit.v:2:module xunit (
xunit.v:3:`include "xunit.ports.v"
xunit.v:4:)
xunit.v:5:`include "xunit.tinc.vs"
xunit.v:6: assign foo = bar;
xunit.v:7:endmodule // xunit
xunit.v:8:
xunit.v:9:// Local Variables:
xunit.v:10:// verilog-library-flags:("-y ./ ")
xunit.v:11:// verilog-library-extensions:(".v" ".h" ".sv" ".vs")
xunit.v:12:// eval:(verilog-read-defines)
xunit.v:13:// eval:(verilog-read-includes)
xunit.v:14:// eval:(setq verilog-auto-read-includes t)
xunit.v:15:// End:
xunit_top.v:1:
xunit_top.v:2:module xunit_top ( /*AUTOARG*/)
xunit_top.v:3: xunit i_xunit(/*AUTOINST*/);
xunit_top.v:4:
xunit_top.v:5:endmodule // xunit_top
xunit_top.v:6:// Local Variables:
xunit_top.v:7:// verilog-library-flags:("-y ./")
xunit_top.v:8:// verilog-library-extensions:(".v" ".h" ".sv" ".vs")
xunit_top.v:9:// eval:(verilog-read-defines)
xunit_top.v:10:// eval:(verilog-read-includes)
xunit_top.v:11:// eval:(setq verilog-auto-read-includes t)
xunit_top.v:12:// End:
If I verilog-auto in xunit_top.v it does nothing. If I manually replace the include with the file content it works fine. Is there a setting to make it follow the `include when it parse for ports?
Thanks,
Clay
Replies (6)
RE: auto not descending into `include files ... - Added by Clay Douglass about 2 years ago
Hmmm, forum formated my post poorly. Attaching files.
xunit.zip (1.1 kB)
RE: auto not descending into `include files ... - Added by Wilson Snyder about 2 years ago
Is there a setting to make it follow the `include when it parse for ports?
No, sorry. The way it's assumed you'd do things like this is to use /*AUTOINOUTMODULE*/
xunit.ports.v would then need a module/endmodule; they can be ifdef'ed if you wish:
`ifdef NEVER // Just for emacs module never; `endif input a; `ifdef NEVER endmodukle `endif
RE: auto not descending into `include files ... - Added by Wilson Snyder about 2 years ago
BTW the other advantage of AUTOINOUTMODULE is then you don't need to maintain two includes; just one will do it and use /*AUTOARG*/ to autogenerate the port list (or use verilog 2001 syntax).
RE: auto not descending into `include files ... - Added by Wilson Snyder about 2 years ago
Hmm.... Maybe this instead of the include? I'm not sure it will be replaced in time for the autos to work.
/*AUTOINSERTLISP(insert-file "foo.port.v")*/RE: auto not descending into `include files ... - Added by Wilson Snyder about 2 years ago
[I put AUTOINSERTLISP] in the same file and it still does not expand. I guess the AUTOINSERTLISP happens after the parsing.
If it doesn't expand at all you might have a old version. If it doesn't work, it will expand, but it won't recognize the new ports.
I'm curious, and didn't want you to download with little hope of success, so ran an experiment. It works great. BTW There's no point in using the port file, Verilog-Mode will do it for you:
module xunit (/*AUTOARG*/ // Outputs foo, // Inputs bar ); //`include "xunit.tinc.vs" /*AUTOINSERTLISP(insert-file "xunit.tinc.vs")*/ input bar; output foo; assign foo = bar; endmodule
RE: auto not descending into `include files ... - Added by Wilson Snyder about 2 years ago
I am using verilog-mode 475. Your version behaved the same way mine did initially. Then I copied the xunit.tinc.vs to the local dir and that worked! Thanks. Is there a way to set the search path for AUTOINSERTLISP(insert-file?
I tried it, and noticed there's a bug that it doesn't clean up what it inserts properly. So, grab new version 551 from here, then use:
/*AUTOINSERTLISP(verilog-library-filenames (insert-file "xunit.tinc.vs"))*/
Oops. I just saw the input and output for foo and bar in your module def. When I removed them it no long expands the AUTOINST... So I the AUTOINSERTLISP is not working for me. Are you sure it's working for you? Can you add an output to xunit.tinc.vs and have it show up in your AUTOINST list?
It works. Since it's inlined, you need to save the tinc file, auto-expand the child (module with insertlisp) first, then move to the parent. (Just as if you added the input in the non-included place.)
(1-6/6)
![[logo]](/img/veripool_small.png)