Re: defining a string macro from ncverilog command line
Trying to pass quotes through a shell and a wrapper can get messy, with
lots of escaping required. I did some experimenting and came up with
something that worked. Using your basic approach, I found it necessary
to escape a backslash to get a backslash to survive to escape the
quotes with:
ncverilog +ncvlogargs+'-DEFINE NAME=\\"abc.log\\"'
There may be a better way of doing it, but I'm not an expert on this.
It was simpler not to use +ncvlogargs to pass the option to ncvlog.
Since the purpose of ncverilog is to handle Verilog-XL command line
options and translate them into options for the NC-Verilog tools, you
can use the Verilog-XL option that defines a macro. This avoids some
quoting and double-escaping:
ncverilog '+define+NAME="abc.log"'
or
ncverilog +define+NAME=\"abc.log\"
|