1

I have a situation where I need to package a SystemVerilog environment and export it to a customer. I need to make sure I provide as few +incdir+ as possible for the customer to compile.

The environment is huge, and it contains many IPs and hence there are lot of directories that need to be included.

I want to know if there is any easy way to add incdir for compilation that includes directories of all the IPs?

I was thinking of add a file abc.txt in each of the IPs that contain +incdir and having a top.txt that includes all the abc.txt from all the IPs. It did not work.

This is what I tried

f: abc.txt

+incdir+tb_top.sv
+incdir+ip1/abc.txt
+incdir+ip2/abc.txt

f:ip1/abc.txt

+incdir+a.sv
+incdir+b.sv

f:ip2/abc.txt

+incdir+a.sv
+incdir+b.sv
toolic
  • 57,801
  • 17
  • 75
  • 117
user1978273
  • 484
  • 10
  • 24

2 Answers2

1

You are misusing the +incdir+ simulation command compile option. incdir is short for "include directory". You are using file names, but you need to use directory names, like:

+incdir+ip1
+incdir+ip2

Keep in mind that incdir is only used for searching directories for files included using the `include compiler directive inside a Verilog source code file:

module m;
    `include "parameters.v"
    // ...
endmodule

Look at the VCS documentation for -y and +libext+ also.

toolic
  • 57,801
  • 17
  • 75
  • 117
0

+incdir+ specifies a list of directories where to look for included files. No plain files can be used as its arguments.

Potentially vcs -f qualifier allows nested use, so you can have: a.txt

+incdir+inc1
top.sv
-f inc1/b.txt

There is an issue though, the +incdir+ resolves non-absolute paths relative to execution PWD which has nothing to do with location of the '-f' txt file. So, you either have to fix relative paths for IPs or use absolute paths. The latter does not work well in customer delivery.

Another issue you can hit is that multiple IPs might have include file named the same, but located in different paths. And it could contain different contents for different IPs. In this respect the global order of +incdir+ is very important.

By default vcs produces a list of parsed files, e.g.,

Parsing design file 'top.sv'
Parsing included file 'inc1/inc1.svh'.
Parsing included file 'inc1/inc2/inc2.svh'.
Back to file 'inc1/inc1.svh'.
Back to file 'top.sv'.

potentially you can parse vcs log and extract all files it consumes in the right order. From there a list of +incdir+s could be produced.

Serge
  • 11,616
  • 3
  • 18
  • 28