Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Difference between Xilinx isim and modelsim
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
guenter  
View profile  
 More options Feb 1, 10:13 am
Newsgroups: comp.arch.fpga
From: "guenter" <guenter.wolpert@n_o_s_p_a_m.orsys.de>
Date: Wed, 01 Feb 2012 09:13:00 -0600
Subject: Difference between Xilinx isim and modelsim
Is it allowed to pass a member of a std_logic_vector to the rising_edge
function?
When doing this, isim doen's detect all changes, while modelsim does.
The code below toggles bits of a 3-bit vector. Bit 1 of the vector is
checked for rising and falling edges by directly passing vec(1) to
reising_edge(). Bit 1 is also assigned to a scalar signal which is also
checked for edges:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity top is
end top;

architecture Behavioral of top is
  signal vec : std_logic_vector(2 downto 0) := "000";
  signal sig : std_logic                    := '0';
begin
  gen: process is
  begin
    vec <= "000" after 1 ns,
           "010" after 2 ns,
           "000" after 3 ns,
           "101" after 4 ns,
           "111" after 5 ns,
           "101" after 6 ns;
    wait for           6 ns;
    wait;
  end process gen;

  sig <= vec(1);

  watch_bit1a: process is
  begin
    wait until rising_edge(vec(1));
    report "rising edge on vec" severity note;
  end process watch_bit1a;

  watch_bit1b: process is
  begin
    wait until falling_edge(vec(1));
    report "falling edge on vec" severity note;
  end process watch_bit1b;

  watch_bit1c: process is
  begin
    wait until rising_edge(sig);
    report "rising edge on sig" severity note;
  end process watch_bit1c;

  watch_bit1d: process is
  begin
    wait until falling_edge(sig);
    report "falling edge on sig" severity note;
  end process watch_bit1d;

end Behavioral;

Simulating with modelsim reports all edges:
# ** Note: rising edge on vec Time: 2 ns  Iteration: 0  Instance: /top
# ** Note: rising edge on sig Time: 2 ns  Iteration: 1  Instance: /top
# ** Note: falling edge on vec Time: 3 ns  Iteration: 0  Instance: /top
# ** Note: falling edge on sig Time: 3 ns  Iteration: 1  Instance: /top
# ** Note: rising edge on vec Time: 5 ns  Iteration: 0  Instance: /top
# ** Note: rising edge on sig Time: 5 ns  Iteration: 1  Instance: /top
# ** Note: falling edge on vec Time: 6 ns  Iteration: 0  Instance: /top
# ** Note: falling edge on sig Time: 6 ns  Iteration: 1  Instance: /top

isim only reports those edges that make bit 1 different from the remaining
bits:

at 2 ns: Note: rising edge on vec (/top/).
at 2 ns(1): Note: rising edge on sig (/top/).
at 3 ns(1): Note: falling edge on sig (/top/).
at 5 ns(1): Note: rising edge on sig (/top/).
at 6 ns: Note: falling edge on vec (/top/).
at 6 ns(1): Note: falling edge on sig (/top/).

I can imagine that passing vec(1) to rising_edge is not really allowed
since it is of type std_logic_vector(1 downto 1) instead of std_logic.
What do you think about this? Is isim more accurate with the standard or is
is simply a bug?

regards
Guenter

---------------------------------------        
Posted through http://www.FPGARelated.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alan Fitch  
View profile  
 More options Feb 1, 6:08 pm
Newsgroups: comp.arch.fpga
From: Alan Fitch <a...@invalid.invalid>
Date: Wed, 01 Feb 2012 23:08:29 +0000
Local: Wed, Feb 1 2012 6:08 pm
Subject: Re: Difference between Xilinx isim and modelsim
On 01/02/12 15:13, guenter wrote:
> Is it allowed to pass a member of a std_logic_vector to the rising_edge
> function?
> When doing this, isim doen's detect all changes, while modelsim does.
> The code below toggles bits of a 3-bit vector. Bit 1 of the vector is
> checked for rising and falling edges by directly passing vec(1) to
> reising_edge(). Bit 1 is also assigned to a scalar signal which is also
> checked for edges:

<snipped code>

I would say that Modelsim is correct.

> I can imagine that passing vec(1) to rising_edge is not really allowed
> since it is of type std_logic_vector(1 downto 1) instead of std_logic.

That's not correct. An element of a std_logic_vector is just std_logic.
vec(1) is std_logic. vec(1 downto 1) is a 1 element wide std_logic_vector.

> What do you think about this? Is isim more accurate with the standard or is
> is simply a bug?

I believe it is a bug in Isim.

I'm basing this on reading section 8.1 of the VHDL 2002 standard "wait
statement" where it says there is an implicit sensitivity list derived from

- A function call, apply this rule to every actual designator in every
parameter association

and

— An indexed name whose prefix denotes a signal, add the longest static
prefix of the name to the
sensitivity set and apply this rule to all expressions in the indexed name

As you're using vec(1), the longest static prefix is behavioural.vec(1),
so vec(1) should trigger the wait until whenever it changes.

regards
Alan

--
Alan Fitch


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy  
View profile  
 More options Feb 2, 11:47 am
Newsgroups: comp.arch.fpga
From: Andy <jonesa...@comcast.net>
Date: Thu, 2 Feb 2012 08:47:06 -0800 (PST)
Local: Thurs, Feb 2 2012 11:47 am
Subject: Re: Difference between Xilinx isim and modelsim
On Feb 1, 5:08 pm, Alan Fitch <a...@invalid.invalid> wrote:

I believe that is not correct. The LSP is ...vec (the whole vector).
So processes that appear to be sensitive to one bit of a vector are
also sensitive to other bits in the vector, but the
rising_edge(vec(1)) function invoked by the wait statement is only
looking at vec(1).

Nevertheless, it looks like isim has a bug.

Andy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alan Fitch  
View profile  
 More options Feb 2, 7:16 pm
Newsgroups: comp.arch.fpga
From: Alan Fitch <a...@invalid.invalid>
Date: Fri, 03 Feb 2012 00:16:56 +0000
Local: Thurs, Feb 2 2012 7:16 pm
Subject: Re: Difference between Xilinx isim and modelsim
On 02/02/12 16:47, Andy wrote:

Hi Andy,
 I was (perhaps foolishly) assuming that because 1 is a constant, the
slice could be statically determined - but you could well be correct, I
really need to go away and read the definition of longest static prefix
again

> Nevertheless, it looks like isim has a bug.

I agree,

regards

Alan

--
Alan Fitch


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alan Fitch  
View profile  
 More options Feb 2, 7:48 pm
Newsgroups: comp.arch.fpga
From: Alan Fitch <a...@invalid.invalid>
Date: Fri, 03 Feb 2012 00:48:23 +0000
Local: Thurs, Feb 2 2012 7:48 pm
Subject: Re: Difference between Xilinx isim and modelsim
On 03/02/12 00:16, Alan Fitch wrote:

Ok, here's the text from 1076-2002

"Furthermore, a name is said to be a locally static name if and only if
one of the following conditions hold:

...

— The name is an indexed name whose prefix is a locally static name, and
every expression that appears as part of the name is a locally static
expression.

— The name is a slice name whose prefix is a locally static name and
whose discrete range is a locally static discrete range.

A static signal name is a static name that denotes a signal. The longest
static prefix of a signal name is the name itself, if the name is a
static signal name; otherwise, it is the longest prefix of the name that
is a static signal name. Similarly, a static variable name is a static
name that denotes a variable, and the longest static prefix of a
variable name is the name itself, if the name is a static variable name;
otherwise, it is the longest prefix of the name that is a static
variable name.

Examples:
S(C,2) --A static name: C is a static constant.
R(J to 16) --A nonstatic name: J is a signal.
--R is the longest static prefix of R(J to 16).
T(n) --A static name; n is a generic constant.
T(2) --A locally static name."
"

So I think I was right,

regards
Alan

--
Alan Fitch


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy  
View profile  
 More options Feb 7, 10:50 am
Newsgroups: comp.arch.fpga
From: Andy <jonesa...@comcast.net>
Date: Tue, 7 Feb 2012 07:50:02 -0800 (PST)
Local: Tues, Feb 7 2012 10:50 am
Subject: Re: Difference between Xilinx isim and modelsim
On Feb 2, 6:48 pm, Alan Fitch <a...@invalid.invalid> wrote:

I will have to go back and read the definition of LSP. I agree with
your assessment that these are locally static names; the question is
"what is the relation between a locally static name for an element or
slice of an aggregate, and the longest static prefix for  than element
or slice?" It was my understanding that if there is a named aggregate
that contains the object referred to by the locally static name, then
the aggregate is still the LSP, not the locally static name. It likely
has to do with whether events are tracked separately on inidividual
elements of a named aggregate signal, or whether they are only tracked
at the aggregate level.

And I may be entirely wrong...

Thanks for the discussion,

Andy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alan Fitch  
View profile  
 More options Feb 10, 8:10 pm
Newsgroups: comp.arch.fpga
From: Alan Fitch <a...@invalid.invalid>
Date: Sat, 11 Feb 2012 01:10:23 +0000
Local: Fri, Feb 10 2012 8:10 pm
Subject: Re: Difference between Xilinx isim and modelsim
On 07/02/12 15:50, Andy wrote:

The statement I noticed was

"The longest static prefix of a signal name is the name itself, if the
name is a static signal name;"

> And I may be entirely wrong...

and so may I :-)

> Thanks for the discussion,

That's OK, it's sort of fun! I wonder what the original poster thinks...

Alan

--
Alan Fitch


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »