Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Verilog / VHDL

 
Thread Tools Search this Thread
Old 12-18-2003, 10:39 AM   #1
Default Verilog / VHDL


Hi

I am an experienced Verilog designer and am about to start
work with a company that uses VHDL. I have been studying VHDL
and am starting to get a feel for the language. It would be good however to
be able to relate features of Verilog with equivalents in VHDL.

A specific question relates to compiler directives and command
line arguments in Verilog i.e. 'ifdef and +define+
The application is for a testbench where I want to write code to print
specific information for debug which I don't want to be printed
when the testbench executes normally. e.g. in Verilog I can write
code such as:

'ifdef debug_mode
code to print lots of debug information
'endif

There can be many of these code segments throughout the testbench
and if I want to turn them on, in the compile script I would have:

+define+debug_mode

Is there an equivalent mechanism in VHDL?

Does any body know of documents that discuss such language
equivalents?

Thanks in advance, Edward






EdwardH
  Reply With Quote
Old 12-18-2003, 12:53 PM   #2
Francisco Camarero
 
Posts: n/a
Default Re: Verilog / VHDL
EdwardH wrote:
>
> Hi
>
> I am an experienced Verilog designer and am about to start
> work with a company that uses VHDL. I have been studying VHDL
> and am starting to get a feel for the language. It would be good however to
> be able to relate features of Verilog with equivalents in VHDL.
>
> A specific question relates to compiler directives and command
> line arguments in Verilog i.e. 'ifdef and +define+
> The application is for a testbench where I want to write code to print
> specific information for debug which I don't want to be printed
> when the testbench executes normally. e.g. in Verilog I can write
> code such as:
>
> 'ifdef debug_mode
> code to print lots of debug information
> 'endif
>
> There can be many of these code segments throughout the testbench
> and if I want to turn them on, in the compile script I would have:
>
> +define+debug_mode
>
> Is there an equivalent mechanism in VHDL?
>
> Does any body know of documents that discuss such language
> equivalents?
>
> Thanks in advance, Edward


I would do a similar thing using generics,
as in this very reduced example:


entity test is

generic (debug : boolean := false); -- default

end test;

architecture single of test is

begin

single : process

begin

assert not(debug)
report "Debug Message"
severity note;

wait ; -- halt;

end process;

end single;

And then, overriding the value for the generic
when necessary, e.g for ModelSim:

vsim -Gdebug=true work.test

HTH,
Fran.


Francisco Camarero
  Reply With Quote
Old 12-18-2003, 10:59 PM   #3
Kai Harrekilde-Petersen
 
Posts: n/a
Default Re: Verilog / VHDL
Francisco Camarero <"camarero a"@t ee [d.ot] ethz [do.t] ch> writes:

> EdwardH wrote:

[How to do the equivalent of '+define+debug_mode' in VHDL]:
> > There can be many of these code segments throughout the testbench
> > and if I want to turn them on, in the compile script I would have:
> >
> > +define+debug_mode
> >
> > Is there an equivalent mechanism in VHDL?
> >
> > Does any body know of documents that discuss such language
> > equivalents?

>
> I would do a similar thing using generics,
> as in this very reduced example:


[snip example]

Another approach is to have a signal on the top level of your
testbench, which you manipulate using Tcl (e.g. "force -deposit
/debug_mode true").

Or even have a (text) file parser in VHDL directly, which assigns a
value to the signal in question, based on keywords in the text file.

Regards,


Kai


Kai Harrekilde-Petersen
  Reply With Quote
Old 12-22-2003, 08:03 AM   #4
Slawek Grabowski
 
Posts: n/a
Default Re: Verilog / VHDL
Hi,
I use frequently the if-generate construct:

architecture HelloWorld of HelloWorld is
constant DEBUG : BOOLEAN := TRUE;
begin

GEN1:
if(DEBUG=TRUE) generate
assert (A=B) report "Error: It is not equal.";
end generate;

end HelloWorld;

Best Regards,
Slawek Grabowski

"Kai Harrekilde-Petersen" <> wrote in message
news:...
> Francisco Camarero <"camarero a"@t ee [d.ot] ethz [do.t] ch> writes:
>
> > EdwardH wrote:

> [How to do the equivalent of '+define+debug_mode' in VHDL]:
> > > There can be many of these code segments throughout the testbench
> > > and if I want to turn them on, in the compile script I would have:
> > >
> > > +define+debug_mode
> > >
> > > Is there an equivalent mechanism in VHDL?
> > >
> > > Does any body know of documents that discuss such language
> > > equivalents?

> >
> > I would do a similar thing using generics,
> > as in this very reduced example:

>
> [snip example]
>
> Another approach is to have a signal on the top level of your
> testbench, which you manipulate using Tcl (e.g. "force -deposit
> /debug_mode true").
>
> Or even have a (text) file parser in VHDL directly, which assigns a
> value to the signal in question, based on keywords in the text file.
>
> Regards,
>
>
> Kai





Slawek Grabowski
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute an external software from VHDL? And how to interface VHDL with JAVA? becool_nikks Software 0 03-06-2009 07:08 PM
reading mp3 file in binary format in vhdl latheesh General Help Related Topics 0 02-05-2008 05:40 AM
Help on auto conversion from Matlab to vhdl on filter design hardheart Hardware 0 12-07-2007 09:19 AM
ARRAY(n DOWNTO 0) OF STD_LOGIC_VECTOR(m DOWNTO 0) - VHDL freitass Hardware 0 11-01-2007 03:44 PM
VHDL code for SPI Master shah_satish2002 Hardware 2 07-22-2007 08:12 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46