FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > VHDL

VHDL comp.lang.vhdl newsgroup / Usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-23-2006, 11:58 AM
Guest
 
Posts: n/a
Default LOAD on asynchronous RESET

Hi all,

I would like lo load a signal on only an asynchronous RESET.

I wrote that :

process(LOAD)
begin
if LOAD='1' then
sig_2 <= sig_1;
end if;
end process;

But on RTL viewer I see a DFF with LOAD on the CLOCK pin, I don't want
that

Second I wrote :

process (LOAD,CLK)
begin
if LOAD='1' then
sig_2 <= sig_1;
elsif rising_edge (CLK) then
sig_3 <= (others=>'0');
end if;
end process;

Now the LOAD signal is on the ENABLE of the DFF and it inffers a LATCH
!

And I don't want to write that :

process (RST,CLK)
begin
if RST ='1' then
sig_2 <= (others=>'0');
elsif rising_edge (CLK) then
if LOAD ='1' then
sig_2 <= sig_1;
end if;
end if,
end process;

Because on timing analysis, my sig_2 signal is on the path under the
CLK signal and I don't want that
I tried to say to Quartus that sig_1 => sig_2 is a multicyle timing but
I have warning because sig_2 go to a filter
with one multiplier and one adder (combinational)

So I write that

process (RST,LOAD)
begin
if RST='1' then
sig_2 <= (others=>'0');
elsif rising_edge(LOAD) then
sig_2 <= sig_1;
end if;
end process;

And defined LOAD like a slowly clock... and I don't have warning but I
don't find that very clean..

Do you have suggestions ?

thanks

Reply With Quote
  #2 (permalink)  
Old 11-23-2006, 02:35 PM
Pascal Peyremorte
Guest
 
Posts: n/a
Default Re: LOAD on asynchronous RESET

Hello,

If you want to load sig2 only to one async event, cannot-you use a concurrent
statement ?

if LOAD='1' then
sig_2 <= sig_1;
end if;
(out of any "process" section)

Pascal
Reply With Quote
  #3 (permalink)  
Old 11-23-2006, 02:59 PM
Guest
 
Posts: n/a
Default Re: LOAD on asynchronous RESET


Pascal Peyremorte a écrit :

> Hello,
>
> If you want to load sig2 only to one async event, cannot-you use a concurrent
> statement ?
>
> if LOAD='1' then
> sig_2 <= sig_1;
> end if;
> (out of any "process" section)
>
> Pascal


The if.. endif if only for process not for combinatorial

Reply With Quote
  #4 (permalink)  
Old 11-23-2006, 04:34 PM
Al
Guest
 
Posts: n/a
Default Re: LOAD on asynchronous RESET

[email protected] wrote:
> Pascal Peyremorte a écrit :
>
>
>>Hello,
>>
>>If you want to load sig2 only to one async event, cannot-you use a concurrent
>>statement ?
>>
>> if LOAD='1' then
>> sig_2 <= sig_1;
>> end if;
>>(out of any "process" section)
>>
>>Pascal

>
>
> The if.. endif if only for process not for combinatorial
>

sorry Patrick, I don't understand what does "for process not for
combinatorial" mean.
Processes can either instantiate combinatorial or sequential logic,
depending the way you write them.
In your case I don't quite understand if you need a latch or a DFF with
an asynchronous load. In the first case you can simply write:

process (load)
begin
if load = '1' then
sig2 <= sig1;
else
sig2 <= sig2;
end if;
end process;

in the second case you need a clocked process:

process (clk, load)
begin
if load = '1' then
sig2 <= sig1;
elsif rising_edge (clk) then
-- do what you want here
end if;
end process;

> Because on timing analysis, my sig_2 signal is on the path under the
> CLK signal and I don't want that


What do you mean by that?

Al

--
Alessandro Basili
CERN, PH/UGC
Hardware Designer
Reply With Quote
  #5 (permalink)  
Old 11-23-2006, 05:29 PM
Ralf Hildebrandt
Guest
 
Posts: n/a
Default Re: LOAD on asynchronous RESET

[email protected] schrieb:

> I would like lo load a signal on only an asynchronous RESET.


Load into what? A Latch a Flipflop?


> process(LOAD)
> begin
> if LOAD='1' then
> sig_2 <= sig_1;
> end if;
> end process;


A latch - modelled with a serious mistake: sig_1 has to be in the
sensitivity list.

> But on RTL viewer I see a DFF with LOAD on the CLOCK pin


Really? Usually synthesis tools ignore the sensitivity list and will
infer a latch - and will output two warnings:
1) latch inferred for sig_2
2) incomplete sensitivity list


> process (LOAD,CLK)
> begin
> if LOAD='1' then
> sig_2 <= sig_1;
> elsif rising_edge (CLK) then
> sig_3 <= (others=>'0');
> end if;
> end process;
>
> Now the LOAD signal is on the ENABLE of the DFF and it inffers a LATCH


No - this is a flipflop. A D-Flipflop with asynchronous set and reset.
Why both? Well, reset or set depends on the signal sig_1.

Again: The sensitivity list is incomplete: sig_1 is missing.


> And I don't want to write that :
>
> process (RST,CLK)
> begin
> if RST ='1' then
> sig_2 <= (others=>'0');
> elsif rising_edge (CLK) then
> if LOAD ='1' then
> sig_2 <= sig_1;
> end if;
> end if,
> end process;


A D-Flipflop with asynchronous reset, synchronously loaded if LOAD='1'.


> process (RST,LOAD)
> begin
> if RST='1' then
> sig_2 <= (others=>'0');
> elsif rising_edge(LOAD) then
> sig_2 <= sig_1;
> end if;
> end process;


A D-Flipflop again - this time clocked with LOAD instead of clk. No
synchronous load condition defined inside this process.


> Do you have suggestions ?


Yes: Think about what you want. You want to store some data if LOAD is
'1'. Anything else?
Are latches suitable for your design? (And if yes, is sig_1 stable, when
LOAD becomes inactive?)
Is LOAD a signal without hazards? If not, you can't use latches or a
flipflop clocked with LOAD. Then you need a D-FF clocked with CLK and
synchronously loaded with LOAD.

Ralf
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
aysnchronous counter with asynchronous reset Dkthechamp Verilog 3 04-30-2008 03:12 PM
THE BEHAVIOR CODE FOR 24-BITUP/DOWN COUNTER WITH PARALLEL LOAD AND ASYNCHRONOUS RESET coldplay112 VHDL 2 09-25-2006 12:06 PM
Asynchronous reset timing problem David FPGA 4 10-04-2004 09:24 PM
Re: Asynchronous RESET? Peter Alfke FPGA 0 07-01-2003 05:53 PM


All times are GMT +1. The time now is 02:12 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved