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

Reply

VHDL - Event counters for simulation only

 
Thread Tools Search this Thread
Old 06-26-2005, 05:42 AM   #1
Default Event counters for simulation only


Hi,

I am trying to add internal counters to an entity and have the results output
at the end of simulation. It is most convenient to do this because there are
going to be a few million cycles and I cannot examine a waveform to determine
certain things.

However, I would like this addition to not be synthesized (because the counters
would never be used in any meaningful way). Is there any general method to
accomplish this? Would it be better to just add the counters to the
synthesize-able design?


_spot_thegthorpe_extra@ee.ryerson.ca
  Reply With Quote
Old 06-26-2005, 06:56 AM   #2
Ralf Hildebrandt
 
Posts: n/a
Default Re: Event counters for simulation only
_ wrote:

> However, I would like this addition to not be synthesized (because the counters
> would never be used in any meaningful way). Is there any general method to
> accomplish this?


Use a generic parameter.

entity my_comp
generic(
sim : integer:=0 );
port(
...


Test inide your component the generic parameter - e.g. with an if-generate:

if (sim=1) generate
....


If you instantiate your component, override the generic parameter. It is possible to feed
the generic through several components, that all have to be synthesized. Just assign a
default value to it, that disables your parts. At the testbench level override it.

You may even test the parameter inside a process in a normal if-statement. Your synthesis
tool then should warn you, that a branch can never be reached, but as this is exactly,
what you want, don't care for the warning.



Using a generic parameter works with every synthesis tool, but may not be acceptable, if
your component has to be sold as an IP-core, because such a generic may not be wanted.
Then there is the option to use synthesis-tool specific switches, like
-- pragma translate_off
....
-- pragma translate_on
which is self-explaining. Note, that then your code is not portable.

Ralf


Ralf Hildebrandt
  Reply With Quote
Old 06-26-2005, 11:51 PM   #3
Mike Treseler
 
Posts: n/a
Default Re: Event counters for simulation only
_ wrote:

> I am trying to add internal counters to an entity and have the results output
> at the end of simulation. It is most convenient to do this because there are
> going to be a few million cycles and I cannot examine a waveform to determine
> certain things.


Consider bringing the nodes to be counted out to
a top port -- either with an assignment or using
modelsim signal-spy. Then the testbench can
do the counting.

-- Mike Treseler


Mike Treseler
  Reply With Quote
Old 06-27-2005, 02:04 AM   #4
g-edit_tho-rpe@ee.ryerson.ca
 
Posts: n/a
Default Re: Event counters for simulation only
Ralf Hildebrandt <Ralf-> wrote:
> Use a generic parameter.


> entity my_comp
> generic(
> sim : integer:=0 );
> port(
> ...



> Test inide your component the generic parameter - e.g. with an if-generate:


> if (sim=1) generate
> ...



> If you instantiate your component, override the generic parameter. It is possible to feed
> the generic through several components, that all have to be synthesized. Just assign a
> default value to it, that disables your parts. At the testbench level override it.


> You may even test the parameter inside a process in a normal if-statement. Your synthesis
> tool then should warn you, that a branch can never be reached, but as this is exactly,
> what you want, don't care for the warning.


This is what I think I will do. I have used generics before, but only in
generate statements for instantiating components. According to what you are
saying, the compiler should be smart enough to exclude the unsynthesizeable
profiling part because it is never activated when doing synthesis.

> Using a generic parameter works with every synthesis tool, but may not be acceptable, if
> your component has to be sold as an IP-core, because such a generic may not be wanted.
> Then there is the option to use synthesis-tool specific switches, like
> -- pragma translate_off
> ...
> -- pragma translate_on
> which is self-explaining. Note, that then your code is not portable.


> Ralf


Thanks for the tips.


g-edit_tho-rpe@ee.ryerson.ca
  Reply With Quote
Old 06-27-2005, 02:06 AM   #5
gthorpe@ee.ryerson.ca
 
Posts: n/a
Default Re: Event counters for simulation only
Mike Treseler <> wrote:
> _ wrote:


>> I am trying to add internal counters to an entity and have the results output
>> at the end of simulation. It is most convenient to do this because there are
>> going to be a few million cycles and I cannot examine a waveform to determine
>> certain things.


> Consider bringing the nodes to be counted out to
> a top port -- either with an assignment or using
> modelsim signal-spy. Then the testbench can
> do the counting.


I thought of doing this, but extra ports and associated circuitry will then be
included in synthesis won't it? I am trying to let the testbench infer as much
as it can from the normal ports, but I would prefer not adding more just for
the purpose of simulation.

> -- Mike Treseler



gthorpe@ee.ryerson.ca
  Reply With Quote
Old 06-27-2005, 04:32 AM   #6
Ajeetha
 
Posts: n/a
Default Re: Event counters for simulation only
Hi,
With Modelsim's Signal-spy (or equivalents in various others) you
don't have to add *any extra port* to your design and still achieve
what you intended. I've a simple example that will keep it
quasi-simulator indepedent. take a look at:

http://www.verificationguild.com/mod...p=getit&lid=11

HTH
Ajeetha
http://www.noveldv.com



Ajeetha
  Reply With Quote
Old 06-27-2005, 04:53 AM   #7
Mike Treseler
 
Posts: n/a
Default Re: Event counters for simulation only
wrote:

> I thought of doing this, but extra ports and associated circuitry will then be
> included in synthesis won't it?


Doesn't have to be.
Signal-spy does not touch the source at all.
A port testpoint can be commented out or wrapped
for synthesis.

-- Mike Treseler


Mike Treseler
  Reply With Quote
Old 06-27-2005, 08:06 PM   #8
gthorpe@ee.ryerson.ca
 
Posts: n/a
Default Re: Event counters for simulation only
Ajeetha <> wrote:
> Hi,
> With Modelsim's Signal-spy (or equivalents in various others) you
> don't have to add *any extra port* to your design and still achieve
> what you intended. I've a simple example that will keep it
> quasi-simulator indepedent. take a look at:


> http://www.verificationguild.com/mod...p=getit&lid=11


> HTH
> Ajeetha
> http://www.noveldv.com


Hi,

Thanks for your tips. I think I will combine package-resident signals (which
your code uses combined with the tool's extensions) with generics to get add
profiling code without affecting synthesis. It seems that this is portable and
would work for what I want to do.

For future reference for anyone else having similar trouble, see section
"4.2.16 How to Monitor Signals" in the VHDL FAQ for comp.lang.vhdl.
Off-topic: is it possible to find the FAQ using an NNTP client (I have to use
the web page at www.eda.org)?



gthorpe@ee.ryerson.ca
  Reply With Quote
Old 06-28-2005, 04:43 AM   #9
gthorpe@ee.ryerson.ca
 
Posts: n/a
Default Re: Event counters for simulation only
Ajeetha <> wrote:
> Hi,
> With Modelsim's Signal-spy (or equivalents in various others) you
> don't have to add *any extra port* to your design and still achieve
> what you intended. I've a simple example that will keep it
> quasi-simulator indepedent. take a look at:


> http://www.verificationguild.com/mod...p=getit&lid=11


> HTH
> Ajeetha
> http://www.noveldv.com


Following up:

I implemented the package-resident signals, but the test bench is just getting
zero values in the text output. The signals are in fact getting the values
though: its just that they don't show up in the testsbench's output (all zero
values). Any idea why this is happening?

The output from 'ls -v' in vhdlsim (synopsys) indicates that the values are
being updated (the correct values I expect are there). But those values don't
show up when I do write(line, value), writeline(output, line). Is there some
rule about package-resident signals I am missing?


gthorpe@ee.ryerson.ca
  Reply With Quote
Old 06-28-2005, 07:15 PM   #10
gthorpe@ee.ryerson.ca
 
Posts: n/a
Default Re: Event counters for simulation only
wrote:
> Ajeetha <> wrote:
>> Hi,
>> With Modelsim's Signal-spy (or equivalents in various others) you
>> don't have to add *any extra port* to your design and still achieve
>> what you intended. I've a simple example that will keep it
>> quasi-simulator indepedent. take a look at:


>> http://www.verificationguild.com/mod...p=getit&lid=11


>> HTH
>> Ajeetha
>> http://www.noveldv.com


> Following up:


> I implemented the package-resident signals, but the test bench is just getting
> zero values in the text output. The signals are in fact getting the values
> though: its just that they don't show up in the testsbench's output (all zero
> values). Any idea why this is happening?


> The output from 'ls -v' in vhdlsim (synopsys) indicates that the values are
> being updated (the correct values I expect are there). But those values don't
> show up when I do write(line, value), writeline(output, line). Is there some
> rule about package-resident signals I am missing?


Sorry for the noise, this was due to a bug in my code.


gthorpe@ee.ryerson.ca
  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
Load .aspx page on another frame from TreeView Event Sangeeth Software 0 06-25-2009 09:20 AM
master page does not change due to preinit event not firing franchise63 General Help Related Topics 0 02-13-2008 09:18 AM
RIP HD-DVD? - HD-DVD CES Event Canceled Air Raid DVD Video 0 01-05-2008 03:06 AM
How do find out if a button was clicked before the textchanged event of textbox fires Jack General Help Related Topics 0 10-27-2006 10:19 AM
SUPER BOWL GALA EVENT, tickets available TheLeiterSideYGB DVD Video 1 01-06-2004 11:55 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