-- -- -- 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. -- -- ------------------------------------------------------------------ -- FILENAME: SN5438.tim.vhd -- Description: timing module -- Created by Steve Turner 6/1/90 use WORK.SIMFLAG.all; package SN5438_TIMING is type eflags is record x_out : boolean; no_time : boolean; end record; type messages is record tl : sim_options; option : time_options; mode : time_modes; end record; type times is record tplz_a_b_y : time; tpzl_a_b_y : time; end record; type sim_timing is record error_flags : eflags; prop_delays : times; sim_messages : messages; end record; type loads is record tld_y1 : real; tld_y2 : real; tld_y3 : real; tld_y4 : real; end record; FUNCTION get_timing (gen_loads : IN loads; gen_times : IN times) RETURN sim_timing; FUNCTION calc_curve ( X,C3,C2,C1,C0 : IN real ) RETURN real; end SN5438_TIMING; ---------------------------------------------------------------------- package body SN5438_TIMING is FUNCTION calc_curve ( X,C3,C2,C1,C0 : IN real ) RETURN real IS VARIABLE o : REAL; BEGIN o := C3*(X)**3 + C2*(X)**2 + C1*(X) + C0; RETURN o; END calc_curve; FUNCTION get_timing (gen_loads : IN loads; gen_times : IN times) RETURN sim_timing IS variable KU : real; variable KVLH,KTLH,deratingLH : real; variable KVHL,KTHL,deratingHL : real; variable mtime : sim_timing; begin if ( Ta < -55.0 or Ta > 125.0 ) then assert FALSE report "Temperature out of range" severity note; assert FALSE report "Check SIMFLAG.vhd file" severity error; elsif ( Vcc < 4.5 or Vcc > 5.5 ) then assert FALSE report "Voltage out of range" severity note; assert FALSE report "Check SIMFLAG.vhd file" severity error; elsif ( DERATE_FACTOR < 0.0 ) then assert FALSE report "Negative DERATE_FACTOR not allowed" severity note; assert FALSE report "Check SIMFLAG.vhd file" severity error; end if; -- SELECT FLAGS if (FLAG_TYPE = GLOBAL) then KU := DERATE_FACTOR/100.0; KTLH := calc_curve(Ta,1.191617e-07,-8.411414e-06,2.592953e-03,9.385714e-01); KVLH := calc_curve(Vcc,0.000000,-1.999974e-03,-4.700023e-02,1.285001e+00); KTHL := calc_curve(Ta,-6.346664e-08,2.408000e-05,-3.092334e-03,1.063250e+00); KVHL := calc_curve(Vcc,0.000000,-1.999974e-03,-4.700023e-02,1.285001e+00); deratingLH := KVLH * KTLH * KU; deratingHL := KVHL * KTHL * KU; mtime.sim_messages.tl := SIM_OPTION; mtime.sim_messages.option := TIME_OPTION; mtime.sim_messages.mode := TIME_MODE; else mtime.sim_messages.tl := FULL_TIM; mtime.sim_messages.option := TYPICAL; mtime.sim_messages.mode := GENERIC_VALUES; end if; -- SET ERROR FLAGS if (mtime.sim_messages.tl = NO_TIM) then mtime.error_flags.x_out := FALSE; mtime.error_flags.no_time := TRUE; elsif (mtime.sim_messages.tl = ONLY_X) then mtime.error_flags.x_out := TRUE; mtime.error_flags.no_time := TRUE; elsif (mtime.sim_messages.tl = ONLY_DISPLAY) then mtime.error_flags.x_out := FALSE; mtime.error_flags.no_time := FALSE; elsif (mtime.sim_messages.tl = FULL_TIM) then mtime.error_flags.x_out := TRUE; mtime.error_flags.no_time := FALSE; end if; -- SELECT SIMULATION TIMING DELAY VALUES case mtime.sim_messages.mode is when GENERIC_VALUES => assert FALSE report "Using generic delay values" severity note ; mtime.prop_delays := gen_times; when TIMING => case mtime.sim_messages.option is when MINIMUM => mtime.prop_delays.tplz_a_b_y := 12.600 ns * deratingLH; mtime.prop_delays.tpzl_a_b_y := 9.900 ns * deratingHL; when TYPICAL => mtime.prop_delays.tplz_a_b_y := 14.000 ns * deratingLH; mtime.prop_delays.tpzl_a_b_y := 11.000 ns * deratingHL; when MAXIMUM => mtime.prop_delays.tplz_a_b_y := 22.000 ns * deratingLH; mtime.prop_delays.tpzl_a_b_y := 18.000 ns * deratingHL; end case; -- TIME_OPTION when ANNOTATED => assert FALSE report "Back annotation not available" severity warning ; assert FALSE report "Using generic delay values" severity note ; mtime.prop_delays := gen_times; end case; -- TIME_MODE RETURN(mtime); end get_timing; end SN5438_TIMING;