EE694v-Verification-Lect6-1- Lecture 6 - Writing Tests A difference if treating the design as a black box or if you have access to internal signals EE762.

Slides:



Advertisements
Similar presentations
VHDL in digital circuit synthesis (tutorial) dr inż. Miron Kłosowski EA 309
Advertisements

Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
EE694v-Verification-Lect6-1- Lecture 6 - Writing Tests A difference if treating the design as a black box or if you have access to internal signals EE762.
L18 – VHDL for other counters and controllers. Other counters  More examples Gray Code counter Controlled counters  Up down counter  Ref: text Unit.
1 H ardware D escription L anguages Basic Input/Output.
VHDL Intro What does VHDL stand for? VHSIC Hardware Description Language VHSIC = Very High Speed Integrated Circuit Developed in 1982 by Govt. to standardize.
ECE C03 Lecture 141 Lecture 14 VHDL Modeling of Sequential Machines Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
EE694v-Verification-Lect5-1- Lecture 5 - Verification Tools Automation improves the efficiency and reliability of the verification process Some tools,
Simple Testbenches Behavioral Modeling of Combinational Logic
1/8/ L24 IEEE Floating Point Basics Copyright Joanne DeGroat, ECE, OSU1 IEEE Floating Point The IEEE Floating Point Standard and execution.
(1) Basic Input and Output © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
Introduction to VHDL (part 2)
Advanced FPGA Based System Design Lecture-9 & 10 VHDL Sequential Code By: Dr Imtiaz Hussain 1.
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches.
IAY 0600 Digitaalsüsteemide disain Event-Driven Simulation Alexander Sudnitson Tallinn University of Technology.
1/8/ L24 IEEE Floating Point Basics Copyright Joanne DeGroat, ECE, OSU1 IEEE Floating Point The IEEE Floating Point Standard and execution.
Design Verification VHDL ET062G & ET063G Lecture 5 Najeem Lawal 2012.
Graduate Computer Architecture I VHDL Structure and Testing Michael Sorensen.
L16 – Testbenches for state machines. VHDL Language Elements  More examples HDL coding of class examples Testbench for example  Testing of examples.
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
VHDL Project I: Introduction to Testbench Design Matthew Murach Slides Available at:
ECE 368 CAD-Based Logic Design Shantanu Dutt Lecture 11 File I/O and Textio in VHDL (courtesy of Karam Chatha, ASU)
EE694v-Verification-Lect10-1- Lect 10 - Stimulus & Response Applying input stimulus to a design Creating clock signals Other waveforms Synchronizing inputs.
VHDL Files & Text IO ECE4623/5623 Computer Hardware Design.
L16 – VHDL for State Machines with binary encoding.
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.
Electrical and Computer Engineering University of Cyprus LAB 1: VHDL.
Introduction to Design Tools COE Example design: ALU Recall that the ALUOp is 4 bits – High-order two bits used to determine operation class (ALUOp(3:2))
1/8/ L24 IEEE Floating Point Basics Copyright Joanne DeGroat, ECE, OSU1 IEEE Floating Point The IEEE Floating Point Standard and execution.
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
L13 – VHDL Language Elements. VHDL Language Elements  Elements needed for FPGA design Types  Basic Types  Resolved Types – special attributes of resolved.
L19 – Resolved Signals. Resolved Signals  What are resolved signals In systems In VHDL Resolution – Isn’t that for resolving conflicts?  Ref: text Unit.
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.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
5-1 Logic System Design I VHDL Design Principles ECGR2181 Reading: Chapter 5.0, 5.1, 5.3 port ( I: in STD_LOGIC_VECTOR (1 to 9); EVEN, ODD: out STD_LOGIC.
EE121 John Wakerly Lecture #17
L20 – Register Set. The 430 Register Set  Not exactly a dual ported register set, but a dual drive register set.  Ref: text Unit 10, 17, 20 9/2/2012.
EE694v-Verification-Lect6-1- Lecture 6 - Writing Tests A difference if treating the design as a black box or if you have access to internal signals EE762.
EE694v - Verification - Lect Lect 12,13,14 – 762 Testbenches Lets look at the EE 762 testbenches Look at stimulus generation techniques Look at response.
IAY 0600 Digital Systems Design Event-Driven Simulation VHDL Discussion Alexander Sudnitson Tallinn University of Technology.
George Mason University Advanced Testbenches Lecture 4.
1/8/ L25 Floating Point Adder Copyright Joanne DeGroat, ECE, OSU1 IEEE Floating Point Adder Using the IEEE Floating Point Standard for an.
ECE 448 – FPGA and ASIC Design with VHDL George Mason University ECE 448 Lab 2 Implementing Combinational Logic in VHDL.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
EE694v - Verification - Lect 12
Basic Language Concepts
Subject Name: FUNDAMENTALS OF HDL Subject Code: 10EC45
IAY 0600 Digitaalsüsteemide disain
Module Goals Introduce structural VHDL constructs Use of components
ECE 434 Advanced Digital System L17
ECE 434 Advanced Digital System L15
The IEEE Floating Point Standard and execution units for it
Peter J. Ashenden The University of Adelaide
CPE/EE 422/522 Advanced Logic Design L11
Copyright Joanne DeGroat, ECE, OSU
L21 – Register Set.
CPE 528: Lecture #3 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
IEEE Floating Point Adder
A floating point multiplier behavior model.
IEEE Floating Point Adder Verification
A floating point multiplier behavior model.
The IEEE Floating Point Standard and execution units for it
ECE 545 Lecture 5 Simple Testbenches.
A floating point multiplier behavior model.
System Controller Approach
EEL4712 Digital Design (VHDL Tutorial).
(Simple Testbenches & Arithmetic Operations)
Presentation transcript:

EE694v-Verification-Lect6-1- Lecture 6 - Writing Tests A difference if treating the design as a black box or if you have access to internal signals EE762 assignment testbenches treat student design as a black box Must know what you are testing Must test corner cases

EE694v-Verification-Lect6-2- Floating Point Multiplier Used as a EE762 assignment Project Assignment #10Floating Pt UnitDUE: Mon Mar 10 In this assignment you will use VHDL to describe the function of a floating point multiplier. The multiplier will accept IEEE Standard 754 single precision inputs and produce single precision output. It will support NaN, ±∞, ±0, normalized numbers, and denormalized numbers. The interface to the design will be:

EE694v-Verification-Lect6-3- The Assignment Inputs will arrive as per the attached specification and test bench. Your design will latch inputs using the latch input signal. Your design will drive the outputs using the drive signal. After driving the output, when the drive signal again goes high, you must drive the bus back to high impedance. Use the component interface given in the testbench STEP 1) Write the initial architecture. In the initial architecture, simply latch the input, route the A input to the output, and correctly drive the C bus. If you get this step working correctly the rest will go much easier. SIMULATE STEP 2) Write a VHDL process to do the floating point multiply. Recommendation : As you start to write your routine handle special cases first. Write the code to handle the NaNs - then simulate and check that you handle the NaNs correctly. Note that ±∞ * ±0 results in a NaN.. Then correctly handle ±∞, and verify through simulation. Then correctly handle ±0 and simulate. Finally do the cases where you actually have to multiply. You can use process(es), concurrent signal assignment, etc., as you would like. You will find the following files in ~degroat/ee762_assign fpmtb.vhdl - the test bench - the component declaration, configuration,and instantiation have been done but you can change them if you want to. fpmvectors - a list of the input stimul

EE694v-Verification-Lect6-4- The Assignment (2) fpm.do - do file for listing and waveform Other NOTES for floating point multiplier. The test bench also uses a concurrent procedure call that reads the testvector file in ~degroat/ee762_assign/fpmvectors. Use of these vectors is hard coded in the concurrent procedure as are the checks and grading routine. This procedure has been compiled and is in the library assign in this directory. To provide the mapping to it you must execute the unix command qhmap assign /user2/faculty/degroat/ee762_assign/assign This provides the logical mapping such that the library clause in the test bench know where library assign is located. This must be done prior to compiling the test bench. The procedure will also do the grading of this assignment.

EE694v-Verification-Lect6-5- Floating Point Standard Single Precision Floating Point Format Value is If e = 255 and f ≠ 0, then v is NaN regardless of s If e = 255 and f = 0, then v = (-1)s ∞ If 0 < e < 255, then v = (-1)s 2e- 127 (1.f) If e = 0 and f ≠ 0, then v = (-1)s (x.f) (denormalized numbers)(x is msb of value stored) If e = 0 and f = 0, then v = (-1)s 0 (zero)

EE694v-Verification-Lect6-6- Other Specifications Inputs are in IEEE 754 Single Precision Results are in IEEE 754 Single Precision Format Unit can latch A and B inputs from parallel busses Must be able to handle both numerical values and special cases –NaNs, ±inif, –±zero, –±normalized numbers, ±denormalized numbers

EE694v-Verification-Lect6-7- What to Check How to test the floating point multiplier for both timing of inputs and outputs and functional operation? Assume you have no knowledge of how design is going to be implemented –But you still know the specifications that it must adhere to.

EE694v-Verification-Lect6-8- The Test Vectors Must test for normal operation and boundary conditions IN GENERAL THE CLASS OF INPUTS ARE: A inputbyB inputNaN±∞±0±Denorm±Norm Denorm * OtherVal = Max Denorm Denorm * OtherVal = Min Norm Rounding using first guard bit Rounding using 1st and 2nd guart bits

EE694v-Verification-Lect6-9- The Inputs – Example 1...NaN NaN Nan NaN INIF Nan NaN INIF Nan NaN Nan NaN Nan NaN Nan NaN Nan NaN Nan NaN Nan NaN Nan NaN / Nan NaN DNORM Nan NaN DNORM Nan INIF NaN NaN

EE694v-Verification-Lect6-10- The Inputs – Example / DNORM small DNORM small NaN NaN INIF INIF INIF INIF

EE694v-Verification-Lect6-11- Applying Inputs to Design Inputs are read from a file and applied to the design WHILE (NOT ENDFILE(test_data)) LOOP --get next input test vector and expected result readline(test_data,cur_line); read(cur_line,aid); read(cur_line,a_test_val); read(cur_line,bid); read(cur_line,b_test_val); readline(test_data,cur_line); read(cur_line,resid);read(cur_line,result_val); std_result_val := To_StdLogicVector(result_val); num_tests := num_tests + 1; -- run through bus cycle to send data to unit aid_sig <= "======", aid after 20 ns; bid_sig <= "======", bid after 20 ns; resid_sig <= "======", resid after 20 ns; -- drive signals on bus aval <= To_StdLogicVector(a_test_val) after 20 ns, HIGHZ after 80 ns; bval <= To_StdLogicVector(b_test_val) after 20 ns, HIGHZ after 80 ns; latch <= '0' after 20 ns, '1' after 70 ns; wait for 100 ns; drive <= '0' after 20 ns, '1' after 80 ns; exp_res <= std_result_val after 20 ns, HIGHZ after 80 ns; wait for 50 ns; ASSERT (C = std_result_val) REPORT "result does not agree with expected result" SEVERITY WARNING; IF (C /= std_result_val) THEN num_errors := num_errors + 1; err_sig <= '1', '0' after 10 ns; END IF; wait for 50 ns; END LOOP;

EE694v-Verification-Lect6-12- The File I/O Declarations First must set up the basic declarations

EE694v-Verification-Lect6-13- File I/O And then must also do the declarations for File I/O Note that the file I/O here uses the 1987 version of the language

Text IO after ‘87 The declaration of the file is the only real change from the 87 standard Now –FILE file_name : TEXT OPEN read_mode IS – “the_file_system_file_name’; –VARIABLE cur_line : LINE; –VARIABLE addr : bit_vector (15 downto 0); –VARIABLE data : bit_vector (7 downto 0); In the code –WHILE (NOT ENDFILE(file_name)) LOOP READLINE (file_name,curline); READ (curline, addr); READ (curline, data); saddr <= addr; sdata <= data; –END LOOP; EE694v-Verification-Lect6-14-

EE694v-Verification-Lect6-15- Checking Results Timing is checked when result is expected on bus and again just prior to bus going back to high impedance. Busses are also checked that they go back to a value of high impedance When results do not match what is expected a signal called error goes to ‘1’ for 10 ns

Use of TEXT IO The TEXT IO procedures and functions are in PACKAGE TEXTIO within LIBRARY STD. So any design entity that wants to do IO using these routines must have a –USE STD.TEXTIO.ALL; –You will find a reference in Navabi, pg 603,604. EE694v-Verification-Lect6-16-

TEXT IO Philosophy The general input/output philosophy of VHDL is one of line orientated operation. For Input you first read the entire line up until –Same for output Then you read the elements off the line. –For the file here the elements were –AID A_FP_NUM BID B_FP_NUM EE694v-Verification-Lect6-17-

Type that can be read/written using TEXT I/O The data types for which support is present –Strings –Bit –Bit_vector –Integer –Read EE694v-Verification-Lect6-18-

Example 1 use std.textio.all; ENTITY textiotest IS END textiotest; ARCHITECTURE first OF textiotest IS FILE test_vecs: TEXT is "fpmvectors"; SIGNAL a,b : bit_vector(31 downto 0); signal aid,bid : string(1 to 6); EE694v-Verification-Lect6-19-

Example 1 (cont) BEGIN --of architecture PROCESS VARIABLE cur_line : LINE; VARIABLE aidv,bidv : string(1 to 6); VARIABLE av,bv : bit_vector(31 downto 0); BEGIN FOR I in 1 to 10 LOOP READLINE (test_vecs, cur_line); READ (cur_line,aidv); aid <= aidv; READ (cur_line,av); a <= av; READ (cur_line,bidv); bid <= bidv; READ (cur_line,bv); b <= bv; WAIT FOR 100 ns; END LOOP; WAIT; END PROCESS; END first; EE694v-Verification-Lect6-20-

Example 2 use std.textio.all; ENTITY textiotest2 IS END textiotest2; ARCHITECTURE first OF textiotest2 IS FILE test_vecs: TEXT is "fpmvectors"; SIGNAL a,b,r : bit_vector(31 downto 0); signal aid,bid,rid : string(1 to 6); BEGIN EE694v-Verification-Lect6-21-

Example 2 (cont) PROCESS VARIABLE cur_line : LINE; VARIABLE aidv,bidv,ridv : string(1 to 6); VARIABLE av,bv,rv : bit_vector(31 downto 0); BEGIN WHILE (NOT ENDFILE(test_vecs)) LOOP READLINE (test_vecs, cur_line); READ (cur_line,aidv); aid <= aidv; READ (cur_line,av); a <= av; READ (cur_line,bidv); bid <= bidv; READ (cur_line,bv); b <= bv; READLINE (test_vecs, cur_line); READ (cur_line,ridv); rid <= ridv; READ (cur_line,rv); r <= rv; WAIT FOR 100 ns; END LOOP; WAIT; END PROCESS; END first; EE694v-Verification-Lect6-22-

Test transactions are in file Locating you test transactions in a file allows for easy addition to the test file as you progress through the verification plan Allows you to incorporate new tests easily based on the results to date. Opens the possibility for very advanced methods –Interative application of tests and test generation. –New tests may be generated given the response to a set test. EE694v-Verification-Lect6-23-