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

Reply

VHDL - Unknown signal resolution in NCsim and Modelsim

 
Thread Tools Search this Thread
Old 12-16-2003, 04:56 PM   #1
Default Unknown signal resolution in NCsim and Modelsim


In sims using either Modelsim/NCsim, the following logic always
results in an 'X' output, regardless of the reset state, due to the
scope of analysis being too small:

z = (a AND b) OR c
c = NOT a

b = reset
a = 'X'
(and thus c = NOT X, still X but the opposite state of a)

When reset = '1', the output should always be forced to '1'.
Substitution of values shows that the logic above is correct, with the
value of input a not mattering if b = '1'. Using equation
substitution, the logic reduces to:

z = (a AND b) OR (a')
= (a OR a') AND (b OR a')
= (1) AND (b OR a')
= b OR a'

Where if b = '1', z = '1' (even if a' = 'X')

But the sim tools don't see things this way. Their scope doesn't
appear to be large enough to see that there is a relationship between
c and a, and therefore z is always 'X' no matter what the state of
input b.

How do we get around this?
Thank you,


vrangan@qualcomm.com
  Reply With Quote
Old 12-16-2003, 05:34 PM   #2
Mike Treseler
 
Posts: n/a
Default Re: Unknown signal resolution in NCsim and Modelsim
wrote:
> In sims using either Modelsim/NCsim, the following logic always
> results in an 'X' output, regardless of the reset state, due to the
> scope of analysis being too small:
>
> z = (a AND b) OR c
> c = NOT a
>
> b = reset
> a = 'X'
> (and thus c = NOT X, still X but the opposite state of a)


Post the actual code you are simulating.
Can't tell if you mean signals or variables,
single process or concurrent statements.

-- Mike Treseler



Mike Treseler
  Reply With Quote
Old 12-16-2003, 08:52 PM   #3
Jim Lewis
 
Posts: n/a
Default Re: Unknown signal resolution in NCsim and Modelsim
It is a simulators job to exectute the
code you write.

Is this code you wrote or code that was synthesized?
If it is code you wrote, post it and someone can
suggest a way to re-write it to give you
the results you want.

If it is the output of Synopsys, you may get some
benefit from setting the preserve_synchronous_resets
to true (note, they like changing names frequently,
so it may be something new). Another way to convey
this information is to put a tight timing delay on
reset so the results will be required to put reset
up front.

Cheers,
Jim

wrote:

> In sims using either Modelsim/NCsim, the following logic always
> results in an 'X' output, regardless of the reset state, due to the
> scope of analysis being too small:
>
> z = (a AND b) OR c
> c = NOT a
>
> b = reset
> a = 'X'
> (and thus c = NOT X, still X but the opposite state of a)
>
> When reset = '1', the output should always be forced to '1'.
> Substitution of values shows that the logic above is correct, with the
> value of input a not mattering if b = '1'. Using equation
> substitution, the logic reduces to:
>
> z = (a AND b) OR (a')
> = (a OR a') AND (b OR a')
> = (1) AND (b OR a')
> = b OR a'
>
> Where if b = '1', z = '1' (even if a' = 'X')
>
> But the sim tools don't see things this way. Their scope doesn't
> appear to be large enough to see that there is a relationship between
> c and a, and therefore z is always 'X' no matter what the state of
> input b.
>
> How do we get around this?
> Thank you,


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
Jim Lewis
Director of Training private.php?do=newpm&u=
SynthWorks Design Inc. http://www.SynthWorks.com
1-503-590-4787

Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~



Jim Lewis
  Reply With Quote
Old 12-17-2003, 07:07 PM   #4
fe
 
Posts: n/a
Default Re: Unknown signal resolution in NCsim and Modelsim
> z = (a AND b) OR (a')
> = (a OR a') AND (b OR a')
> = (1) AND (b OR a')
> = b OR a'
>

Sorry, it's wrong.
(a AND b) OR (a') <> (a OR a') AND (b OR a')
a*b - a <> (a - a) * (b - a)
3*5 - 3 = 12
(3-3) * (5 - 3) = 0

Simulator doesn't do optimization.
So your equation stay
z = (a AND b) OR NOT a

So, from ieee.std_logic_1164:
if b is '1' and a is 'x' then
not 'x' is 'x'
'x' and '1' is 'x'
'x' or 'x' is 'x'

if b is '0' and a is 'x' then
not 'x' is 'x'
'x' and '0' is '0'
'0' or 'x' is 'x'

z is always 'x'


You can simplify your equation to :
Z = a NAND (NOT b)

So, from ieee.std_logic_1164:
if b is '1' and a is 'x' then
not '1' is '0'
'x' and '0' is '0'
not '0' is '1'
z ='1'

if b is '0' and a is 'x' then
not '0' is '1'
'x' and '1' is 'x'
not 'x' is 'x'
z= 'x'

regards
Pat




fe
  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




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