Académique Documents
Professionnel Documents
Culture Documents
26/2/2015
Xilinx FPGA
Configurable
Logic
Blocks
Block RAMs
Block RAMs
I/O
Blocks
Block
RAMs
a
b
c
d
e
clock
clock enable
set/reset
4-input
LUT
y
mux
flip-flop
q
Functional simulation
entity RC5_core is
port(
clock, reset, encr_decr: in std_logic;
data_input: in std_logic_vector(31 downto 0);
data_output: out std_logic_vector(31 downto 0);
out_full: in std_logic;
key_input: in std_logic_vector(31 downto 0);
key_read: out std_logic;
);
end AES_core;
Synthesis
Post-synthesis simulation
Configuration
On chip testing
Logic Synthesis
VHDL description
architecture MLU_DATAFLOW of MLU is
signal A1:STD_LOGIC;
signal B1:STD_LOGIC;
signal Y1:STD_LOGIC;
signal MUX_0, MUX_1, MUX_2, MUX_3: STD_LOGIC;
begin
A1<=A when (NEG_A='0') else
not A;
B1<=B when (NEG_B='0') else
not B;
Y<=Y1 when (NEG_Y='0') else
not Y1;
MUX_0<=A1 and B1;
MUX_1<=A1 or B1;
MUX_2<=A1 xor B1;
MUX_3<=A1 xnor B1;
with (L1 & L0) select
Y1<=MUX_0 when "00",
MUX_1 when "01",
MUX_2 when "10",
MUX_3 when others;
end MLU_DATAFLOW;
Circuit netlist
Mapping
LUT0
LUT4
LUT1
FF1
LUT5
LUT2
FF2
LUT3
Placing
FPGA
CLB SLICES
Routing
Programmable Connections
FPGA
VHDL
MHL
26/2/2015
VHDL
VHSIC (Very High Speed Integrated Circuit)
Hardware Description Language
Entity Declaration
Entity Declaration describes the interface of the component,
Entity name
Port names
Port type
ENTITY nand_gate IS
PORT(
a
: IN STD_LOGIC;
b
: IN STD_LOGIC;
z
: OUT STD_LOGIC
);
END nand_gate;
Reserved words
Semicolon
No Semicolon
ENTITY entity_name IS
PORT (
port_name : signal_mode signal_type;
port_name : signal_mode signal_type;
.
port_name : signal_mode signal_type);
END entity_name;
Architecture
Describes an implementation of a design entity.
Architecture example:
Library declarations
Library declaration
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY nand_gate IS
PORT(
a
: IN STD_LOGIC;
b
: IN STD_LOGIC;
z
: OUT STD_LOGIC);
END nand_gate;
ARCHITECTURE model OF nand_gate IS
BEGIN
z <= a NAND b;
END model;
LIBRARY library_name;
USE library_name.package_name.package_parts;
Meaning
High Impedance
Don't Care
Structural VHDL
I1
I2
COMPONENT xor2 IS
PORT(
I1 : IN STD_LOGIC;
I2 : IN STD_LOGIC;
Y : OUT STD_LOGIC
);
END COMPONENT;
BEGIN
U1: xor2 PORT MAP (I1 => A,
I2 => B,
Y => U1_OUT);
U2: xor2 PORT MAP (I1 => U1_OUT,
I2 => C,
Y => Result);
END structural;
Y
XOR2
A
B
C
XOR3
Result
U1_OUT
A
B
C
XOR3
RESULT
COMPONENT xor2 IS
PORT(
I1 : IN STD_LOGIC;
I2 : IN STD_LOGIC;
Y : OUT STD_LOGIC
);
END COMPONENT;
U1: xor2 PORT MAP (I1 => A,
I2 => B,
Y => U1_OUT);
For Generate
Statement
);
);
);
Value N
Value N-1
0
1
0
1
0
1
Value 2
Value 1
Condition N-1
Condition 2
Condition 1
Target Signal
When - Else
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Mux_4X1
Port ( sel
a :
b :
c :
d :
y :
end test;
is
: in STD_LOGIC_VECTOR (1 downto 0);
in STD_LOGIC;
in STD_LOGIC;
in STD_LOGIC;
in STD_LOGIC;
out STD_LOGIC);
end Behavioral;
When - Else
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Mux_4X1
Port ( sel
a :
b :
c :
d :
y :
end test;
is
: in STD_LOGIC_VECTOR (1 downto 0);
in STD_LOGIC;
in STD_LOGIC;
in STD_LOGIC;
in STD_LOGIC;
out STD_LOGIC);
end Behavioral;
When - Else
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Mux_4X1
Port ( sel
a :
b :
c :
d :
y :
end test;
is
: in STD_LOGIC_VECTOR (1 downto 0);
in STD_LOGIC;
in STD_LOGIC;
in STD_LOGIC;
in STD_LOGIC;
out STD_LOGIC);
Begin
Y <=
end Behavioral;
HA1: half_adder
port map ( x => x,
y => y,
s => hs,
c => hc);
HA2: half_adder
port map ( x => hs,
y => z,
s => s,
c => tc);
c <= tc or hc;
end struc_dataflow_3;
Sites
www.xilinx.com
www.digilentinc.com