FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > Verilog

Verilog comp.lang.verilog newsgroup / usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-29-2005, 11:13 PM
Jason Zheng
Guest
 
Posts: n/a
Default defining a string macro from ncverilog command line

This is a specific question regarding cadence ncverilog. I tried to
define a string macro (e.g. a file name "abc.log") from the command line
options of ncverilog, which is a launcher for the verilog compiler
ncvlog. ncvlog has a command option -DEFINE, and ncverilog has an option
+ncvlogargs+"..." for passing ncvlog options. The issue I seem to be
having is that I can't seem to define string macros this way:

ncverilog +ncvlogargs+'-DEFINE NAME="abc.log"'

The preprocessor seems to strip away the inner quotation automatically.
I doubt this is a shell issue, but I'm using tcsh. Does anyone have a clue?

Here's the test program that I used:

`timescale 1ns / 100ps
module test;
initial
$display (`NAME);

endmodule // test

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 03-30-2005, 01:12 AM
Guest
 
Posts: n/a
Default 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\"

Reply With Quote
  #3 (permalink)  
Old 03-30-2005, 01:28 AM
Jason Zheng
Guest
 
Posts: n/a
Default Re: defining a string macro from ncverilog command line

[email protected] wrote:
> 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\"
>

Ahh... I wasn't aware of this option. Much appreciated your help.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VirSim command line chainastole Verilog 2 02-14-2005 06:57 PM
dw_prefer_mc_inside command in DC whizkid Verilog 1 10-29-2004 12:43 PM
Setting a Verilog reg to a character string from ModelSim Charles Bailey Verilog 2 10-05-2004 04:30 AM
Is it possible to define a preprocessor macro in Xilinx ISE Swarna B Verilog 3 10-26-2003 02:27 AM
Verilog VCD and string literals Jan Decaluwe Verilog 0 07-24-2003 10:30 AM


All times are GMT +1. The time now is 12:06 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved