Académique Documents
Professionnel Documents
Culture Documents
October 2003
VHDL to Silicon
Design Flow
VHDL to Silicon...
October 2003
VHDL to Silicon
Design Flow..... Create Project and Select Target Device Create VHDL Source File Enter VHDL code & Syntax Check Create Test Bench & Simulate Synthesis Define Pins Translate, Map & Place and Route device Generate Programming File / Programme device
October 2003 (VLD)
Synthesis What is it ?
Model Translate Circuit
Sy nt he sis
October 2003 (VLD)
Chip
VHDL to Silicon...
October 2003
Enter VHDL Model Check Syntax Synthesize Define Pins Translate & Fit (CPLD) or Translate, Map, Place & Route (FPGA) Generate Programming File
October 2003 (VLD)
VHDL to Silicon
Design Flow..... Create Project and Select Target Device Create VHDL Source File Enter VHDL code & Syntax Check Create Test Bench & Simulate Synthesis Define Pins Translate, Map & Place and Route device Generate Programming File / Programme device
October 2003 (VLD)
VHDL to Silicon...
October 2003
VHDL to Silicon...
October 2003
VHDL to Silicon
Design Flow..... Create Project and Select Target Device 4 Create VHDL Source File 4 Enter VHDL code & Syntax Check Create Test Bench & Simulate Synthesis Define Pins Translate, Map & Place and Route device Generate Programming File / Programme device
October 2003 (VLD)
library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity count9 is Port ( clk : in std_logic; reset : in std_logic; count_ext : out std_logic_vector(3 downto 0); count_carry : out std_logic); end count9; architecture Behavioural of count9 is signal count9 : std_logic_vector(3 downto 0); signal carry9 : std_logic; begin process (reset, clk) begin if reset = '1' then
10
VHDL to Silicon...
October 2003
library IEEE; - - declare libraries use IEEE.STD_LOGIC_1164.ALL; - - allows use of std_logic use IEEE.STD_LOGIC_ARITH.ALL; - - allows one to do sums use IEEE.STD_LOGIC_UNSIGNED.ALL; - - (sometimes needed) entity count9 is - - entity declaration Port ( clk : in std_logic; - - port statement reset : in std_logic; count_ext : out std_logic_vector(3 downto 0); count_carry : out std_logic); end count9; architecture Behavioural of count9 is - - architecture body
signal count9 : std_logic_vector(3 downto 0); - - 'internal wires' signal carry9 : std_logic; begin process (reset, clk) begin if reset = '1' then count9 <= "0000"; October 2003 (VLD)
11
VHDL to Silicon
Design Flow..... Create Project and Select Target Device 4 Create VHDL Source File 4 Enter VHDL code & Syntax Check 4 Create Test Bench & Simulate Synthesis Define Pins Translate, Map & Place and Route device Generate Programming File / Programme device
October 2003 (VLD)
12
VHDL to Silicon...
October 2003
Reset
Clock
Other inputs
13
14
VHDL to Silicon...
October 2003
BEGIN uut: count9 PORT MAP( clk => clk, reset => reset, count_enable => count_enable, count_ext => count_ext, count_carry => count_carry);
15
Test Bench....
ARCHITECTURE behaviour OF testbench IS COMPONENT count9 - - Declare Entity to be PORT( - - Tested as a Component clk : IN std_logic; reset : IN std_logic; count_enable : IN std_logic; count_ext : OUT std_logic_vector(3 downto 0); count_carry : OUT std_logic ); END COMPONENT; SIGNAL clk : std_logic; - - Define Local Signals SIGNAL reset : std_logic; SIGNAL count_enable : std_logic; SIGNAL count_ext : std_logic_vector(3 downto 0); SIGNAL count_carry : std_logic;
October 2003 (VLD)
16
VHDL to Silicon...
October 2003
Test Bench....
SIGNAL clk : std_logic; SIGNAL reset : std_logic; SIGNAL count_enable : std_logic; SIGNAL count_ext : std_logic_vector(3 downto 0); SIGNAL count_carry : std_logic;
BEGIN - - Instantiate Component uut: count9 PORT MAP( clk => clk, reset => reset, count_enable => count_enable, count_ext => count_ext, count_carry => count_carry);
17
Stimulus Waveforms....
setup : PROCESS BEGIN reset <= '0'; wait for 3 ns; reset <= '1'; wait for 3 ns; reset <= '0'; wait; end PROCESS; count_enable <= '1'; -- tie i/p high clock : PROCESS BEGIN for index in 1 to 100 loop clk <= '0'; wait for 20 ns; clk <= '1'; wait for 20 ns; clk <= '0'; end loop; wait; -- will wait forever END PROCESS;
18
VHDL to Silicon...
October 2003
Stimulus Waveforms....
- - Define a reset pulse
3 ns Stay low .....
setup : PROCESS BEGIN reset <= '0'; wait for 3 ns; reset <= '1'; wait for 3 ns; reset <= '0'; wait; end PROCESS; count_enable <= '1';
3 ns
19
Stimulus Waveforms....
clock : PROCESS - - Define a clock BEGIN for index in 1 to 100 loop clk <= '0'; 20 ns wait for 20 ns; Repeat .... clk <= '1'; wait for 20 ns; clk <= '0'; end loop; 20 ns wait; -- will wait forever END PROCESS;
20
10
VHDL to Silicon...
October 2003
VHDL to Silicon
Design Flow..... Create Project and Select Target Device 4 Create VHDL Source File 4 Enter VHDL code & Syntax Check 4 Create Test Bench & Simulate Synthesis Define Pins Translate, Map & Place and Route device Generate Programming File / Programme device
October 2003 (VLD)
21
Simulate....
22
11
VHDL to Silicon...
October 2003
VHDL to Silicon
Design Flow..... Create Project and Select Target Device 4 Create VHDL Source File 4 Enter VHDL code & Syntax Check 4 Create Test Bench & Simulate 4 Synthesis Define Pins Translate, Map & Place and Route device Generate Programming File / Programme device
October 2003 (VLD)
23
6 6 F F F F F F
October 2003 (VLD)
6 6
24
12
VHDL to Silicon...
October 2003
Push Switches
3x 6 Block of LEDs
25
26
13
VHDL to Silicon...
October 2003
VHDL to Silicon
Design Flow..... Create Project and Select Target Device 4 Create VHDL Source File 4 Enter VHDL code & Syntax Check 4 Create Test Bench & Simulate 4 Synthesis 4 Define Pins 4 Translate, Map & Place and Route device Generate Programming File / Programme device
October 2003 (VLD)
27
28
14
VHDL to Silicon...
October 2003
VHDL to Silicon
Design Flow..... Create Project and Select Target Device 4 Create VHDL Source File 4 Enter VHDL code & Syntax Check 4 Create Test Bench & Simulate 4 Synthesis 4 Define Pins 4 Translate, Map & Place and Route device 4 Generate Programming File / Programme device
October 2003 (VLD)
29
Programme device....
30
15
VHDL to Silicon...
October 2003
Clk Reset
Counter
Count
4
Wave_Out
Wave
Count_P ulse
Mode
31
32
16
VHDL to Silicon...
October 2003
Architecture Counter....
33
34
17
VHDL to Silicon...
October 2003
35
36
18
VHDL to Silicon...
October 2003
37
38
19
VHDL to Silicon...
October 2003
39
40
20
VHDL to Silicon...
October 2003
VHDL to Silicon
2. Select Device & Package
3. write VHDL
4. Simulate
41
VHDL to Silicon
5. Synthesis 6. Define Pin-outs
8. Program Device
42
21
VHDL to Silicon...
October 2003
43
Synthesis is the process of Translating a VHDL model into Logic Functions The Logic is "Inferred" from the VHDL. The VHDL Constructs and Syntax used to describe the required behaviour effects the resulting Logic that is generated. The Architecture of the Target Device effects how the Logic is mapped onto the actual gates on the Target Device.
October 2003 (VLD)
44
22
VHDL to Silicon...
October 2003
If Then Else
45
If Then Else
Multiplexor
46
23
VHDL to Silicon...
October 2003
47
48
24
VHDL to Silicon...
October 2003
Xor - Process
49
Xor - Function
50
25
VHDL to Silicon...
October 2003
Full Adder
51
Full Adder
52
26
VHDL to Silicon...
October 2003
Decoder
53
Decoder
54
27
VHDL to Silicon...
October 2003
Up Counter
55
Up Counter
56
28
VHDL to Silicon...
October 2003
Up Down Counter
57
Up Down Counter
58
29
VHDL to Silicon...
October 2003
59
CPLD
FPGA
60
30