Re: R: warning?

Discussion in 'VHDL' started by Ralf Hildebrandt, Sep 4, 2003.

  1. Hi Max!

    Please answer to the posting, do not write a new posting (news thread).


    >>>the following code:

    >>
    >>>global_read: process (reset, reg_en, rd)
    >>>begin
    >>> if reset = '1' then
    >>> ctrl_data_bus <= (others => 'Z'); -- all warnings are here!
    >>> else

    >>
    >>No default assignment for the output signals(s) here. This is the
    >>safest way to assure that you won't get a latch.

    >
    > what do you mean?


    A Latch is a Register, that has an enabling-singal. - Template:

    process(latch_enable,reset,data_in)
    begin
    if (reset='1') then
    latch<='0';
    elsif latch_enable='1') then
    latch<=data_in;
    end if;
    end process;


    Note, that there are conditions, where this "thing" igores the input!
    (if not reset and not latch_enable) -> This is the reason because it is
    a storage element (register).


    For clarity - take a look at pure combinational logic:

    process(switch,reset,data_in1,data_in2)
    begin
    if (reset='1') then
    outp<='0';
    elsif switch='1') then
    outp<=data_in1;
    else outp<=data_in2
    end if;
    end process;

    All possible input-combiations are covered. Everytime the output depends
    directly on the input.

    -> If you write an if / case - clause, where not all possible input
    combinations are covered, you get a latch, otherwise this will be
    combinational logic (or a tri-state-buffer, if the default condition is
    'Z').


    Latches are small and consume low power, but you have to take care, that
    the "latch-enable" is hazard-free and your circuit does not care about
    the fact, that the latch-output "glitches" as long as the latch_eable is
    active.
    FPGAs often do not contain latches. They build latches with
    combinational logic and feedbacks. -> FPGA-synthesis tools warn you, if
    a latch is inferred, because normally you should avoid latches on FPGAs.



    Ralf
    Ralf Hildebrandt, Sep 4, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike Treseler

    Re: Quartus warning in NUMERIC_STD.vhd

    Mike Treseler, Jul 11, 2003, in forum: VHDL
    Replies:
    2
    Views:
    1,843
    Clyde R. Shappee
    Jul 13, 2003
  2. Pete Becker
    Replies:
    0
    Views:
    1,373
    Pete Becker
    Feb 10, 2005
  3. B. Williams

    warning C4267 and warning C4996

    B. Williams, Oct 26, 2006, in forum: C++
    Replies:
    17
    Views:
    2,626
  4. WARNING! Prosoftstore.com is a SCAM! WARNING!

    , Jul 8, 2007, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    314
  5. Julian Mehnle
    Replies:
    17
    Views:
    866
    Julian Mehnle
    May 18, 2006
Loading...

Share This Page