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

Reply

VHDL - asynchronous reset, simulator doesn't support

 
Thread Tools Search this Thread
Old 09-02-2007, 01:11 PM   #1
Default asynchronous reset, simulator doesn't support


Hello there,

Here is a challenge for all of us.

I have a simulator (proof from alliance) that doesn't support
asynchronous reset. Alliance can work with using only one clock (and
not any synchronous set or reset).

Nevertheless I want to simulation asynchronous reset dff from its
behavioral description.

What would you recommend me to change in my .vhd file in terms of
asynchronous reset ?


-- D flip flop with asynchronous reset
library IEEE;
use IEEE.std_logic_1164.all;

entity dff_asynchrone is
port (
data, re_set, cp : IN std_logic ;
q : OUT std_logic
);
end dff_asynchrone;

architecture behave of dff_asynchrone is
begin
process(cp,re_set)
begin
if re_set = '0' then
q <= '0';
elsif (cp='1' and cp'event) then
q <= data;
end if;
end process;
end behave;



Clunixchit
  Reply With Quote
Old 09-02-2007, 09:22 PM   #2
KJ
 
Posts: n/a
Default Re: asynchronous reset, simulator doesn't support

"Clunixchit" <> wrote in message
news: ps.com...
> Hello there,
>
> Here is a challenge for all of us.
>
> I have a simulator (proof from alliance) that doesn't support
> asynchronous reset. Alliance can work with using only one clock (and
> not any synchronous set or reset).
>
> Nevertheless I want to simulation asynchronous reset dff from its
> behavioral description.
>
> What would you recommend me to change in my .vhd file in terms of
> asynchronous reset ?


I'd recommend keeping the .vhd file and changing your simulator. For a
simulator to 'not support asynchronous resets' really means that it doesn't
support 'if/elsif/end if' VHDL statements. Why waste time with such a tool?

KJ




KJ
  Reply With Quote
Old 09-02-2007, 11:02 PM   #3
David Binnie
 
Posts: n/a
Default Re: asynchronous reset, simulator doesn't support
It may be the target device, some devices do not support asynchronous
reset..


"Clunixchit" <> wrote in message
news: ps.com...
> Hello there,
>
> Here is a challenge for all of us.
>
> I have a simulator (proof from alliance) that doesn't support
> asynchronous reset. Alliance can work with using only one clock (and
> not any synchronous set or reset).
>
> Nevertheless I want to simulation asynchronous reset dff from its
> behavioral description.
>
> What would you recommend me to change in my .vhd file in terms of
> asynchronous reset ?
>
>
> -- D flip flop with asynchronous reset
> library IEEE;
> use IEEE.std_logic_1164.all;
>
> entity dff_asynchrone is
> port (
> data, re_set, cp : IN std_logic ;
> q : OUT std_logic
> );
> end dff_asynchrone;
>
> architecture behave of dff_asynchrone is
> begin
> process(cp,re_set)
> begin
> if re_set = '0' then
> q <= '0';
> elsif (cp='1' and cp'event) then
> q <= data;
> end if;
> end process;
> end behave;
>





David Binnie
  Reply With Quote
Old 09-03-2007, 09:22 AM   #4
Clunixchit
 
Posts: n/a
Default Re: asynchronous reset, simulator doesn't support
On Sep 2, 10:22 pm, "KJ" wrote:
> I'd recommend keeping the .vhd file and changing your simulator. For a
> simulator to 'not support asynchronous resets' really means that it doesn't
> support 'if/elsif/end if' VHDL statements. Why waste time with such a tool?
>
> KJ


I've modelsim and ghdl at my disposal as alternative simulation tools.
However it does support 'if/elsif/end if' VHDL statements, but not
asynchronous reset. The counter (see code below) does simulate
successfully.

My question wasn't about time, but about possible ways of coding
asynchronous reset.


entity count1 is
port ( clk, clear : in bit;
qc : out integer range 0 to 255
);
end count1;

architecture behavioral of count1 is
begin
process (clk)
variable cnt : integer range 0 to 255;
begin
if (clk'EVENT and clk= '1') then
if clear = '0' then
cnt := 0;
else
cnt := cnt +1;
end if;
end if;
qc <= cnt;
end process;
end behavioral;



Clunixchit
  Reply With Quote
Old 09-03-2007, 03:05 PM   #5
KJ
 
Posts: n/a
Default Re: asynchronous reset, simulator doesn't support

"Clunixchit" <> wrote in message
news: ups.com...
> On Sep 2, 10:22 pm, "KJ" wrote:
>> I'd recommend keeping the .vhd file and changing your simulator. For a
>> simulator to 'not support asynchronous resets' really means that it
>> doesn't
>> support 'if/elsif/end if' VHDL statements. Why waste time with such a
>> tool?
>>
>> KJ

>
> I've modelsim and ghdl at my disposal as alternative simulation tools.
> However it does support 'if/elsif/end if' VHDL statements, but not
> asynchronous reset.


Both of those tools do support 'asynchronous reset' (aka if/elsif/end if)

> The counter (see code below) does simulate
> successfully.
>
> My question wasn't about time, but about possible ways of coding
> asynchronous reset.
>


Your original post (entity dff_asynchrone) is one correct way of coding an
asynchronous reset. Why do you think it.they do not simulate correctly?

KJ




KJ
  Reply With Quote
Old 09-03-2007, 08:53 PM   #6
Clunixchit
 
Posts: n/a
Default Re: asynchronous reset, simulator doesn't support
On Sep 3, 4:05 pm, "KJ" wrote:

> Both of those tools do support 'asynchronous reset' (aka if/elsif/end if)

I was referring to alliance here. it doesn't support 'asynchronous
reset'. but it does support the counter (see code in previous emails)


> Your original post (entity dff_asynchrone) is one correct way of coding an
> asynchronous reset. Why do you think it.they do not simulate correctly?


Again I meant alliance doesn't simulate correctly. Modelsim and ghdl
works.
It fails with:
Compiling 'dff_asynchrone' ...
VHDL : Error - bad usage of the 'stable' attribut
*** Compilation aborted...
make: *** [PROOF] Error 255

By referring Modelsim and ghdl above, I meant that I can use either
Modelsim or ghdl for my simulations. But it's curiosity on for
alliance that drove me to start this topic here.

regards,
Chitlesh



Clunixchit
  Reply With Quote
Old 09-03-2007, 09:49 PM   #7
KJ
 
Posts: n/a
Default Re: asynchronous reset, simulator doesn't support

"Clunixchit" <> wrote in message
news: ps.com...
> On Sep 3, 4:05 pm, "KJ" wrote:
>
>> Both of those tools do support 'asynchronous reset' (aka if/elsif/end if)

> I was referring to alliance here. it doesn't support 'asynchronous
> reset'. but it does support the counter (see code in previous emails)
>
>
>> Your original post (entity dff_asynchrone) is one correct way of coding
>> an
>> asynchronous reset. Why do you think it.they do not simulate correctly?

>
> Again I meant alliance doesn't simulate correctly. Modelsim and ghdl
> works.
> It fails with:
> Compiling 'dff_asynchrone' ...
> VHDL : Error - bad usage of the 'stable' attribut
> *** Compilation aborted...
> make: *** [PROOF] Error 255
>
> By referring Modelsim and ghdl above, I meant that I can use either
> Modelsim or ghdl for my simulations. But it's curiosity on for
> alliance that drove me to start this topic here.
>
> regards,
> Chitlesh


Then re-read my original post about not using such a simulator. Next open a
service request against Alliance and tell them you won't be using their
lame tool.

KJ




KJ
  Reply With Quote
Old 09-04-2007, 09:28 AM   #8
HT-Lab
 
Posts: n/a
Default Re: asynchronous reset, simulator doesn't support

"Clunixchit" <> wrote in message
news: ps.com...
> On Sep 3, 4:05 pm, "KJ" wrote:
>
>> Both of those tools do support 'asynchronous reset' (aka if/elsif/end if)

> I was referring to alliance here. it doesn't support 'asynchronous
> reset'. but it does support the counter (see code in previous emails)
>
>
>> Your original post (entity dff_asynchrone) is one correct way of coding
>> an
>> asynchronous reset. Why do you think it.they do not simulate correctly?

>
> Again I meant alliance doesn't simulate correctly. Modelsim and ghdl
> works.
> It fails with:
> Compiling 'dff_asynchrone' ...
> VHDL : Error - bad usage of the 'stable' attribut
> *** Compilation aborted...
> make: *** [PROOF] Error 255
>
> By referring Modelsim and ghdl above, I meant that I can use either
> Modelsim or ghdl for my simulations. But it's curiosity on for
> alliance that drove me to start this topic here.


I would agree with KJ, this looks like a serious bug in the Alliance VHDL
parser, it complains about the 'stable attribute but you are using 'event?

I actually question this bug since if the parser can't handle 'event then
probably most designs will fail, do you get the same error with rising_edge?

Hans
www.ht-lab.com


>
> regards,
> Chitlesh
>





HT-Lab
  Reply With Quote
Old 09-04-2007, 02:14 PM   #9
Andy
 
Posts: n/a
Default Re: asynchronous reset, simulator doesn't support
On Sep 4, 3:28 am, "HT-Lab" <han...@ht-lab.com> wrote:
> "Clunixchit" <chitl...@gmail.com> wrote in message
>
> news: ps.com...
>
>
>
> > On Sep 3, 4:05 pm, "KJ" wrote:

>
> >> Both of those tools do support 'asynchronous reset' (aka if/elsif/end if)

> > I was referring to alliance here. it doesn't support 'asynchronous
> > reset'. but it does support the counter (see code in previous emails)

>
> >> Your original post (entity dff_asynchrone) is one correct way of coding
> >> an
> >> asynchronous reset. Why do you think it.they do not simulate correctly?

>
> > Again I meant alliance doesn't simulate correctly. Modelsim and ghdl
> > works.
> > It fails with:
> > Compiling 'dff_asynchrone' ...
> > VHDL : Error - bad usage of the 'stable' attribut
> > *** Compilation aborted...
> > make: *** [PROOF] Error 255

>
> > By referring Modelsim and ghdl above, I meant that I can use either
> > Modelsim or ghdl for my simulations. But it's curiosity on for
> > alliance that drove me to start this topic here.

>
> I would agree with KJ, this looks like a serious bug in the Alliance VHDL
> parser, it complains about the 'stable attribute but you are using 'event?
>
> I actually question this bug since if the parser can't handle 'event then
> probably most designs will fail, do you get the same error with rising_edge?
>
> Hanswww.ht-lab.com
>
>
>
> > regards,
> > Chitlesh


Perhaps this tool is a cycle (clock) based simulator? And maybe the
parser only accepts rising_edge() or falling_edge() calls for clock
edge "detection". Change your "(cp = '1' and cp'event)" to
"rising_edge(cp)". IINM, 'stable can be a more general case of the
opposite of 'event, and could be being used for it.

If this is really a true cycle based simulator, you're pretty much out
of luck trying to code an asynchronous reset, the simulator can
probably only handle things happening at the next clock edge. You
could convert to synchronous reset:

process(cp)
begin
if rising_edge(cp) then
if re_set = '0' then
q <= '0';
else
q <= data;
end if;
end if;
end process;

Andy



Andy
  Reply With Quote
Old 09-05-2007, 10:37 PM   #10
Clunixchit
 
Posts: n/a
Default Re: asynchronous reset, simulator doesn't support
On Sep 4, 10:28 am, "HT-Lab" wrote:
> I actually question this bug since if the parser can't handle 'event then
> probably most designs will fail, do you get the same error with rising_edge?


Yes I still have the error.

On Sep 4, 3:14 pm, Andy wrote:
> If this is really a true cycle based simulator, you're pretty much out
> of luck trying to code an asynchronous reset, the simulator can
> probably only handle things happening at the next clock edge. You
> could convert to synchronous reset:


So be it. As for a synchronous reset, the simulator does the job.

Thanks for your help.

Chitlesh




Clunixchit
  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
How to Reset / Recover Forgotten Windows NT / 2000 / XP / 2003 Administrator Password wskaihd Software 2 11-17-2009 02:01 AM
How to know if a processor support support "execution protection"? dandalion A+ Certification 5 04-17-2006 04:56 PM
New DVD standard gains support. Allan DVD Video 0 01-18-2004 08:20 PM
OT Humour: Tech Support Fees Rick Blythin A+ Certification 0 07-31-2003 06:55 AM




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