--FILENAME: wgenerator_SN54S11.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. -- -- This is a modified IEEE WAVES package. It was written specifically -- to apply test vectors to the model being tested. -- -- ------------------------------------------------------------------ library STD_PACK ; use STD_PACK.BASICDEFS.all ; use STD.Textio.all ; library FRAMES ; use FRAMES.Waves_Frames.all ; library DEVICE ; use DEVICE.Waves_Device.all ; use DEVICE.Waves_Objects.all ; library EVENTS ; use EVENTS.Waves_Utilities.all ; package body wgenerator_SN54S11 is constant O_Pins : PINSET := NEW_PINSET (( TP_y1, TP_y2, TP_y3 )) ; constant I_Pins : PINSET := ALL_PINS and not O_PINS ; constant EMPTY_EVENT : INTEGER := -1 ; procedure SN54S11_Test( signal Connect : inout Waves_Port_List) is constant Period : Time := 100 ns ; constant Uncertainty_Pct : real := 0.05 ; constant TDelay : EVENT_TIME := ETIME (Period - Uncertainty_Pct * Period); constant FSA : FRAME_SET_ARRAY := ADD_FRAME_SET_ARRAY ( NEW_FRAME_SET_ARRAY ( I_PINS, INPUT_FRAMES), NEW_FRAME_SET_ARRAY ( O_PINS, STROBED_OUTPUT_FRAMES(TDelay)) ); variable TD1 : TIME_DATA := NEW_TIME_DATA ( FSA ) ; variable T1 : WAVE_TIMING := (Period, TD1) ; -- Order of signals: -- -- (y1, y2, y3, -- a1, b1, c1, a2, b2, c2, a3, b3, c3) -- variable WAVEFORM : WAVE_SLICE_LIST (1 to 16) := ( ( "UUU" & "UUUUUUUUU", T1), ( "XXX" & "XXXXXXXXX", T1), ( "XXX" & "WWWWWWWWW", T1), ( "XXX" & "ZZZZZZZZZ", T1), ( "000" & "000000000", T1), ( "000" & "001001001", T1), ( "000" & "010010010", T1), ( "000" & "011011011", T1), ( "000" & "100100100", T1), ( "000" & "101101101", T1), ( "000" & "110110110", T1), ( "111" & "111111111", T1), ( "000" & "X00X00X00", T1), ( "XXX" & "XX1XX1XX1", T1), ( "000" & "LLLLLLLLL", T1), ( "111" & "HHHHHHHHH", T1) ) ; begin APPLY_LIST(CONNECT, WAVEFORM) ; end ; procedure SN54S11_Test_From_File( signal Connect : out Waves_Port_List ; Input_File_Name : String) is ---------------------------------------------------------------------- -- The following declarations are used when only the PERIOD field is -- read from the external file. ---------------------------------------------------------------------- constant FSA : FRAME_SET_ARRAY := ADD_FRAME_SET_ARRAY ( NEW_FRAME_SET_ARRAY (I_PINS, INPUT_FRAMES), NEW_FRAME_SET_ARRAY (O_PINS, OUTPUT_FRAMES) ); variable PERIOD_TD : TIME_DATA := NEW_TIME_DATA (FSA) ; ---------------------------------------------------------------------- -- The following declarations are used when only the INDEX field is -- read from the external file. ---------------------------------------------------------------------- constant Period1 : Time := 100 ns ; constant Uncertainty_Pct1 : real := 0.05 ; constant TDelay1 : EVENT_TIME := ETIME (Period1 - (Uncertainty_Pct1 * Period1)); constant FSA1 : FRAME_SET_ARRAY := ADD_FRAME_SET_ARRAY ( NEW_FRAME_SET_ARRAY ( I_PINS, INPUT_FRAMES), NEW_FRAME_SET_ARRAY ( O_PINS, STROBED_OUTPUT_FRAMES(TDelay1)) ); variable INDEX_TD1 : TIME_DATA := NEW_TIME_DATA ( FSA1 ) ; constant Period2 : Time := 1 ns ; constant Uncertainty_Pct2 : real := 0.05 ; constant TDelay2 : EVENT_TIME := ETIME (Period2 - Uncertainty_Pct2 * Period2); constant FSA2 : FRAME_SET_ARRAY := ADD_FRAME_SET_ARRAY ( NEW_FRAME_SET_ARRAY ( I_PINS, INPUT_FRAMES), NEW_FRAME_SET_ARRAY ( O_PINS, STROBED_OUTPUT_FRAMES(TDelay2)) ); variable INDEX_TD2 : TIME_DATA := NEW_TIME_DATA ( FSA2 ) ; variable SN54S11_TIMING : WAVE_TIMING_LIST (1 to 2) := ( (Period1, INDEX_TD1), (Period2, INDEX_TD2) ) ; ---------------------------------------------------------------------- -- The following declarations are used when both the PERIOD field and -- the INDEX field are read from the external file. The uncertainty -- periods are the same as those used when only the INDEX field is set. ---------------------------------------------------------------------- variable SN54S11_UNCERTAINTY : TIME_DATA_LIST (1 to 2) := ( INDEX_TD1, INDEX_TD2 ) ; ---------------------------------------------------------------------- -- The following declarations are used when neither the PERIOD field -- nor the INDEX field is read from the external file. ---------------------------------------------------------------------- constant Default_Period : Time := 100 ns ; constant Uncertainty_Pct : real := 0.05 ; constant Default_TDelay : EVENT_TIME := ETIME (Default_Period - Uncertainty_Pct * Default_Period); constant Default_FSA : FRAME_SET_ARRAY := ADD_FRAME_SET_ARRAY ( NEW_FRAME_SET_ARRAY ( I_PINS, INPUT_FRAMES), NEW_FRAME_SET_ARRAY ( O_PINS, STROBED_OUTPUT_FRAMES(Default_TDelay)) ); variable TD2 : TIME_DATA := NEW_TIME_DATA ( Default_FSA ) ; variable DEFAULT_TIMING : WAVE_TIMING := (Default_Period, TD2) ; --------------------------------------------------------------------- file Input_File : Text is in Input_File_Name ; variable SN54S11_FILE_SLICE : FILE_SLICE ; variable WAVEFORM : WAVE_SLICE ; variable use_period_and_index : BOOLEAN := FALSE; variable use_period : BOOLEAN := FALSE; variable use_index : BOOLEAN := FALSE; begin while not SN54S11_FILE_SLICE.END_OF_FILE loop READ_FILE_SLICE(Input_File, SN54S11_FILE_SLICE); if (SN54S11_FILE_SLICE.PERIOD_SET = TRUE) then if (SN54S11_FILE_SLICE.INDEX_SET = TRUE) then use_period_and_index := TRUE; use_period := FALSE; use_index := FALSE; else use_period := TRUE; use_period_and_index := FALSE; use_index := FALSE; end if; elsif (SN54S11_FILE_SLICE.INDEX_SET = TRUE) then use_index := TRUE; use_period_and_index := FALSE; use_period := FALSE; end if; if (use_period_and_index = TRUE) then assert SN54S11_FILE_SLICE.INDEX >= SN54S11_UNCERTAINTY'LEFT and SN54S11_FILE_SLICE.INDEX <= SN54S11_UNCERTAINTY'RIGHT report "Error - Index out of range in file format" severity ERROR; WAVEFORM := (SN54S11_FILE_SLICE.CODES, (SN54S11_FILE_SLICE.PERIOD, SN54S11_UNCERTAINTY(SN54S11_FILE_SLICE.INDEX))); APPLY_SLICE(CONNECT, WAVEFORM) ; elsif (use_period = TRUE) then WAVEFORM := (SN54S11_FILE_SLICE.CODES, (SN54S11_FILE_SLICE.PERIOD, PERIOD_TD)); APPLY_SLICE(CONNECT, WAVEFORM) ; elsif (use_index = TRUE) then assert SN54S11_FILE_SLICE.INDEX >= SN54S11_TIMING'LEFT and SN54S11_FILE_SLICE.INDEX <= SN54S11_TIMING'RIGHT report "Error - Index out of range in file format" severity ERROR; WAVEFORM := (SN54S11_FILE_SLICE.CODES, SN54S11_TIMING(SN54S11_FILE_SLICE.INDEX)); APPLY_SLICE(CONNECT, WAVEFORM) ; else WAVEFORM := (SN54S11_FILE_SLICE.CODES, DEFAULT_TIMING); APPLY_SLICE(CONNECT, WAVEFORM) ; end if; end loop ; end ; end wgenerator_SN54S11 ;