{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Writing_Test_Bench - Click to edit Master subtitle style...

Info icon This preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Click to edit Master subtitle style Spr 2011, Apr 1 5270/6270 Guest Lecture by M. Allani Introduction to writing a Test Bench in HDL Mridula Allani 11
Image of page 1

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

View Full Document Right Arrow Icon
Spr 2011, Apr 1 5270/6270 Guest Lecture by M. Allani What is A Test Bench? Test Bench is a program that verifies the functional correctness of the hardware design. l The test bench program checks whether the hardware model does what it is supposed to do and is not doing what it is not supposed to do. 22
Image of page 2
Spr 2011, Apr 1 5270/6270 Guest Lecture by M. Allani Main Functions of a Test Bench Generate stimulus for testing the hardware block. l Apply the stimulus. l Compare the generated outputs against the expected outputs. Generating Input Stimuli Design Under Test (DUT) Comparing Generated Outputs and Expected Outputs 33
Image of page 3

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

View Full Document Right Arrow Icon
Spr 2011, Apr 1 5270/6270 Guest Lecture by M. Allani Generating Stimulus Vectors Vectors can be generated within the test bench program or generated elsewhere and supplied to the test bench program as an input file. l Vectors can also be stored in a table within the test bench program. 44
Image of page 4
Spr 2011, Apr 1 5270/6270 Guest Lecture by M. Allani Typical VHDL Test Bench entity test_bench is end; architecture tb_behavior of test_bench is component design_under_test port ( list-of-ports-their-types- and-modes); end component; Local-signal-declarations; begin CLOCK: process Generate-stimulus-vectors-using- behavioral-constructs; Apply-to-entity-under-test; DUT: design_under_test port map ( port-associations ); Monitor-output-values-and-compare- with-expected-values; if (no errors) report "Testbench completed!" severity note; else report "Something wrong!" severity error; end if; end tb_behavior; 55
Image of page 5

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

View Full Document Right Arrow Icon
Spr 2011, Apr 1 5270/6270 Guest Lecture by M. Allani Defining a Vector Table in VHDL Example, constant no_of_bits : INTEGER := 4; constant no_of_vectors : INTEGER := 5; type table_type is array (1 to no_of_vectors ) of my_vector (1 to no_of_bits ); constant vector_period: time := 100 ns; constant input_vectors: table_type := ("1001", "1000", "0010", "0000", "0110"); signal inputs: my_vector (1 to no_of_bits ); 66
Image of page 6
Spr 2011, Apr 1 5270/6270 Guest Lecture by M. Allani Reading vectors from a
Image of page 7

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

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern