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

Reply

VHDL - Functional VHDL Simulation Problem with Altera dual clock fifo

 
Thread Tools Search this Thread
Old 04-09-2005, 11:43 AM   #1
Default Functional VHDL Simulation Problem with Altera dual clock fifo


Altera Modelsim 5.8e

I'm new to modelsim and try to make a functional simulation for a
project with an
Altera Fifo (dcfifo).

I get the following simulation error:
last value in fifo cannot be read, rdempty flag toggles when last
value is tried to read.

the problem only occures, if a signal is used as the rdclk,
if the rdclk is taken directly from the entity port clk_i everything
works fine.

...
...
begin

txf_rdclk <= clk_i; -- problem if txf_rdclk is used in port map

txfifo : dcfifo0
PORT MAP (
wrclk => wrclk_i,
rdreq => txf_rdreq,
aclr => rst_i,
rdclk => txf_rdclk, -- problem if txf_rdclk is used in port map
-- rdclk => clk_i, -- this works fine
wrreq => wrreq_i,
data => data_i,
rdfull => txf_rdfull,
rdempty => txf_rdempty,
wrusedw => txf_wrusedw,
wrfull => txf_wrfull_o,
wrempty => txf_wrempty,
q => txf_q,
rdusedw => txf_rdusedw
);
...
...

why does i have problems with the signal txf_rdclk ?


Thomas Fischer
  Reply With Quote
Old 04-09-2005, 01:24 PM   #2
Thomas Fischer
 
Posts: n/a
Default Re: Functional VHDL Simulation Problem with Altera dual clock fifo
Thomas Fischer schrieb:
> Altera Modelsim 5.8e
>
> I'm new to modelsim and try to make a functional simulation for a
> project with an
> Altera Fifo (dcfifo).
>
> I get the following simulation error:
> last value in fifo cannot be read, rdempty flag toggles when last
> value is tried to read.
>
> the problem only occures, if a signal is used as the rdclk,
> if the rdclk is taken directly from the entity port clk_i everything
> works fine.
>
> ..
> ..
> begin
>
> txf_rdclk <= clk_i; -- problem if txf_rdclk is used in port map
>
> txfifo : dcfifo0
> PORT MAP (
> wrclk => wrclk_i,
> rdreq => txf_rdreq,
> aclr => rst_i,
> rdclk => txf_rdclk, -- problem if txf_rdclk is used in port map
> -- rdclk => clk_i, -- this works fine
> wrreq => wrreq_i,
> data => data_i,
> rdfull => txf_rdfull,
> rdempty => txf_rdempty,
> wrusedw => txf_wrusedw,
> wrfull => txf_wrfull_o,
> wrempty => txf_wrempty,
> q => txf_q,
> rdusedw => txf_rdusedw
> );
> ..
> ..
>
> why does i have problems with the signal txf_rdclk ?


I'm still learning, seems to be some sort of "delta cycle race condition"


Thomas Fischer
  Reply With Quote
Old 04-11-2005, 02:29 PM   #3
Paul Uiterlinden
 
Posts: n/a
Default Re: Functional VHDL Simulation Problem with Altera dual clock fifo
Thomas Fischer wrote:
> Thomas Fischer schrieb:
>
>> the problem only occures, if a signal is used as the rdclk, if the
>> rdclk is taken directly from the entity port clk_i everything
>> works fine.

>
> I'm still learning, seems to be some sort of "delta cycle race condition"


It is not a race condition in the sense of the definition of a race
condition. The outcome is determinitic because it does not depend of the
order of evaluation of processes (including signal assignments).

Each signal assignment adds a delta cycle delay. By adding a signal
assignment in the clock, the receiving block is clocked one delta cycle
later. The effect of this is that it clocks in the new signal values
(after the clock edge) of sending blocks running on the original clock
(without the extra signal assgnment).

In general it is a bad idea to put signal assignments in clocks. Or you
must make sure that all clocks derived from a common clock source
contain the same number of signal assignments.

Some other solutions are discussed in
http://verificationguild.com/modules...ewtopic&p=1765

Paul.


Paul Uiterlinden
  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
Post-Route Simulation does not give output for the first clock cycle Options velocityreviews Software 0 04-17-2007 05:47 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