Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Modelsim Assert

Reply
Thread Tools

Modelsim Assert

 
 
RishiD
Guest
Posts: n/a
 
      11-16-2006
Hi,

I am still trying to learn how to create good test benches. Is it
possible to have modelsim to like give a warning when two of my signals
equal each other? Basically I want to run through my simulation, but
not go through all the wave forms to see if this error occurs. I
believe assertions are the way to go, but have never used them before.
Anyone point me to a tutorial of some sorts?

Thanks,

RishiD

 
Reply With Quote
 
 
 
 
ghelbig@lycos.com
Guest
Posts: n/a
 
      11-16-2006
The assert statement is much preferred over manually checking timing
diagrams. That's what they're there for.

You're looking for something like this:

assert Signal_1 = Signal_2
report "Signal_1 equals Signal_2"
severity warning;

Or better yet, try this link:
<http://www.google.com/search?hl=en&q=vhdl+assert&btnG=Google+Search>

 
Reply With Quote
 
 
 
 
RishiD
Guest
Posts: n/a
 
      11-17-2006
Ah thanks, kept searching "Modelsim assert". Thinking it was a
modelsim thing.

Thanks for the help.


http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> The assert statement is much preferred over manually checking timing
> diagrams. That's what they're there for.
>
> You're looking for something like this:
>
> assert Signal_1 = Signal_2
> report "Signal_1 equals Signal_2"
> severity warning;
>
> Or better yet, try this link:
> <http://www.google.com/search?hl=en&q=vhdl+assert&btnG=Google+Search>


 
Reply With Quote
 
KJ
Guest
Posts: n/a
 
      11-17-2006

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> The assert statement is much preferred over manually checking timing
> diagrams. That's what they're there for.
>
> You're looking for something like this:
>
> assert Signal_1 = Signal_2
> report "Signal_1 equals Signal_2"
> severity warning;
>


Minor problem. The original post asked "Is it possible to have modelsim to
like give a warning when two of my signals
equal each other" which means that what needs to be asserted is that the two
signals are NOT equal to each other so that the warning pops up when the two
signals ARE equal to each other.

assert Signal_1 /= Signal_2 -- or assert not(Signal_1 = Signal_2),
whichever floats your boat
report "Signal_1 equals Signal_2"
severity warning; -- typically I would use 'error' here instead
of 'warning' since it probably is a design error that needs fixing

When using an assert you specify the condition that is supposed to be true
so that when/if that condition is found to not be true the warning is
printed.

KJ


 
Reply With Quote
 
Ajeetha
Guest
Posts: n/a
 
      11-17-2006
Hi Rishi,
As others have pointed out, VHDL's assert will do this easily. But
there's lot more you can do with a specialized assertion language such
as PSL (with VHDL flavor) or SVA. I wrote a PSL tutorial some time
back, see: www.project-veripage.com

HTH
Ajeetha, CVC
www.noveldv.com

RishiD wrote:
> Hi,
>
> I am still trying to learn how to create good test benches. Is it
> possible to have modelsim to like give a warning when two of my signals
> equal each other? Basically I want to run through my simulation, but
> not go through all the wave forms to see if this error occurs. I
> believe assertions are the way to go, but have never used them before.
> Anyone point me to a tutorial of some sorts?
>
> Thanks,
>
> RishiD


 
Reply With Quote
 
ghelbig@lycos.com
Guest
Posts: n/a
 
      11-17-2006
"I left that as an exercise for the student."

"I code them upside down on purpose to test the bench."

Seriously, thanks for the correction.

GH

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
To assert or not to assert... ImpalerCore C Programming 79 05-17-2010 12:47 PM
Debug.Assert(): missing MsgBox (VS.NET 2003, C#) Mark Newby ASP .Net 1 05-03-2005 07:43 AM
assert 0, "foo" vs. assert(0, "foo") Thomas Guettler Python 3 02-23-2005 07:53 PM
assert(x) and '#define ASSERT(x) assert(x)' Alex Vinokur C Programming 5 11-25-2004 08:48 PM
RE: remove assert statement (Was: Re: PEP new assert idiom) Robert Brewer Python 1 11-07-2004 06:53 PM



Advertisments