Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 18 trang
THÔNG TIN TÀI LIỆU
Nội dung
VHDLforefficienttestbenches www.appliedVHDL.com Applied VHDL Training Course, Dr Fearghal Morgan, V2007.1 p1 VHDLforEfficientTestbenches using muxAndDecEx1 combinational logic example Dr Fearghal Morgan VHDLforefficienttestbenches www.appliedVHDL.com Applied VHDL Training Course, Dr Fearghal Morgan, V2007.1 p2 VHDLForEfficientTestbenches (TBs) Learning outcomes On completion of this module, you should be able to : Apply stimulus using Explicit stimulus application using single process detailed in muxAndDecEx1 multiple processes course material For loop Array FileIO Generate message output during simulation Presentation also introduces VHDL functions and their definition in the IEEE VHDL libraries VHDL Variables VHDLforefficienttestbenches www.appliedVHDL.com Applied VHDL Training Course, Dr Fearghal Morgan, V2007.1 p3 muxAndDecEx1 Testbench & Simulation Visualise the test bench structure muxAndDecEx1 decOut decOut VHDLforefficienttestbenches www.appliedVHDL.com Applied VHDL Training Course, Dr Fearghal Morgan, V2007.1 p4 Basic muxAndDecEx1 Testbench VHDLforefficienttestbenches www.appliedVHDL.com Applied VHDL Training Course, Dr Fearghal Morgan, V2007.1 p5 Basic muxAndDecEx1 Testbench Simulation Waveform VHDLforefficienttestbenches www.appliedVHDL.com Applied VHDL Training Course, Dr Fearghal Morgan, V2007.1 p6 Alternative Stimulus Generation Various efficientVHDL behavioural modelling language constructs are available to generate stimulus to test a VHDL model, e.g., • for loop • defining stimulus array & indexing the array to apply stimulus • reading stimulus data directly from a file Messages can also be added to testbench Remember that this type of testbench / behavioural VHDL code is not intended for logic synthesis, and normally cannot be synthesised ! Refer to muxAndDecEx1 lab files muxAndDecEx1_TB.vhd for these examples of testbench coding VHDLforefficienttestbenches www.appliedVHDL.com Applied VHDL Training Course, Dr Fearghal Morgan, V2007.1 p7 Stimulus Generation using for loop muxAndDecEx1 example : use for loop to create 8 stimulus sets Convert integer loop index to a signal vector using VHDL function. VHDLforefficienttestbenches www.appliedVHDL.com Applied VHDL Training Course, Dr Fearghal Morgan, V2007.1 p8 for loop Syntax Use Edit > language templates > VHDL > for loop statement For statement is synthesisable as long as the loop has a fixed range For statement is commonly used in testbench (behavioural) models VHDLforefficienttestbenches www.appliedVHDL.com Applied VHDL Training Course, Dr Fearghal Morgan, V2007.1 p9 Functions in VHDL Functions (and procedures) are used widely in VHDL Conversion functions are common for example: to convert from integer type (easily manipulated using for loops) to a vector of signals, use the function CONV_STD_LOGIC_VECTOR(integerName, vectorWidth) This function converts integer value to vector of width vectorWidth Many conversion functions exist Functions can reduce VHDL model complexity VHDLforefficienttestbenches www.appliedVHDL.com Applied VHDL Training Course, Dr Fearghal Morgan, V2007.1 p10 Conversion Functions in VHDL Use Edit > language templates > VHDL > conversion functions Use <= here vector size [...]... inModelsim VHDL for efficient testbenches www.appliedVHDL.com Applied VHDL Training Course, Dr Fearghal Morgan, V2007.1 p12 Conversion Functions in VHDL Use Edit > language templates > VHDL > conversion functions Function defined in arith library Function overloading : Specific function used depends on argument types Library package must be referenced in VHDL library description VHDL for efficient testbenches. .. later in the course VHDL for efficient testbenches www.appliedVHDL.com Applied VHDL Training Course, Dr Fearghal Morgan, V2007.1 p17 VHDL For Efficient Testbenches Learning outcomes (recap) On completion of this module, you should be able to : Apply stimulus using Explicit stimulus application using single process detailed in muxAndDecEx1 multiple processes course material For loop Array FileIO... Functions are applied using a VHDL assignment, e.g., . structure muxAndDecEx1 decOut decOut VHDL for efficient testbenches www.appliedVHDL.com Applied VHDL Training Course, Dr Fearghal Morgan, V2007.1 p4 Basic muxAndDecEx1 Testbench VHDL for efficient testbenches www.appliedVHDL.com Applied. logic example Dr Fearghal Morgan VHDL for efficient testbenches www.appliedVHDL.com Applied VHDL Training Course, Dr Fearghal Morgan, V2007.1 p2 VHDL For Efficient Testbenches (TBs) Learning outcomes. VHDL for efficient testbenches www.appliedVHDL.com Applied VHDL Training Course, Dr Fearghal Morgan, V2007.1 p1 VHDL for Efficient Testbenches using muxAndDecEx1