ECE 448 Lab 1 Developing Effective Testbenches

Slides:



Advertisements
Similar presentations
George Mason University ECE 448 – FPGA and ASIC Design with VHDL ECE 448 Lecture 10 Advanced Testbenches.
Advertisements

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
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches.
ECE 448: Spring 12 Lab Midterm Exam Review. Part 1: Detailed discussion of a selected midterm from Spring Part 2: Review & discussion of common.
Data Flow Modeling of Combinational Logic Simple Testbenches
IAY 0600 Digitaalsüsteemide disain Event-Driven Simulation Alexander Sudnitson Tallinn University of Technology.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL George Mason University ECE 448 Lab 1 Developing Effective Testbenches.
CprE / ComS 583 Reconfigurable Computing Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #16 – Introduction.
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.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL VHDL Refresher Lecture 2.
IAY 0600 Digital Systems Design VHDL discussion Verification: Testbenches Alexander Sudnitson Tallinn University of Technology.
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
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.
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)
VHDL Discussion Subprograms IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL VHDL Coding for Synthesis ECE 448 Lecture 12.
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.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
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 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
IAY 0600 Digital Systems Design
Basic Language Concepts
Subject Name: FUNDAMENTALS OF HDL Subject Code: 10EC45
IAY 0600 Digitaalsüsteemide disain
Behavioral Style Combinational Design with VHDL
Verification: Testbenches in Combinational Design
Behavioral Style Combinational Design with VHDL
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
ECE 545 Lecture 10 Advanced Testbenches.
Sequential-Circuit Building Blocks
ECE 448 Lab 1a Developing Effective Testbenches
ECE 434 Advanced Digital System L08
Lecture 4 VHDL Basics Simple Testbenches.
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
IAS 0600 Digital Systems Design
Lecture 3 VHDL Basics Simple Testbenches.
Developing More Advanced Testbenches
ECE 448 Lecture 6 Modeling of Circuits with a Regular Structure Aliases, Constants, Packages Mixing Design Styles ECE 448 – FPGA and ASIC Design with.
ECE 448 Lab 1 Developing Effective Testbenches
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Data Flow Modeling of Combinational Logic
VHDL Discussion Subprograms
Behavioral Modeling of Sequential-Circuit Building Blocks
ECE 448 Lab 1 Developing Effective Testbenches
Sequntial-Circuit Building Blocks
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
VHDL Discussion Subprograms
Data Flow Description of Combinational-Circuit Building Blocks
ECE 448 Lab 1 Developing Effective Testbenches
IAS 0600 Digital Systems Design
Implementing Combinational and Sequential Logic in VHDL
Data Flow Description of Combinational-Circuit Building Blocks
ECE 448 Lecture 4 Modeling of Circuits with a Regular Structure Constants, Aliases, Packages ECE 448 – FPGA and ASIC Design with VHDL.
Developing Effective Testbenches
ECE 545 Lecture 5 Simple Testbenches.
Introduction to VHDL for Synthesis
CprE / ComS 583 Reconfigurable Computing
Sequntial-Circuit Building Blocks
EEL4712 Digital Design (VHDL Tutorial).
(Simple Testbenches & Arithmetic Operations)
Presentation transcript:

ECE 448 Lab 1 Developing Effective Testbenches ECE 448 – FPGA and ASIC Design with VHDL George Mason University

Agenda for today Part 1: Lab Rules Part 2: Installation and Setup of Tools Part 3: Refresher on Testbenches Part 4: Introduction to Lab 1 Part 5: Hands-on Session: Class Exercise

Part 1 Lab Rules ECE 448 – FPGA and ASIC Design with VHDL

Installation and Setup of Tools Part 2 Installation and Setup of Tools ECE 448 – FPGA and ASIC Design with VHDL

Refresher on VHDL Testbenches Part 3 Refresher on VHDL Testbenches ECE 448 – FPGA and ASIC Design with VHDL

Design Under Verification (DUV) Simple Testbench Processes Generating Stimuli Design Under Verification (DUV) Verify simulated outputs with expected output to see if the design behaves according to specification Observed Outputs ECE 448 – FPGA and ASIC Design with VHDL

Testbench Defined Testbench = VHDL entity that applies stimuli (drives the inputs) to the Design Under Verification (DUV) and (optionally) verifies expected outputs. The results can be viewed in a waveform window or written to a file. Since Testbench is written in VHDL, it is not restricted to a single simulation tool (portability). The same Testbench can be easily adapted to test different implementations (i.e., different architectures) of the same design. ECE 448 – FPGA and ASIC Design with VHDL

Possible sources of expected results used for comparison Testbench actual results VHDL Design = ? Representative Inputs Manual Calculations or Reference Software Implementation (C, Java, Matlab ) expected results ECE 448 – FPGA and ASIC Design with VHDL

Test vectors Set of pairs: {Input Values i, Expected Outputs Values i} Input Values 1, Expected Output Values 1 Input Values 2, Expected Output Values 2 …………………………… Input Values N, Expected Output Values N Test vectors can cover either: - all combinations of inputs (for very simple circuits only) - selected representative combinations of inputs (most realistic circuits) ECE 448 – FPGA and ASIC Design with VHDL

Testbench The same testbench can be used to test multiple implementations of the same circuit (multiple architectures) testbench design entity . . . . Architecture 1 Architecture 2 Architecture N ECE 448 – FPGA and ASIC Design with VHDL

Anatomy of a Simple Testbench ENTITY my_entity_tb IS --TB entity has no ports END my_entity_tb; ARCHITECTURE behavioral OF tb IS --Local signals and constants ----------------------------------------------------- BEGIN DUV: entity work.TestComp PORT MAP( -- Instantiations of DUVs ); testSequence: PROCESS -- Input stimuli END PROCESS; END behavioral; Internal signals are from DUT. Main process may be split into main process. I.e. one to drive clk, rst and other for test vectors. Many architectures can be tested by inserting more for DUT:TestComp use entity work.TestComp(archName) statmetns “work” is the name of the library that “TestComp” is being compiled to. The “DUT” tag is required. ECE 448 – FPGA and ASIC Design with VHDL

Testbench for XOR3 (1) LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY xor3_tb IS END xor3_tb; ARCHITECTURE behavioral OF xor3_tb IS -- Stimulus signals - signals mapped to the input and inout ports of tested entity SIGNAL test_vector: STD_LOGIC_VECTOR(2 DOWNTO 0); SIGNAL test_result : STD_LOGIC; ECE 448 – FPGA and ASIC Design with VHDL

Testbench for XOR3 (2) ECE 448 – FPGA and ASIC Design with VHDL BEGIN DUV : entity work.xor3 PORT MAP ( A => test_vector(2), B => test_vector(1), C => test_vector(0), Result => test_result); ); Testing: PROCESS test_vector <= "000"; WAIT FOR 10 ns; test_vector <= "001"; test_vector <= "010"; test_vector <= "011"; test_vector <= "100"; test_vector <= "101"; test_vector <= "110"; test_vector <= "111"; END PROCESS; END behavioral; ECE 448 – FPGA and ASIC Design with VHDL

VHDL Design Styles VHDL Design Styles dataflow structural behavioral Concurrent statements Components and interconnects Sequential statements Testbenches ECE 448 – FPGA and ASIC Design with VHDL

Process without Sensitivity List and its use in Testbenches ECE 448 – FPGA and ASIC Design with VHDL

What is a PROCESS? A process is a sequence of instructions referred to as sequential statements. The keyword PROCESS A process can be given a unique name using an optional LABEL This is followed by the keyword PROCESS The keyword BEGIN is used to indicate the start of the process All statements within the process are executed SEQUENTIALLY. Hence, order of statements is important. A process must end with the keywords END PROCESS. Testing: PROCESS BEGIN test_vector<=“00”; WAIT FOR 10 ns; test_vector<=“01”; test_vector<=“10”; test_vector<=“11”; END PROCESS; ECE 448 – FPGA and ASIC Design with VHDL

Execution of statements in a PROCESS Testing: PROCESS BEGIN test_vector<=“00”; WAIT FOR 10 ns; test_vector<=“01”; test_vector<=“10”; test_vector<=“11”; END PROCESS; The execution of statements continues sequentially till the last statement in the process. After execution of the last statement, the control is again passed to the beginning of the process. Order of execution Program control is passed to the first statement after BEGIN ECE 448 – FPGA and ASIC Design with VHDL

PROCESS with a WAIT Statement The last statement in the PROCESS is a WAIT instead of WAIT FOR 10 ns. This will cause the PROCESS to suspend indefinitely when the WAIT statement is executed. This form of WAIT can be used in a process included in a testbench when all possible combinations of inputs have been tested or a non-periodical signal has to be generated. Testing: PROCESS BEGIN test_vector<=“00”; WAIT FOR 10 ns; test_vector<=“01”; test_vector<=“10”; test_vector<=“11”; WAIT; END PROCESS; Order of execution Program execution stops here ECE 448 – FPGA and ASIC Design with VHDL

WAIT FOR vs. WAIT WAIT FOR: waveform will keep repeating itself forever … 1 2 3 1 2 3 WAIT : waveform will keep its state after the last wait instruction. … ECE 448 – FPGA and ASIC Design with VHDL

Specifying time in VHDL ECE 448 – FPGA and ASIC Design with VHDL

Time values (physical literals) - Examples 7 ns 1 min min 10.65 us 10.65 fs unit of time most commonly used in simulation Numeric value Space (required) Unit of time ECE 448 – FPGA and ASIC Design with VHDL

Units of time Unit Definition Base Unit fs femtoseconds (10-15 seconds) Derived Units ps picoseconds (10-12 seconds) ns nanoseconds (10-9 seconds) us microseconds (10-6 seconds) ms miliseconds (10-3 seconds) sec seconds min minutes (60 seconds) hr hours (3600 seconds) ECE 448 – FPGA and ASIC Design with VHDL

Simple Testbenches ECE 448 – FPGA and ASIC Design with VHDL

Generating selected values of one input SIGNAL test_vector : STD_LOGIC_VECTOR(2 downto 0); BEGIN ....... testing: PROCESS test_vector <= "000"; WAIT FOR 10 ns; test_vector <= "001"; test_vector <= "010"; test_vector <= "011"; test_vector <= "100"; END PROCESS; ........ END behavioral; ECE 448 – FPGA and ASIC Design with VHDL

Generating all values of one input use IEEE.NUMERIC_STD.ALL; SIGNAL test_vector : STD_LOGIC_VECTOR(3 downto 0):="0000"; BEGIN ....... testing: PROCESS WAIT FOR 10 ns; test_vector <= std_logic_vector(unsigned(test_vector) + 1); end process TESTING; ........ END behavioral; ECE 448 – FPGA and ASIC Design with VHDL

Different ways of performing the same operation signal count: unsigned(7 downto 0); You can use: count <= count + “00000001”; or count <= count + 1; ECE 448 – FPGA and ASIC Design with VHDL

Different declarations for the same operator Declarations in the package numeric_std: function “+” ( L: unsigned; R: unsigned) return unsigned; function “+” ( L: unsigned; R: natural) return unsigned; function “+” ( L: natural; R: unsigned) return unsigned; ECE 448 – FPGA and ASIC Design with VHDL

Operator overloading Operator overloading allows different argument types for a given operation (function) The VHDL tools resolve which of these functions to select based on the types of the inputs This selection is transparent to the user as long as the function has been defined for the given argument types. ECE 448 – FPGA and ASIC Design with VHDL

Generating all possible values of two inputs SIGNAL test_ab : STD_LOGIC_VECTOR(1 downto 0); SIGNAL test_sel : STD_LOGIC_VECTOR(1 downto 0); BEGIN ....... double_loop: PROCESS test_ab <="00"; test_sel <="00"; for I in 0 to 3 loop for J in 0 to 3 loop wait for 10 ns; test_ab <= std_logic_vector(unsigned(test_ab) + 1); end loop; test_sel <= std_logic_vector(unsigned(test_sel) + 1); end loop; END PROCESS; ........ END behavioral; ECE 448 – FPGA and ASIC Design with VHDL

Generating periodical signals, such as clocks CONSTANT clk1_period : TIME := 20 ns; CONSTANT clk2_period : TIME := 200 ns; SIGNAL clk1 : STD_LOGIC; SIGNAL clk2 : STD_LOGIC := ‘0’; BEGIN ....... clk1_generator: PROCESS clk1 <= ‘0’; WAIT FOR clk1_period/2; clk1 <= ‘1’; END PROCESS; clk2 <= not clk2 after clk2_period/2; END behavioral; ECE 448 – FPGA and ASIC Design with VHDL

Generating one-time signals, such as resets CONSTANT reset1_width : TIME := 100 ns; CONSTANT reset2_width : TIME := 150 ns; SIGNAL reset1 : STD_LOGIC; SIGNAL reset2 : STD_LOGIC := ‘1’; BEGIN ....... reset1_generator: PROCESS reset1 <= ‘1’; WAIT FOR reset1_width; reset1 <= ‘0’; WAIT; END PROCESS; reset2_generator: PROCESS WAIT FOR reset2_width; reset2 <= ‘0’; END behavioral; ECE 448 – FPGA and ASIC Design with VHDL

Generating one-time signals, such as resets CONSTANT reset3_width : TIME := 200 ns; SIGNAL reset3 : STD_LOGIC; BEGIN ....... reset3 <= ‘1’, ‘0’ after reset3_width; END behavioral; ECE 448 – FPGA and ASIC Design with VHDL

Typical error SIGNAL test_vector : STD_LOGIC_VECTOR(2 downto 0); SIGNAL reset : STD_LOGIC; BEGIN ....... generator1: PROCESS reset <= ‘1’; WAIT FOR 100 ns reset <= ‘0’; test_vector <="000"; WAIT; END PROCESS; generator2: PROCESS WAIT FOR 200 ns test_vector <="001"; WAIT FOR 600 ns test_vector <="011"; END behavioral; ECE 448 – FPGA and ASIC Design with VHDL

Asserts and Reports ECE 448 – FPGA and ASIC Design with VHDL

Assert Assert is a non-synthesizable statement whose purpose is to write out messages on the screen when problems are found during simulation. Depending on the severity of the problem, The simulator is instructed to continue simulation or halt.

Assert - syntax ASSERT condition [REPORT "message“] [SEVERITY severity_level ]; The message is written when the condition is FALSE. Severity_level can be: Note, Warning, Error (default), or Failure.

Assert – Examples (1) assert initial_value <= max_value report "initial value too large" severity error; assert packet_length /= 0 report "empty network packet received" severity warning; assert false report "Initialization complete" severity note;

Report - syntax REPORT "message" [SEVERITY severity_level ]; The message is always written. Severity_level can be: Note, Warning, Error (default), or Failure.

Report - Examples report "Initialization complete"; report "Current time = " & time'image(now); report "Incorrect branch" severity error;

Records and Arrays of Test Vectors in Testbenches ECE 448 – FPGA and ASIC Design with VHDL

Testbench with an Array of Records (1) library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_textio.all; library std; use std.textio.all; entity bcd_to_7seg_tb is end; architecture testbench of bcd_to_7seg_tb is signal bcd: std_logic_vector(3 downto 0); signal seven_seg: std_logic_vector(6 downto 0); constant DUV_DELAY: time := 5 ns; constant TEST_INTERVAL: time := 10 ns; ECE 448 – FPGA and ASIC Design with VHDL

Testbench with an Array of Records (2) type test_data_type is record bcd: std_logic_vector(3 downto 0); seven_seg: std_logic_vector(6 downto 0); end record; type test_data_array_type is array(natural range <>) of test_data_type; ECE 448 – FPGA and ASIC Design with VHDL

Testbench with an Array of Records (3) constant TEST_DATA: test_data_array_type := ( (x"0", "0111111"), (x"1", "0000110"), (x"2", "1011011"), (x"3", "1001111"), (x"4", "1100110"), (x"5", "1101101"), (x"6", "1111101"), (x"7", "0000111"), (x"8", "1111111"), (x"9", "1101111"), (x"a", "0000000"), (x"b", "0000000"), (x"c", "0000000"), (x"d", "0000000"), (x"e", "0000000"), (x"f", "0000000") ); ECE 448 – FPGA and ASIC Design with VHDL

Linear testbench ECE 448 – FPGA and ASIC Design with VHDL

Linear Testbench Testbench (entity) DUV Stimulus Generator + bcd Process entity Stimulus Generator + Response Checker bcd DUV seven_seg ECE 448 – FPGA and ASIC Design with VHDL

Testbench with an Array of Records (4a) begin duv: entity work.bcd_to_7seg port map(bcd => bcd, seven_seg => seven_seg); stimuli_and_checker: process for i in TEST_DATA'range loop bcd <= TEST_DATA(i).bcd; write(debug_line, string'("Testing DUV with input ")); write(debug_line, TEST_DATA(i).bcd); writeline(output, debug_line); wait for DUV_DELAY; ECE 448 – FPGA and ASIC Design with VHDL

Testbench with an Array of Records (5a) if seven_seg /= TEST_DATA(test_vector_index).seven_seg then write(debug_line, string'("Error -- DUV.seven_seg = ")); write(debug_line, seven_seg); write(debug_line, string'(" -- TEST_DATA.seven_seg = ")); write(debug_line, TEST_DATA(test_vector_index).seven_seg); writeline(output, debug_line); report "SIMULATION FAILED" severity FAILURE; end if; wait for TEST_INTERVAL - DUV_DELAY; if seven_seg'stable(TEST_INTERVAL - DUV_DELAY) = false then write(debug_line, string'("DUV.seven_seg is NOT stable")); end loop; ECE 448 – FPGA and ASIC Design with VHDL

Testbench with an Array of Records (6a) report "End of testbench. All tests passed." ; wait; end process; end; ECE 448 – FPGA and ASIC Design with VHDL

Separate stimulus generation from response checking ECE 448 – FPGA and ASIC Design with VHDL

Modular Testbench Testbench (entity) Stimulus Response Generator DUV Process 1 Process 2 Stimulus Generator Response Checker bcd seven_seg DUV Test_vector_index ECE 448 – FPGA and ASIC Design with VHDL

Testbench with an Array of Records (4b) begin duv: entity work.bcd_to_7seg port map(bcd => bcd, seven_seg => seven_seg); stimuli_generator: process variable debug_line: line; for i in TEST_DATA'range loop bcd <= TEST_DATA(i).bcd; test_vector_index <= i; write(debug_line, string'("Testing DUV with input ")); write(debug_line, TEST_DATA(i).bcd); writeline(output, debug_line); wait for TEST_INTERVAL; end loop; report "End of testbench. All tests passed." ; wait; end process; ECE 448 – FPGA and ASIC Design with VHDL

Testbench with an Array of Records (5b) response_checker: process variable debug_line: line; begin wait on test_vector_index; wait for DUV_DELAY; if seven_seg /= TEST_DATA(test_vector_index).seven_seg then write(debug_line, string'("Error -- DUV.seven_seg = ")); write(debug_line, seven_seg); write(debug_line, string'(" -- TEST_DATA.seven_seg = ")); write(debug_line, TEST_DATA(test_vector_index).seven_seg); writeline(output, debug_line); report "SIMULATION FAILED" severity FAILURE; end if; ECE 448 – FPGA and ASIC Design with VHDL

Testbench with an Array of Records (6b) wait for TEST_INTERVAL - DUV_DELAY; if seven_seg'stable(TEST_INTERVAL - DUV_DELAY) = false then write(debug_line, string'("DUV.seven_seg is NOT stable")); writeline(output, debug_line); report "SIMULATION FAILED" severity FAILURE; end if; end process; end; ECE 448 – FPGA and ASIC Design with VHDL

Variables ECE 448 – FPGA and ASIC Design with VHDL

Variables - features Can only be declared within processes and subprograms (functions & procedures) Initial value can be explicitly specified in the declaration When assigned take an assigned value immediately Variable assignments represent the desired behavior, not the structure of the circuit Can be used freely in testbenches Should be avoided, or at least used with caution in a synthesizable code

Variables - Example testing: PROCESS VARIABLE error_cnt: INTEGER := 0; BEGIN FOR i IN 0 to num_vectors-1 LOOP test_operation <= test_vector_table(i).operation; test_a <= test_vector_table(i).a; test_b <= test_vector_table(i).b; WAIT FOR 10 ns; IF test_y /= test_vector_table(i).y THEN error_cnt := error_cnt + 1; END IF; END LOOP; END PROCESS testing;

Developing Effective Testbenches Part 4 Introduction to Lab 1: Developing Effective Testbenches ECE 448 – FPGA and ASIC Design with VHDL

Verifying Combinational Logic Status Monitoring Unit SMU ECE 448 – FPGA and ASIC Design with VHDL

smu Interface X_fibonacci X_binary_palindromic 5 X X_mersenne_prime X_div5 X_fibonacci X_binary_palindromic ECE 448 – FPGA and ASIC Design with VHDL

Ports ECE 448 – FPGA and ASIC Design with VHDL

Discrepencies One of the provided models is correct. The second model contains several discrepancies compared to the specification. These discrepancies may have for example the following forms: The functions of two outputs are swapped A flag is high for values other than those defined in the specification A flag is stuck at 0 or 1, etc. ECE 448 – FPGA and ASIC Design with VHDL

Tasks and Deliverables Write a testbench capable of fully verifying smu, assuming that it acts as a combinational circuit. Write a short report describing all discrepancies between the above specification and the faulty model. Deliverables: VHDL code of the testbench. Waveforms obtained by running your testbench in the Vivado Simulator (in the PDF format) Report describing all discrepancies you have managed to detect. ECE 448 – FPGA and ASIC Design with VHDL

counter Interface rst en clk 5 Q ECE 448 – FPGA and ASIC Design with VHDL

Ports & Operation After reset the output of the counter should be set to zero. Each rising edge of the clock with en=1 should increase the value of the counter by 3 modulo 32. As a result, the counter should oscillate through the sequence: 0, 3, 6, 9, …, 30, 1, 4, 7, 10, ..., 31, 2, 5, 8, 11, …, 29 and then repeat this sequence indefinitely. ECE 448 – FPGA and ASIC Design with VHDL

Discrepencies One of the models is correct. The remaining two models contain discrepancies compared to the specification. These discrepancies may have, for example, the following forms: 1. a different step 2. a different modulus. ECE 448 – FPGA and ASIC Design with VHDL

Tasks and Deliverables Write a testbench capable of fully verifying the counter defined above. Write a short report describing all discrepancies between the above specification and the faulty models. Deliverables: VHDL code of the testbench. Waveforms obtained by running your testbench in the Vivado Simulator (in the PDF format) Report describing all discrepancies you have managed to detect. ECE 448 – FPGA and ASIC Design with VHDL

Part 5 Hands-on Session: Class Exercise ECE 448 – FPGA and ASIC Design with VHDL