Conception methodology of some architecture is put in application with practical works in VHDL on FPGA. Microcontrollers are studied and their used emphasized in the course with the help of laboratories. Laboratories are associated with main topics.
It is our job to turn this simple stub into an actual test sequence that will exercise our design. The first step in the design of the test bench is to create a continuous clocking signal for the master clock (MCLK). VHDL provides a simple way to create repetitive signal. This is done in the following code fragments.
VHDL code for Matrix Multiplication 6. VHDL code for Switch Tail Ring Counter 7. VHDL code for digital alarm clock on FPGA 8. VHDL code for 8-bit Comparator 9. How to load a text file into FPGA using VHDL 10. VHDL code for D Flip Flop 11. VHDL code for Full Adder 12. PWM Generator in VHDL with Variable Duty Cycle 13. VHDL code for ALU 14.
The test bench creates stimulus for the ripple-carry adder to exercise the logic and store the results to a file. In order to compile this code correctly, all three source files need to be in the same directory and compiled into Library Work. See the Modelsim tutorial for beginners for detail.
In this second part of our video you will learn how to write a synchronous circuit test bench. You will learn how to use external signal generators to create stimulus for your circuit. In this example we're using our previous code that we've written our counter which is our device under test, and we have our data input bus and our Q output bus.
A test bench function drives values onto signals connected to input ports of an HDL design under test and receives signal values from the output ports of the module. The following figure shows how a MATLAB function wraps around and communicates with the HDL simulator during a test bench simulation session.
The name of the game is to increase your efficiency. It is possible to directly write a test bench in inline VHDL but above simple designs inline VHDL starts to become complex so you will probably add a low level routine to handle the interfacing to your design and then specify the tests and results at a higher level of extraction.
A Test Bench does not need any inputs and outputs so just click OK. Click Yes, the text fixture file is added to the simulation sources: Open up the nearly created comb.tb file and add the following VHDL statements to instantiate a copy of the comb module and create a simple test bench.