--=========================================================================== -- This file was written by Kuen Yew Lam and Arpad Muranyi, Intel -- Corporation. It does not contain any confidential or proprietary -- information, and it is made available to the public with the intent of -- promoting the usage of the Multi-Lingual Extensions of the IBIS -- specification and to help pave the way for more accurate behavioral I/O -- buffer models and simulations. This file may be used, modified, and -- distributed without any limitations; however, this file is provided "as -- is" with no warranties whatsoever, including any warranty of -- merchantability, noninfringement, fitness for any particular purpose, or -- any warranty otherwise arising out of any proposal, specification or -- sample. Intel and the author disclaim all liability, including liability -- or infringement of any proprietary rights, including rights to use the -- information in this file. No license, express or implied, by estoppel or -- otherwise, to any intellectual property rights is granted herein. --=========================================================================== -- Features: -- -- 1) This model is provided as an illustration for the presentation: -- http://www.eda.org/pub/ibis/summits/mar05/muranyi.pdf -- -- 2) This is an open source (no pulldown IV tables) differential -- pre/de-emphasis model written in the VHDL-AMS language suitable -- for modeling SATA and similar buffers. It uses a 1 equation 1 -- unknown algorithm to process the IV and Vt tables of IBIS v2.1 -- files. Support for a differential IV surface (or resistor) and -- a differential capacitance can be added as shown in other examples. -- -- 3) This model uses 3 IV curves and 6 Vt curves per output. The data -- provided in this model is not realistic and must be replaced with -- real data to obtain meaningful simulation results. -- -- 4) Includes Vt curve to scaling coefficient converter (executes once -- during initialization of constants) -- -- 5) This model has a 4-way split constant C_comp -- -- 6) This model has a clocked Input and Enable logic with generics to -- define which edge of the clock is used, and to define the initial -- condition of the outputs before the first triggering clock edge is -- received. -- -- To be done: -- -- 1) Add receiver model (threshold sensing, etc...) -- 2) Add support for the Ramp keyword -- 3) Provisions for switching into unfinished edges -- 4) Data dependent switching and strength characteristics support -- 5) Frequency and/or voltage dependent C_comp -- 6) File I/O to read IV, Vt, etc. data from external files --=========================================================================== library IEEE; use IEEE.math_real.all; use IEEE.std_logic_1164.all; use IEEE.electrical_systems.all; use IEEE.energy_systems.all; --=========================================================================== entity PreDe_emphasis is generic (Edge : integer := 2; -- "0" = Falling edge triggered -- "1" = Rising edge triggered -- "2" = Triggers on both edges Out_ini : std_logic := 'Z'; -- Initial condition for output C_comp : real := 10.0e-12; -- Default C_comp value and k_C_comp_pc : real := 0.25; -- splitting coefficients k_C_comp_pu : real := 0.25; k_C_comp_pd : real := 0.25; k_C_comp_gc : real := 0.25; ------------------------------------------------------------------ -- [Pullup Reference] and [Pulldown Reference] values ------------------------------------------------------------------ V_pu_ref : real := 1.575; V_pd_ref : real := 0.0; ------------------------------------------------------------------ -- Vectors of the IV curve tables ------------------------------------------------------------------ V_pc_p : real_vector := ( -5.000000E+00, 1.000000E+01); I_pc_p : real_vector := ( 0.000000E+00, 0.000000E+00); V_gc_p : real_vector := ( -5.000000E+00, 1.000000E+01); I_gc_p : real_vector := ( -0.125000E+00, 0.250000E+00); V_pu_p : real_vector := ( 3.150000E+00, 9.555000E-01, 3.307500E-01, 0.000000E+00, -1.575000E+00); I_pu_p : real_vector := ( -2.437150E-02, -2.261769E-02, -1.891796E-02, 0.000000E+00, 5.500000E-03); -- N buffer V_pc_n : real_vector := ( -5.000000E+00, 1.000000E+01); I_pc_n : real_vector := ( 0.000000E+00, 0.000000E+00); V_gc_n : real_vector := ( -5.000000E+00, 1.000000E+01); I_gc_n : real_vector := ( -0.125000E+00, 0.250000E+00); V_pu_n : real_vector := ( 3.150000E+00, 9.555000E-01, 3.307500E-01, 0.000000E+00, -1.575000E+00); I_pu_n : real_vector := ( -2.437150E-02, -2.261769E-02, -1.891796E-02, 0.000000E+00, 5.500000E-03); ----------------------------------------------------------------------------- -- Vectors of the Vt curve tables ----------------------------------------------------------------------------- T_pu_on_w2s_p : real_vector := ( 0.00000000E+00, 0.10000000E-09, 0.20000000E-09, 0.30000000E-09, 0.40000000E-09, 0.50000000E-09, 0.60000000E-09); V_pu_on_w2s_p : real_vector := ( 4.16800000E-02, 4.16800000E-02, 1.50635000E-01, 2.59590000E-01, 3.68545000E-01, 4.77500000E-01, 4.77500000E-01); T_pu_off_w2s_p : real_vector := ( 0.00000000E+00, 0.10000000E-09, 0.20000000E-09, 0.30000000E-09, 0.40000000E-09, 0.50000000E-09, 0.60000000E-09); V_pu_off_w2s_p : real_vector := ( 4.37300000E-01, 4.37300000E-01, 3.27975000E-01, 2.18650000E-01, 1.09325000E-01, 0.00000000E+00, 0.00000000E+00); T_pu_on_s2w_p : real_vector := ( 0.00000000E+00, 0.10000000E-09, 0.20000000E-09, 0.30000000E-09, 0.40000000E-09, 0.50000000E-09, 0.60000000E-09); V_pu_on_s2w_p : real_vector := ( 0.00000000E+00, 0.00000000E+00, 1.04200000E-02, 2.08400000E-02, 3.12600000E-02, 4.16800000E-02, 4.16800000E-02); T_pu_off_s2w_p : real_vector := ( 0.00000000E+00, 0.10000000E-09, 0.20000000E-09, 0.30000000E-09, 0.40000000E-09, 0.50000000E-09, 0.60000000E-09); V_pu_off_s2w_p : real_vector := ( 4.77500000E-01, 4.77500000E-01, 4.67450000E-01, 4.57400000E-01, 4.47350000E-01, 4.37300000E-01, 4.37300000E-01); T_pu_on_s2s_p : real_vector := ( 0.00000000E+00, 0.10000000E-09, 0.20000000E-09, 0.30000000E-09, 0.40000000E-09, 0.50000000E-09, 0.60000000E-09); V_pu_on_s2s_p : real_vector := ( 0.00000000E+00, 0.00000000E+00, 1.19375000E-01, 2.38750000E-01, 3.58125000E-01, 4.77500000E-01, 4.77500000E-01); T_pu_off_s2s_p : real_vector := ( 0.00000000E+00, 0.10000000E-09, 0.20000000E-09, 0.30000000E-09, 0.40000000E-09, 0.50000000E-09, 0.60000000E-09); V_pu_off_s2s_p : real_vector := ( 4.77500000E-01, 4.77500000E-01, 3.58125000E-01, 2.38750000E-01, 1.19375000E-01, 0.00000000E+00, 0.00000000E+00); -- N buffer T_pu_on_w2s_n : real_vector := ( 0.00000000E+00, 0.10000000E-09, 0.20000000E-09, 0.30000000E-09, 0.40000000E-09, 0.50000000E-09, 0.60000000E-09); V_pu_on_w2s_n : real_vector := ( 4.16800000E-02, 4.16800000E-02, 1.50635000E-01, 2.59590000E-01, 3.68545000E-01, 4.77500000E-01, 4.77500000E-01); T_pu_off_w2s_n : real_vector := ( 0.00000000E+00, 0.10000000E-09, 0.20000000E-09, 0.30000000E-09, 0.40000000E-09, 0.50000000E-09, 0.60000000E-09); V_pu_off_w2s_n : real_vector := ( 4.37300000E-01, 4.37300000E-01, 3.27975000E-01, 2.18650000E-01, 1.09325000E-01, 0.00000000E+00, 0.00000000E+00); T_pu_on_s2w_n : real_vector := ( 0.00000000E+00, 0.10000000E-09, 0.20000000E-09, 0.30000000E-09, 0.40000000E-09, 0.50000000E-09, 0.60000000E-09); V_pu_on_s2w_n : real_vector := ( 0.00000000E+00, 0.00000000E+00, 1.04200000E-02, 2.08400000E-02, 3.12600000E-02, 4.16800000E-02, 4.16800000E-02); T_pu_off_s2w_n : real_vector := ( 0.00000000E+00, 0.10000000E-09, 0.20000000E-09, 0.30000000E-09, 0.40000000E-09, 0.50000000E-09, 0.60000000E-09); V_pu_off_s2w_n : real_vector := ( 4.77500000E-01, 4.77500000E-01, 4.67450000E-01, 4.57400000E-01, 4.47350000E-01, 4.37300000E-01, 4.37300000E-01); T_pu_on_s2s_n : real_vector := ( 0.00000000E+00, 0.10000000E-09, 0.20000000E-09, 0.30000000E-09, 0.40000000E-09, 0.50000000E-09, 0.60000000E-09); V_pu_on_s2s_n : real_vector := ( 0.00000000E+00, 0.00000000E+00, 1.19375000E-01, 2.38750000E-01, 3.58125000E-01, 4.77500000E-01, 4.77500000E-01); T_pu_off_s2s_n : real_vector := ( 0.00000000E+00, 0.10000000E-09, 0.20000000E-09, 0.30000000E-09, 0.40000000E-09, 0.50000000E-09, 0.60000000E-09); V_pu_off_s2s_n : real_vector := ( 4.77500000E-01, 4.77500000E-01, 3.58125000E-01, 2.38750000E-01, 1.19375000E-01, 0.00000000E+00, 0.00000000E+00); ------------------------------------------------------------------------ -- V_fixture and R_fixture values ------------------------------------------------------------------------ Vfx_pu_on : real := 0.0; Vfx_pu_off : real := 0.0; Rfx_pu_on : real := 45.0; Rfx_pu_off : real := 45.0); ------------------------------------------------------------------------ port (signal In_D : in std_logic; signal En_D : in std_logic; signal Rcv_D : out std_logic; signal Clk : in std_logic; terminal IO_p : electrical; terminal IO_n : electrical; terminal PC_ref : electrical; terminal PU_ref : electrical; terminal PD_ref : electrical; terminal GC_ref : electrical); end entity PreDe_emphasis; --=========================================================================== architecture DIFF_OS_CLK_2TAP_1EQ of PreDe_emphasis is --------------------------------------------------------------------------- -- Common mode components for IV curves --------------------------------------------------------------------------- quantity Vpc_p across Ipc_p through PC_ref to IO_p; quantity Vpu_p across Ipu_p through PU_ref to IO_p; quantity Vgc_p across Igc_p through IO_p to GC_ref; quantity Vpc_n across Ipc_n through PC_ref to IO_n; quantity Vpu_n across Ipu_n through PU_ref to IO_n; quantity Vgc_n across Igc_n through IO_n to GC_ref; --------------------------------------------------------------------------- -- Common mode components for C_comp --------------------------------------------------------------------------- quantity Vc_pc_p across Ic_pc_p through PC_ref to IO_p; quantity Vc_pu_p across Ic_pu_p through PU_ref to IO_p; quantity Vc_pd_p across Ic_pd_p through IO_p to PD_ref; quantity Vc_gc_p across Ic_gc_p through IO_p to GC_ref; quantity Vc_pc_n across Ic_pc_n through PC_ref to IO_n; quantity Vc_pu_n across Ic_pu_n through PU_ref to IO_n; quantity Vc_pd_n across Ic_pd_n through IO_n to PD_ref; quantity Vc_gc_n across Ic_gc_n through IO_n to GC_ref; --------------------------------------------------------------------------- -- Various signals and quantities (for internal calculations) --------------------------------------------------------------------------- quantity k_pu_p : real := 0.0; quantity k_pu_n : real := 0.0; type state is (Z, W0, W1, W0S1, W1S0, S0S1, S1S0, S0W0, S1W1); --=========================================================================== function std_logic2state (Input : in std_logic := 'Z') return state is --------------------------------------------------------------------------- -- This function converts a std_logic value to a value of type "state". --------------------------------------------------------------------------- variable StateValue : state; --------------------------------------------------------------------------- begin ------------------------------------------------------------------------- case (Input) is when 'L' => StateValue := W0; when 'H' => StateValue := W1; when '0' => StateValue := W0; -- This should really be S0 when '1' => StateValue := W1; -- This should really be S1 when others => StateValue := Z; end case; return StateValue; ------------------------------------------------------------------------- end function std_logic2state; --=========================================================================== signal CurrentState : state := std_logic2state(Out_ini); signal EventTime : real := 0.0; --=========================================================================== function Lookup (Extrapolation : in string := "IV"; X : in real; Ydata : in real_vector; Xdata : in real_vector) return real is --------------------------------------------------------------------------- -- This function is basically the equivalent of a PWL function in SPICE. -- It returns "Y" that corresponds to "X" in the "Ydata" "Xdata" input pair -- using linear interpolation. -- -- If the "X" input value lies outside the range of "Xdata", the returned -- "Y" value will either be equal to the first or last point in "Ydata", -- or it will be calculated using the slope between the first or last two -- points of "Ydata". The extrapolation method is determined by the string -- in "Extrapolation". "Vt" selects the repeated points method, "IV" -- selects the last slopes method. -- -- (The original code of this function was received from Mentor Graphics, -- modifications written by Arpad Muranyi, Intel Corporation). --------------------------------------------------------------------------- variable xvalue, yvalue, m : real; variable start, fin, mid : integer; --------------------------------------------------------------------------- begin ------------------------------------------------------------------------- -- Handle cases when "X" is outside the range of "Xdata" ------------------------------------------------------------------------- if (Extrapolation = "IV") and (X <= Xdata(0)) then m := (Ydata(1) - Ydata(0)) / (Xdata(1) - Xdata(0)); yvalue := Ydata(0) + m * (X - Xdata(0)); return yvalue; elsif (Extrapolation = "Vt") and (X <= Xdata(0)) then yvalue := Ydata(0); return yvalue; elsif (Extrapolation = "IV") and (X >= Xdata(Xdata'right)) then m := (Ydata(Ydata'right) - Ydata(Ydata'right - 1)) / (Xdata(Xdata'right) - Xdata(Xdata'right - 1)); yvalue := Ydata(Ydata'right) + m * (X - Xdata(Xdata'right)); return yvalue; elsif (Extrapolation = "Vt") and (X >= Xdata(Xdata'right)) then yvalue := Ydata(Ydata'right); return yvalue; ------------------------------------------------------------------------- -- Handle cases when "X" is in the range of "Xdata" ------------------------------------------------------------------------- else start:= 0; fin := Xdata'right; while start <= fin loop mid := (start + fin) / 2; if Xdata(mid) < X then start := mid + 1; else fin := mid - 1; end if; end loop; if Xdata(mid) > X then mid := mid - 1; end if; ----------------------------------------------------------------------- -- Find "Y" by linear interpolation ----------------------------------------------------------------------- yvalue := Ydata(mid) + (X - Xdata(mid)) * (Ydata(mid+1) - Ydata(mid)) / (Xdata(mid+1) - Xdata(mid)); return yvalue; ------------------------------------------------------------------------- end if; ------------------------------------------------------------------------- end function Lookup; --=========================================================================== function Coeff (Edge : in string; Vwfm : in real_vector; Twfm : in real_vector; Rfx : in real; Vfx : in real; Iiv : in real_vector; Viv : in real_vector; Iiv_cl : in real_vector; Viv_cl : in real_vector; Vref : in real) return real_vector is --------------------------------------------------------------------------- -- This function converts the Vt curve to a corresponding scaling -- coefficient curve that is used to scale the IV curve with respect -- to time. The effects of C_comp on the waveforms are included in the -- scaling coefficient, so that the presence of C_comp in the output -- stage will not "load" the driver, i.e. C_comp in the output stage -- will not derate the original waveforms in the Vt curves. --------------------------------------------------------------------------- variable Kout : real_vector(Vwfm'range); variable dVwfm : real_vector(Vwfm'range); variable I1 : real := 1.0; variable Ifx1 : real := 0.0; --------------------------------------------------------------------------- begin for index in Vwfm'range loop ------------------------------------------------------------------------- -- Generate the derivative of the waveform -- Force the derivatives of the first and last points to zero ------------------------------------------------------------------------- if (index = Vwfm'left) then dVwfm(index) := 0.0; dVwfm(index) := 0.0; elsif (index = Vwfm'right) then dVwfm(index) := 0.0; dVwfm(index) := 0.0; ----------------------------------------------------------------------- -- Calculate the derivative of a point using both of its neighbors ----------------------------------------------------------------------- else dVwfm(index) := ((Vwfm(index) - Vwfm(index-1))/(Twfm(index) - Twfm(index-1)) + (Vwfm(index+1) - Vwfm(index))/(Twfm(index+1) - Twfm(index)))/2.0; end if; ----------------------------------------------------------------------- -- Calculate intermediate currents ----------------------------------------------------------------------- if (Edge = "K_pu_on") or (Edge = "K_pu_off") then I1 := Lookup("IV", Vref - Vwfm(index), Iiv, Viv); Ifx1 := realmin(((Vfx - Vwfm(index)) / Rfx), 0.0) - C_comp * dVwfm(index) - Lookup("IV", Vwfm(index), Iiv_cl, Viv_cl); elsif (Edge = "K_pd_on") or (Edge = "K_pd_off") then I1 := Lookup("IV", Vwfm(index) - Vref, Iiv, Viv); Ifx1 := realmax(((Vfx - Vwfm(index)) / Rfx), 0.0) - C_comp * dVwfm(index) - Lookup("IV", Vwfm(index), Iiv_cl, Viv_cl); else I1 := 1.0; Ifx1 := 0.0; end if; Kout(index) := Ifx1 / I1; ------------------------------------------------------------------------- end loop; ------------------------------------------------------------------------- return Kout; end function Coeff; --=========================================================================== constant K_pu_on_s2s_p : real_vector := Coeff("K_pu_on", V_pu_on_s2s_p, T_pu_on_s2s_p, Rfx_pu_on, Vfx_pu_on, I_pu_p, V_pu_p, I_gc_p, V_gc_p, V_pu_ref); constant K_pu_off_s2s_p : real_vector := Coeff("K_pu_off", V_pu_off_s2s_p, T_pu_off_s2s_p, Rfx_pu_off, Vfx_pu_off, I_pu_p, V_pu_p, I_gc_p, V_gc_p, V_pu_ref); constant K_pu_on_s2w_p : real_vector := Coeff("K_pu_on", V_pu_on_s2w_p, T_pu_on_s2w_p, Rfx_pu_on, Vfx_pu_on, I_pu_p, V_pu_p, I_gc_p, V_gc_p, V_pu_ref); constant K_pu_off_s2w_p : real_vector := Coeff("K_pu_off", V_pu_off_s2w_p, T_pu_off_s2w_p, Rfx_pu_off, Vfx_pu_off, I_pu_p, V_pu_p, I_gc_p, V_gc_p, V_pu_ref); constant K_pu_on_w2s_p : real_vector := Coeff("K_pu_on", V_pu_on_w2s_p, T_pu_on_w2s_p, Rfx_pu_on, Vfx_pu_on, I_pu_p, V_pu_p, I_gc_p, V_gc_p, V_pu_ref); constant K_pu_off_w2s_p : real_vector := Coeff("K_pu_off", V_pu_off_w2s_p, T_pu_off_w2s_p, Rfx_pu_off, Vfx_pu_off, I_pu_p, V_pu_p, I_gc_p, V_gc_p, V_pu_ref); constant K_pu_on_s2s_n : real_vector := Coeff("K_pu_on", V_pu_on_s2s_n, T_pu_on_s2s_n, Rfx_pu_on, Vfx_pu_on, I_pu_n, V_pu_n, I_gc_n, V_gc_n, V_pu_ref); constant K_pu_off_s2s_n : real_vector := Coeff("K_pu_off", V_pu_off_s2s_n, T_pu_off_s2s_n, Rfx_pu_off, Vfx_pu_off, I_pu_n, V_pu_n, I_gc_n, V_gc_n, V_pu_ref); constant K_pu_on_s2w_n : real_vector := Coeff("K_pu_on", V_pu_on_s2w_n, T_pu_on_s2w_n, Rfx_pu_on, Vfx_pu_on, I_pu_n, V_pu_n, I_gc_n, V_gc_n, V_pu_ref); constant K_pu_off_s2w_n : real_vector := Coeff("K_pu_off", V_pu_off_s2w_n, T_pu_off_s2w_n, Rfx_pu_off, Vfx_pu_off, I_pu_n, V_pu_n, I_gc_n, V_gc_n, V_pu_ref); constant K_pu_on_w2s_n : real_vector := Coeff("K_pu_on", V_pu_on_w2s_n, T_pu_on_w2s_n, Rfx_pu_on, Vfx_pu_on, I_pu_n, V_pu_n, I_gc_n, V_gc_n, V_pu_ref); constant K_pu_off_w2s_n : real_vector := Coeff("K_pu_off", V_pu_off_w2s_n, T_pu_off_w2s_n, Rfx_pu_off, Vfx_pu_off, I_pu_n, V_pu_n, I_gc_n, V_gc_n, V_pu_ref); --=========================================================================== begin StateMachine: Process (Clk) is begin if ((Edge = 0 and falling_edge(Clk)) or (Edge = 1 and rising_edge(Clk)) or (Edge = 2 and (falling_edge(Clk) or rising_edge(Clk)))) then if (En_D = '0') then CurrentState <= Z; elsif (En_D = '1') then case (CurrentState) is when Z => if (In_D = '1') then CurrentState <= W1; elsif (In_D = '0') then CurrentState <= W0; end if; when W0 => if (In_D = '1') then CurrentState <= W0S1; end if; when W1 => if (In_D = '0') then CurrentState <= W1S0; end if; when W0S1 => if (In_D = '1') then CurrentState <= S1W1; elsif (In_D = '0') then CurrentState <= S1S0; end if; when W1S0 => if (In_D = '1') then CurrentState <= S0S1; elsif (In_D = '0') then CurrentState <= S0W0; end if; when S0S1 => if (In_D = '1') then CurrentState <= S1W1; elsif (In_D = '0') then CurrentState <= S1S0; end if; when S1S0 => if (In_D = '1') then CurrentState <= S0S1; elsif (In_D = '0') then CurrentState <= S0W0; end if; when S0W0 => if (In_D = '1') then CurrentState <= W0S1; elsif (In_D = '0') then CurrentState <= W0; end if; when S1W1 => if (In_D = '1') then CurrentState <= W1; elsif (In_D = '0') then CurrentState <= W1S0; end if; end case; end if; end if; end process StateMachine; Event_time: process (CurrentState) is begin EventTime <= now; end process Event_time; break on CurrentState; --=========================================================================== -- This section contains the simultaneous analog equations to find the -- appropriate scaling coefficients according to the state the buffer. --------------------------------------------------------------------------- if (EventTime = 0.0) use -- initialization if (CurrentState = W0) use k_pu_p == K_pu_on_s2w_p(K_pu_on_s2w_p'right); k_pu_n == K_pu_off_s2w_n(K_pu_off_s2w_n'right); elsif (CurrentState = W1) use k_pu_p == K_pu_off_s2w_p(K_pu_off_s2w_p'right); k_pu_n == K_pu_on_s2w_n(K_pu_on_s2w_n'right); else k_pu_p == 0.0; k_pu_n == 0.0; end use; else -- normal operation if (CurrentState = W0) use k_pu_p == K_pu_on_s2w_p(K_pu_on_s2w_p'right); k_pu_n == K_pu_off_s2w_n(K_pu_off_s2w_n'right); elsif (CurrentState = W1) use k_pu_p == K_pu_off_s2w_p(K_pu_off_s2w_p'right); k_pu_n == K_pu_on_s2w_n(K_pu_on_s2w_n'right); elsif (CurrentState = W0S1) use k_pu_p == Lookup("Vt", now - EventTime, K_pu_on_w2s_p, T_pu_on_w2s_p); k_pu_n == Lookup("Vt", now - EventTime, K_pu_off_w2s_n, T_pu_off_w2s_n); elsif (CurrentState = W1S0) use k_pu_p == Lookup("Vt", now - EventTime, K_pu_off_w2s_p, T_pu_off_w2s_p); k_pu_n == Lookup("Vt", now - EventTime, K_pu_on_w2s_n, T_pu_on_w2s_n); elsif (CurrentState = S0S1) use k_pu_p == Lookup("Vt", now - EventTime, K_pu_on_s2s_p, T_pu_on_s2s_p); k_pu_n == Lookup("Vt", now - EventTime, K_pu_off_s2s_n, T_pu_off_s2s_n); elsif (CurrentState = S1S0) use k_pu_p == Lookup("Vt", now - EventTime, K_pu_off_s2s_p, T_pu_off_s2s_p); k_pu_n == Lookup("Vt", now - EventTime, K_pu_on_s2s_n, T_pu_on_s2s_n); elsif (CurrentState = S0W0) use k_pu_p == Lookup("Vt", now - EventTime, K_pu_on_s2w_p, T_pu_on_s2w_p); k_pu_n == Lookup("Vt", now - EventTime, K_pu_off_s2w_n, T_pu_off_s2w_n); elsif (CurrentState = S1W1) use k_pu_p == Lookup("Vt", now - EventTime, K_pu_off_s2w_p, T_pu_off_s2w_p); k_pu_n == Lookup("Vt", now - EventTime, K_pu_on_s2w_n, T_pu_on_s2w_n); else k_pu_p == 0.0; k_pu_n == 0.0; end use; end use; --=========================================================================== -- This section contains the simultaneous analog equations which calculate -- the output currents of the IV curves and C_comp capacitors. --------------------------------------------------------------------------- --------------------------------------------------------------------------- -- Common mode components for IV curves --------------------------------------------------------------------------- Ipc_p == -1.0 * Lookup("IV", Vpc_p, I_pc_p, V_pc_p); Ipu_p == -1.0 * k_pu_p * Lookup("IV", Vpu_p, I_pu_p, V_pu_p); Igc_p == Lookup("IV", Vgc_p, I_gc_p, V_gc_p); Ipc_n == -1.0 * Lookup("IV", Vpc_n, I_pc_n, V_pc_n); Ipu_n == -1.0 * k_pu_n * Lookup("IV", Vpu_n, I_pu_n, V_pu_n); Igc_n == Lookup("IV", Vgc_n, I_gc_n, V_gc_n); --------------------------------------------------------------------------- -- Common mode components for C_comp --------------------------------------------------------------------------- Ic_pc_p == k_C_comp_pc * C_comp * Vc_pc_p'dot; Ic_pu_p == k_C_comp_pu * C_comp * Vc_pu_p'dot; Ic_pd_p == k_C_comp_pd * C_comp * Vc_pd_p'dot; Ic_gc_p == k_C_comp_gc * C_comp * Vc_gc_p'dot; Ic_pc_n == k_C_comp_pc * C_comp * Vc_pc_n'dot; Ic_pu_n == k_C_comp_pu * C_comp * Vc_pu_n'dot; Ic_pd_n == k_C_comp_pd * C_comp * Vc_pd_n'dot; Ic_gc_n == k_C_comp_gc * C_comp * Vc_gc_n'dot; --=========================================================================== end architecture DIFF_OS_CLK_2TAP_1EQ; --===========================================================================