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