VHDL 6 Testbench - VHDL Simulation Testbench Design The...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
VHDL Simulation Testbench Design
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The Test Bench Concept
Background image of page 2
Project simulations 1. Behavioral/RTL – verify functionality Model in VHDL/Verilog Drive with “force file” or testbench 2. Post-Synthesis Synthesized gate-level VHDL/Verilog netlist Technology-specific VHDL/Verilog gate-level models Optional SDF file (from synthesis) for timing Drive with same force file/testbench as in (1) 3. Post-Layout Netlist back-annotated with extracted capacitances for accurate delays
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Example: modulo-7 counter VHDL Model (modulo7.vhd) Create working library: vlib work Map the lib name: vmap work work Compile: vcom modulo7.vhd Simulate: vsim modulo7(behave) Simulation-control Modelsim “macro” file (mod7.do) Testbench (VHDL or Verilog) ModelSim results List(table) and/or Waveform (logic analyzer)
Background image of page 4
-- modulo7.vhd parallel-load modulo-7 synchronous counter library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity modulo7 is port(reset,count,load,clk: in std_logic; I: in std_logic_vector(2 downto 0); Q: out std_logic_vector(2 downto 0)); end modulo7; architecture Behave of modulo7 is signal Q_s: unsigned(2 downto 0); begin process (reset,clk) begin if (reset='0') then Q_s <= "000"; elsif (clk'event and (clk='1')) then if (count = '1') and (Q_s = "110") then Q_s <= "000"; elsif (count='1') then Q_s <= Q_s + 1; elsif (load='1') then Q_s <= UNSIGNED(I); end if; end if; end process; Q<=STD_LOGIC_VECTOR(Q_s); end Behave;
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Modelsim “do” file: mod7.do add wave /clk /reset /count /load add wave -hex /I /Q add list /clk /reset /count /load add list -hex /I /Q force /clk 0 0 ns, 1 20 ns -repeat 40 ns force /I 101 0 ns, 011 400 ns force /reset 1 0 ns, 0 10 ns, 1 20 ns force /count 0 0 ns, 1 90 ns, 0 490 ns force /load 0 0 ns, 1 30 ns, 0 70 ns run 600 ns
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/23/2011 for the course ELEC 5250 taught by Professor Staff during the Fall '08 term at Auburn University.

Page1 / 19

VHDL 6 Testbench - VHDL Simulation Testbench Design The...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online