CMPUT 329 - Computer Organization and Architecture II 1 CMPUT329 - Fall 2003 Topic 6: Testbenches Paras Mehta and José Nelson Amaral.

Slides:



Advertisements
Similar presentations
VHDL Lecture 1 Megan Peck EECS 443 Spring 08.
Advertisements

L18 – VHDL for other counters and controllers. Other counters  More examples Gray Code counter Controlled counters  Up down counter  Ref: text Unit.
History TTL-logic PAL (Programmable Array Logic)
Arbitrary Waveform Discussion 5.5 Example 34.
Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
George Mason University ECE 448 – FPGA and ASIC Design with VHDL ECE 448 Lecture 10 Advanced Testbenches.
6/27/20061 Sequence Detectors Lecture Notes – Lab 5 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a.
6/12/20151 Sequence Detectors Lecture Notes – Lab 4 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a.
Kazi Fall 2006 EEGN 4941 EEGN-494 HDL Design Principles for VLSI/FPGAs Khurram Kazi Some of the slides were taken from K Gaj’s lecture slides from GMU’s.
Simple Testbenches Behavioral Modeling of Combinational Logic
Package with 4-valued logic Signal Attributes Assertion Data Flow description.
1 Lecture 11 Chap 13: Test Benches Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Design Verification VHDL ET062G & ET063G Lecture 5 Najeem Lawal 2012.
Graduate Computer Architecture I VHDL Structure and Testing Michael Sorensen.
VHDL Project I: Introduction to Testbench Design Matthew Murach Slides Available at:
Digital System Verification. VERIFICATION OUTLINE Purpose of Verification –Verification effort and cost Verification Tools –Linting tools –Code Coverage.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.
Main Project : Simple Processor Mini-Project : 3-bit binary counter (using 7400 series) Memory By Oluwayomi B. Adamo.
George Mason University ECE 545 Lecture 7 Advanced Testbenches.
George Mason University ECE 545 – Introduction to VHDL Variables, Functions, Memory, File I/O ECE 545 Lecture 7.
1 ECE 545 – Introduction to VHDL Dataflow Modeling of Combinational Logic Simple Testbenches ECE 656. Lecture 2.
Copyright(c) 1996 W. B. Ligon III1 Getting Started with VHDL VHDL code is composed of a number of entities Entities describe the interface of the component.
IAY 0600 Digital Systems Design VHDL discussion Verification: Testbenches Alexander Sudnitson Tallinn University of Technology.
Modern VLSI Design 4e: Chapter 8 Copyright  2008 Wayne Wolf Topics VHDL register-transfer modeling: –basics using traffic light controller; –synthesis.
Topic 3: VHDL José Nelson Amaral Paul Berube Paras Mehta
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
Reconfigurable Computing - VHDL - Types John Morris Chung-Ang University The University of Auckland.
Hardware Description Languages Digital Logic Design Instructor: Kasım Sinan YILDIRIM.
15-Dec-15EE5141 Chapter 4 Sequential Statements ä Variable assignment statement ä Signal assignment statement ä If statement ä Case statement ä Loop statement.
George Mason University Simple Testbenches ECE 545 Lecture 4.
Assignment write a short notes on 1.Manufacturing Testing. 2.Functional Testing. 3.Files and Text I/O. 4.Differentiate the cpld and fpga architecture.
VHDL Discussion Sequential Sytems. Memory Elements. Registers. Counters IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology.
1 Part III: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
Data Storage VHDL ET062G & ET063G Lecture 4 Najeem Lawal 2012.
CEC 220 Digital Circuit Design VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13.
55:032 - Intro. to Digital DesignPage 1 VHDL and Processes Defining Sequential Circuit Behavior.
IAY 0600 Digital Systems Design VHDL discussion Verification: Testbenches Alexander Sudnitson Tallinn University of Technology.
CWRU EECS 318 EECS 318 CAD Computer Aided Design LECTURE Simulator 2: Textio, Wait, Clocks, and Test Benches Instructor: Francis G. Wolff
George Mason University Advanced Testbenches Lecture 4.
ECE 448 Lab 1 Developing Effective Testbenches
ECE 448 – FPGA and ASIC Design with VHDL George Mason University ECE 448 Lab 2 Implementing Combinational Logic in VHDL.
CDA 4253 FPGA System Design VHDL Testbench Development Hao Zheng Comp. Sci & Eng USF.
1 - CPRE 583 (Reconfigurable Computing): VHDL overview 1 Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 2: 8/26/2011 (VHDL Overview.
IAY 0600 Digital Systems Design
Sequential statements (1) process
Basic Language Concepts
Main Project : Simple Processor Mini-Project : Vending Machine Memory
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code.
B e h a v i o r a l to R T L Coding
Maj Jeffrey Falkinburg Room 2E46E
Custom Designed Integrated Circuits
ECE 545 Lecture 10 Advanced Testbenches.
ECE 448 Lab 1a Developing Effective Testbenches
RTL Style در RTL مدار ترتيبي به دو بخش (تركيبي و عناصر حافظه) تقسيم مي شود. مي توان براي هر بخش يك پروسس نوشت يا براي هر دو فقط يك پروسس نوشت. مرتضي صاحب.
ECE 448 Lab 1 Developing Effective Testbenches
CPE 528: Lecture #5 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
Founded in Silicon Valley in 1984
ECE 448 Lab 1 Developing Effective Testbenches
Developing Effective Testbenches
ECE 545 Lecture 5 Simple Testbenches.
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
Sequntial-Circuit Building Blocks
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
ECE 448 Lab 1 Developing Effective Testbenches
EEL4712 Digital Design (VHDL Tutorial).
(Simple Testbenches & Arithmetic Operations)
EEL4712 Digital Design (Midterm 1 Review).
Presentation transcript:

CMPUT Computer Organization and Architecture II 1 CMPUT329 - Fall 2003 Topic 6: Testbenches Paras Mehta and José Nelson Amaral

CMPUT Computer Organization and Architecture II 2 Why Use Testbenches? ● Manually Driven Simulation ● specify inputs and observe outputs ● advantage ● allows testing without downloading to device ● disadvantage ● can only test a few combinations of input

CMPUT Computer Organization and Architecture II 3 Why Use Testbenches? ● Testbenches ● a programmed thorough test of design ● advantages ● test design without downloading to board ● can program a test of all inputs as well automatically check expected behaviour ● disadvantages ● cannot test all functionality (e.g. keyboard) ● cannot determine/resolve timing issues

CMPUT Computer Organization and Architecture II 4 Testbench Structure ● Testbench is self-contained ● Internal signals are directly manipulated ● Elements: ● entity contains no ports ● declare, instantiate testing components ● process for supplying input ● process for checking output

CMPUT Computer Organization and Architecture II 5 Testbench Testbench Structure Unit Under Test clk reset input_1 input_2 input_n... output_1 output_2 output_n... Manipulated by Testbench Checked by Testbench

CMPUT Computer Organization and Architecture II 6 architecture behaviour of testbench is signal clk, rst : std_logic; signal done : boolean; constant clk_period : time := 5 ns; begin end architecture; done <= true when condition else false;... clk <= '0' when rst = '1' else not clk after clk_period when not done else '0';... rst <= '1', '0' after time; Condition indicates simulation is over. e.g: time period has elapsed iterations completed end of input file reached Testbench Structure ● Basic signals are clock, reset, and termination: Clk: not active during reset oscillates until done Reset: brief pulse for reset of all signals in the design

CMPUT Computer Organization and Architecture II 7 Manipulating Input ● Input set as normal signal assignment ALU operand1 operand2 alu_result opcode input: process() begin operand1 <= “000”; operand2 <= “101”; opcode <= “100”; end process;

CMPUT Computer Organization and Architecture II 8 assert condition report debug-string severity note | warning | error | failure; Syntax: Checking Output ● Output read as a normal signal read ● Checking done with assert-report-severity

CMPUT Computer Organization and Architecture II 9 Checking Output ● Output read as a normal signal read ● Checking done with assert-report-severity verify: process(output) begin if clk'event and clk = '0' then if (opcode = AND_OP) assert (alu_result = operand1 and operand2) report “Output is incorrect” severity error; end if; end process; Falling edge allows signal to be checked

CMPUT Computer Organization and Architecture II 10 File Input ● Using assert to check behaviour implies writing correct behaviour twice ● Instead, write expected behaviour in file: Testbench Unit Under Test Assert Expected Output Output

CMPUT Computer Organization and Architecture II 11 File Input ● Require file and line variables: InputProcess: process (clk) file input : text is “input.txt”; variable line_in: line; variable op1_in, op2_in : std_logic_vector(3 downto 0); begin if clk'event and clk='1' then if not endfile(input) then readline(input, line_in); read(line_in, op1_in); read(line_in, op2_in); operand1 <= op1_in; operand2 <= op2_in; end if; end process; std.textio.all; ieee.std_logic_textio.all; read(line, variable) hread(line, variable) readline(file, line)

CMPUT Computer Organization and Architecture II 12 File Input ● Require file and line variables: CheckProcess: process (clkt) file output1 : text is “output.txt”; variable line_in: line; variable o_exp : std_logic; begin if clk'event and clk='0' then if not endfile(output1) then readline(output1, line_in); read(line_in, o_exp); assert (o_exp = alu_result) report “Output incorrect” severity error; end if; end process; ALU operand1 operand2 alu_result opcode

CMPUT Computer Organization and Architecture II 13 Debug Output ● Lines can also be used to write to std_out: CheckProcess: process(clk) variable line_out: line; begin if clk'event and clk = '1' then write(line_out, string'(“At time ”)); write(line_out, now); write(line_out, string'(“, output is ”)); write(line_out, alu_result; writeline(output, line_out); end if; end process; ALU operand1 operand2 alu_result opcode