UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 1486

Foundation XVHDL: Using CLB Latches

Description

Which Xilinx architectures support latches in the CLB, and
how should I write my VHDL code in order to properly use
latches?

For information on using Input Latches, please refer to
(Xilinx Solution 2962).

Solution

1

XC4000E Family
-------------
XC4000E devices, like the XC3000 family, do not have
latches available in the internal logic, so latches may be
implemented using gates. However, unlike the XC3000, the
XC4000E also has the option to use RAM to implement latches
without combinatorial loops. XVHDL can infer RAM if an
internal latch is described in the VHDL code. (Note that this
feature is only supported in the Foundation XVHDL (Metamor)
compiler. With Foundation Express, the latch will be created
out of combinatorial gates and feedback.)

See the resolution titled
"Example: Internal Latch" for example VHDL code.

2

XC5200 Family
-------------
XC5200 family devices have latches available in the internal
logic, but no input latches (input latches are replaced with
an input buffer and an internal latch). Latches may either
be inferred or instantiated with XC5200 designs.

See the resolution titled
"Example: Internal Latch" for example VHDL code.

3

Example: Internal Latch
-----------------------
-- This example VHDL code will infer a combinational feedback
-- loop in an XC3000 family device, and should not be used
-- for that architecture.
-- A RAM will be inferred in an XC4000E family device.
-- An internal latch will be inferred in an XC4000EX/XL device.
-- An internal latch will be inferred in an XC5200 device.

library IEEE;
use IEEE.std_logic_1164.all;

entity D_LATCH is
port (GATE, A, B: in std_logic;
Q: out std_logic);
end D_LATCH;

architecture BEHAV of D_LATCH is
signal DATA: std_logic;
begin
DATA <= A and B;
process (GATE, DATA)
begin
if (GATE ='1') then
Q <= DATA;
end if;
end process;
end BEHAV;


4

XC3000 Family
-------------
XC3000 family devices do not have latches available in the
internal logic, but they do have input latches.

For information on using Input Latches, please refer to
(Xilinx Solution 2962).

Attempts at implementing internal latches should be avoided,
as the latch may be implemented with gates, and combinational
loops will result. Combinational loops cause long synthesis
runtimes, and do not have reliable timing characteristics.
D flip-flops should be used instead.

5

XC4000EX/XL
===========

The XC4000EX/XL families do contain latches in the CLBs.
Latches may be inferred by the XVHDL and Foundation Express
compilers.

See the resolutions titled
"Example: Internal Latch" for example VHDL code.

AR# 1486
Date Created 11/07/1996
Last Updated 01/02/2000
Status Archive
Type General Article