-- FILE NAME: SN54LS112_TB.vhd -- -- DISCLAIMER -- -- This code is the sole property of the Institute for Technology -- Development (ITD), Jackson, Mississippi, and is distributed for -- the purpose of providing examples of VHDL models written to -- modeling standards. This code may not be used for commercial -- purposes, and may not be redistributed without permission from -- the Institute for Technology Development. ITD assumes no -- responsibility for errors, omissions, uses made, or decisions -- based on its use. No warranties, expressed or implied, are given. -- -- ------------------------------------------------------------------ library DEVICE ; use DEVICE.Waves_Device.all ; use DEVICE.Waves_Objects.all ; library WORK ; use WORK.wgenerator_SN54LS112.all ; library EVENTS ; use EVENTS.Waves_Utilities.all ; architecture TEST_BENCH of SN54LS112_TB is component DUT port (q1, qb1, q2, qb2 : out logic_mv ; clk1, j1, k1, pr1, clr1, clk2, j2, k2, pr2, clr2 : in logic_mv ) ; end component ; for all : DUT use entity SN54LS112.SN54LS112 (BEHAVIORAL) ; -- Input and Output traffic of DUT signal T : logic_mv_vector(TEST_PIN_RANGE) ; -- Output file for results of signal monitor constant In_File_Name : string := "SN54LS112_in.dat" ; constant Out_File_Name : string := "SN54LS112_out.dat" ; signal Compare : boolean := TRUE ; constant How_To_Report : Comparison_Format := Do_Assertion ; constant Assertion_Level : Severity_Level := Warning ; signal SMatch : Waves_Match_List(TEST_PIN_RANGE) := (others => TRUE) ; -- Connection to WAVES dataset signal Connect : WAVES_PORT_LIST (TEST_PIN_RANGE) ; subtype COMPARE_PIN_RANGE is INTEGER range Test_Pins'Pos(TP_q1) + 1 to Test_Pins'Pos(TP_qb2) + 1; begin -- Call the waveform generator (i.e., the WAVES dataset) process begin SN54LS112_TEST(Connect) ; wait ; end process ; -- Instantiate the Device under test Under_Test : DUT port map ( T(Test_Pins'Pos(TP_q1) + 1), T(Test_Pins'Pos(TP_qb1) + 1), T(Test_Pins'Pos(TP_q2) + 1), T(Test_Pins'Pos(TP_qb2) + 1), Integer_to_logic_mv(Connect(Test_Pins'Pos(TP_clk1) + 1).DATA), Integer_to_logic_mv(Connect(Test_Pins'Pos(TP_j1) + 1).DATA), Integer_to_logic_mv(Connect(Test_Pins'Pos(TP_k1) + 1).DATA), Integer_to_logic_mv(Connect(Test_Pins'Pos(TP_pr1) + 1).DATA), Integer_to_logic_mv(Connect(Test_Pins'Pos(TP_clr1) + 1).DATA), Integer_to_logic_mv(Connect(Test_Pins'Pos(TP_clk2) + 1).DATA), Integer_to_logic_mv(Connect(Test_Pins'Pos(TP_j2) + 1).DATA), Integer_to_logic_mv(Connect(Test_Pins'Pos(TP_k2) + 1).DATA), Integer_to_logic_mv(Connect(Test_Pins'Pos(TP_pr2) + 1).DATA), Integer_to_logic_mv(Connect(Test_Pins'Pos(TP_clr2) + 1).DATA) ) ; -- Collect all signals (inputs and output of DUT) into signal T Collect_Inputs: for I in Test_Pins'Pos(TP_clk1) + 1 to Test_Pins'Pos(TP_clr2) + 1 generate T(I) <= Integer_to_logic_mv(Connect(I).DATA) ; end generate Collect_Inputs ; Signal_Traffic : Signal_Monitor(Out_File_Name, T) ; Gen_Comparator: for I in COMPARE_PIN_RANGE generate Comparator : Check_response( I, Response => T(I), Prediction => Connect(I), Compare => Compare, How_To_Report => How_To_Report, Assertion_Level => Assertion_Level, Match => SMatch(I) ) ; -- Convert the boolean signals of match into character values -- which take up less space in signal reports end generate Gen_Comparator ; end TEST_BENCH ;