RE: SPICE compatibility issues

From: Brian Mulvaney <brian.mulvaney_at_.....>
Date: Tue Aug 02 2005 - 12:40:04 PDT
Hello Arpad,

Many years ago one of my colleagues, Bob Garbs, wrote an Ibis2 to
Verilog-A translator. This work pre-dated the $table_model of
Verilog-AMS, so the generated Verilog-A model is somwhat uglier than
it would need to be nowadays. Below is an example output of his
program, run on (I believe) the tristate buffer example from the NCSU
s2ibis2 webpage. I had to manually change the Verilog-A 'generate'
statements to analog for loops, which may give you some idea of just
how old this program is.

I don't know if this will be useful to you at all - probably just of
some mild historical interest.

Regards,
Brian M.

----
Brian Mulvaney 
7700 W. Parmer Lane, Austin TX 78729
(512) 996-4454   FAX: (512) 996-7755
Brian.Mulvaney@freescale.com  



Here is a sample output from Bob's program. It is machine generated,
so fromatting is not that pretty.


//IBIS buffer model io_driver from file io.ibs
//ibis2vla version 2.0beta
`include "disciplines.h"
`define npullup 74
`define npulldown 73
`define ngndClamp 67
`define npwrClamp 34
// Component MCM IO Driver containing model io_driver for pin out
module ibuf_MCMIODriver_out(chip_sig, pkg_pin, enable, pwr, gnd);
inout chip_sig, pkg_pin, enable, pwr, gnd;
electrical chip_sig, pkg_pin, enable, pwr, gnd, n1, chip_pad;
ibisRes #(.R(0.002)) r_pkg(pkg_pin, n1);
ibisInd #(.L(2e-10)) l_pkg(chip_pad, n1);
ibisCap #(.C(2e-12)) c_pkg(pkg_pin, gnd);
ibisCap #(.C(5e-12)) c_comp(chip_pad, gnd);
io_driver io_inst(chip_sig, chip_pad, enable, pwr, gnd);
endmodule
// The buffer module for model: io_driver
module io_driver(chip_sig, chip_pad, enable, pwr, gnd);
inout chip_sig, chip_pad, enable, pwr, gnd;
electrical chip_sig, chip_pad, enable, pwr, gnd;
parameter real thresh = 1.65;
integer dataIn, enaIn, enaType, pol;
real vpullup[0:`npullup];
real ipullup[0:`npullup];
real vpulldown[0:`npulldown];
real ipulldown[0:`npulldown];
real ambiTemp;
real vup0, vup1, vdn0, vdn1;
real sr;
real iup, idn;
real denom;
real rupval, rdnval;
genvar j;
real vgndClamp[0:`ngndClamp];
real igndClamp[0:`ngndClamp];
real vgnd, ignd;
real vpwrClamp[0:`npwrClamp];
real ipwrClamp[0:`npwrClamp];
real vpwr, ipwr;
analog begin
@(initial_step) begin
ambiTemp = $temperature - 273.15;
if ((ambiTemp > (27 + 1))||(ambiTemp < (27 - 1)))
$strobe("WARNING: ambient temp: 27 != IBIS spec temp: %g", ambiTemp);
pol = 1;
enaType = 1;
// pullup V/I table
vpullup[73] = 6.6; ipullup[73] = -1.89;
vpullup[72] = 6.1; ipullup[72] = -1.49;
vpullup[71] = 5.9; ipullup[71] = -1.33;
vpullup[70] = 5.7; ipullup[70] = -1.17;
vpullup[69] = 5.5; ipullup[69] = -1.01;
vpullup[68] = 5.3; ipullup[68] = -0.86;
vpullup[67] = 5.1; ipullup[67] = -0.7;
vpullup[66] = 4.9; ipullup[66] = -0.54;
vpullup[65] = 4.7; ipullup[65] = -0.38;
vpullup[64] = 4.5; ipullup[64] = -0.22;
vpullup[63] = 4.3; ipullup[63] = -0.0643;
vpullup[62] = 4.2; ipullup[62] = -0.0091;
vpullup[61] = 4.1; ipullup[61] = -0.0061;
vpullup[60] = 4; ipullup[60] = -0.00575;
vpullup[59] = 3.9; ipullup[59] = -0.00562;
vpullup[58] = 3.8; ipullup[58] = -0.00559;
vpullup[57] = 3.7; ipullup[57] = -0.00558;
vpullup[56] = 3.6; ipullup[56] = -0.00557;
vpullup[55] = 3.5; ipullup[55] = -0.00556;
vpullup[54] = 3.4; ipullup[54] = -0.00556;
vpullup[53] = 3.3; ipullup[53] = -0.00555;
vpullup[52] = 3.2; ipullup[52] = -0.00554;
vpullup[51] = 3.1; ipullup[51] = -0.00553;
vpullup[50] = 3; ipullup[50] = -0.00552;
vpullup[49] = 2.9; ipullup[49] = -0.00551;
vpullup[48] = 2.8; ipullup[48] = -0.0055;
vpullup[47] = 2.7; ipullup[47] = -0.00549;
vpullup[46] = 2.6; ipullup[46] = -0.00548;
vpullup[45] = 2.5; ipullup[45] = -0.00547;
vpullup[44] = 2.4; ipullup[44] = -0.00547;
vpullup[43] = 2.3; ipullup[43] = -0.00546;
vpullup[42] = 2.2; ipullup[42] = -0.00545;
vpullup[41] = 2.1; ipullup[41] = -0.00543;
vpullup[40] = 2; ipullup[40] = -0.0054;
vpullup[39] = 1.9; ipullup[39] = -0.00535;
vpullup[38] = 1.8; ipullup[38] = -0.00527;
vpullup[37] = 1.7; ipullup[37] = -0.00517;
vpullup[36] = 1.6; ipullup[36] = -0.00505;
vpullup[35] = 1.5; ipullup[35] = -0.0049;
vpullup[34] = 1.4; ipullup[34] = -0.00472;
vpullup[33] = 1.3; ipullup[33] = -0.00453;
vpullup[32] = 1.2; ipullup[32] = -0.00431;
vpullup[31] = 1.1; ipullup[31] = -0.00407;
vpullup[30] = 1; ipullup[30] = -0.00381;
vpullup[29] = 0.9; ipullup[29] = -0.00352;
vpullup[28] = 0.8; ipullup[28] = -0.00322;
vpullup[27] = 0.7; ipullup[27] = -0.00289;
vpullup[26] = 0.6; ipullup[26] = -0.00254;
vpullup[25] = 0.5; ipullup[25] = -0.00218;
vpullup[24] = 0.4; ipullup[24] = -0.00179;
vpullup[23] = 0.3; ipullup[23] = -0.00138;
vpullup[22] = 0.2; ipullup[22] = -0.00094;
vpullup[21] = 0.1; ipullup[21] = -0.00049;
vpullup[20] = 0; ipullup[20] = 2.39e-11;
vpullup[19] = -0.1; ipullup[19] = 0.0005;
vpullup[18] = -0.2; ipullup[18] = 0.001;
vpullup[17] = -0.3; ipullup[17] = 0.0015;
vpullup[16] = -0.4; ipullup[16] = 0.002;
vpullup[15] = -0.5; ipullup[15] = 0.0025;
vpullup[14] = -0.6; ipullup[14] = 0.00301;
vpullup[13] = -0.7; ipullup[13] = 0.00352;
vpullup[12] = -0.8; ipullup[12] = 0.00404;
vpullup[11] = -0.9; ipullup[11] = 0.00456;
vpullup[10] = -1; ipullup[10] = 0.00521;
vpullup[9] = -1.5; ipullup[9] = 0.01532;
vpullup[8] = -1.7; ipullup[8] = 0.01965;
vpullup[7] = -1.9; ipullup[7] = 0.02366;
vpullup[6] = -2.1; ipullup[6] = 0.02737;
vpullup[5] = -2.3; ipullup[5] = 0.03078;
vpullup[4] = -2.5; ipullup[4] = 0.03392;
vpullup[3] = -2.7; ipullup[3] = 0.03682;
vpullup[2] = -2.9; ipullup[2] = 0.03949;
vpullup[1] = -3.1; ipullup[1] = 0.04195;
vpullup[0] = -3.3; ipullup[0] = 0.04421;
// pulldown V/I table
vpulldown[72] = 6.6; ipulldown[72] = 3.74;
vpulldown[71] = 6.1; ipulldown[71] = 2.95;
vpulldown[70] = 5.9; ipulldown[70] = 2.64;
vpulldown[69] = 5.7; ipulldown[69] = 2.32;
vpulldown[68] = 5.5; ipulldown[68] = 2.01;
vpulldown[67] = 5.3; ipulldown[67] = 1.7;
vpulldown[66] = 5.1; ipulldown[66] = 1.38;
vpulldown[65] = 4.9; ipulldown[65] = 1.07;
vpulldown[64] = 4.7; ipulldown[64] = 0.75;
vpulldown[63] = 4.5; ipulldown[63] = 0.44;
vpulldown[62] = 4.3; ipulldown[62] = 0.13;
vpulldown[61] = 4.2; ipulldown[61] = 0.01713;
vpulldown[60] = 4.1; ipulldown[60] = 0.01189;
vpulldown[59] = 4; ipulldown[59] = 0.01175;
vpulldown[58] = 3.9; ipulldown[58] = 0.01173;
vpulldown[57] = 3.8; ipulldown[57] = 0.01172;
vpulldown[56] = 3.7; ipulldown[56] = 0.0117;
vpulldown[55] = 3.6; ipulldown[55] = 0.01169;
vpulldown[54] = 3.5; ipulldown[54] = 0.01167;
vpulldown[53] = 3.4; ipulldown[53] = 0.01166;
vpulldown[52] = 3.3; ipulldown[52] = 0.01164;
vpulldown[51] = 3.2; ipulldown[51] = 0.01163;
vpulldown[50] = 3.1; ipulldown[50] = 0.01161;
vpulldown[49] = 3; ipulldown[49] = 0.0116;
vpulldown[48] = 2.9; ipulldown[48] = 0.01158;
vpulldown[47] = 2.8; ipulldown[47] = 0.01157;
vpulldown[46] = 2.7; ipulldown[46] = 0.01155;
vpulldown[45] = 2.6; ipulldown[45] = 0.01154;
vpulldown[44] = 2.5; ipulldown[44] = 0.01152;
vpulldown[43] = 2.4; ipulldown[43] = 0.01151;
vpulldown[42] = 2.3; ipulldown[42] = 0.01149;
vpulldown[41] = 2.2; ipulldown[41] = 0.01148;
vpulldown[40] = 2.1; ipulldown[40] = 0.01146;
vpulldown[39] = 2; ipulldown[39] = 0.01144;
vpulldown[38] = 1.9; ipulldown[38] = 0.01137;
vpulldown[37] = 1.8; ipulldown[37] = 0.01125;
vpulldown[36] = 1.7; ipulldown[36] = 0.01108;
vpulldown[35] = 1.6; ipulldown[35] = 0.01085;
vpulldown[34] = 1.5; ipulldown[34] = 0.01058;
vpulldown[33] = 1.4; ipulldown[33] = 0.01025;
vpulldown[32] = 1.3; ipulldown[32] = 0.00986;
vpulldown[31] = 1.2; ipulldown[31] = 0.00943;
vpulldown[30] = 1.1; ipulldown[30] = 0.00894;
vpulldown[29] = 1; ipulldown[29] = 0.0084;
vpulldown[28] = 0.9; ipulldown[28] = 0.0078;
vpulldown[27] = 0.8; ipulldown[27] = 0.00715;
vpulldown[26] = 0.7; ipulldown[26] = 0.00645;
vpulldown[25] = 0.6; ipulldown[25] = 0.0057;
vpulldown[24] = 0.5; ipulldown[24] = 0.00489;
vpulldown[23] = 0.4; ipulldown[23] = 0.00403;
vpulldown[22] = 0.3; ipulldown[22] = 0.00312;
vpulldown[21] = 0.2; ipulldown[21] = 0.00215;
vpulldown[20] = 0.1; ipulldown[20] = 0.00112;
vpulldown[19] = 0; ipulldown[19] = -2.238e-11;
vpulldown[18] = -0.1; ipulldown[18] = -0.00115;
vpulldown[17] = -0.2; ipulldown[17] = -0.00225;
vpulldown[16] = -0.3; ipulldown[16] = -0.00335;
vpulldown[15] = -0.4; ipulldown[15] = -0.00443;
vpulldown[14] = -0.5; ipulldown[14] = -0.00551;
vpulldown[13] = -0.6; ipulldown[13] = -0.00657;
vpulldown[12] = -0.7; ipulldown[12] = -0.00762;
vpulldown[11] = -0.8; ipulldown[11] = -0.00866;
vpulldown[10] = -0.9; ipulldown[10] = -0.00968;
vpulldown[9] = -1; ipulldown[9] = -0.01067;
vpulldown[8] = -1.5; ipulldown[8] = -0.02079;
vpulldown[7] = -1.7; ipulldown[7] = -0.02617;
vpulldown[6] = -1.9; ipulldown[6] = -0.03101;
vpulldown[5] = -2.1; ipulldown[5] = -0.0353;
vpulldown[4] = -2.5; ipulldown[4] = -0.04242;
vpulldown[3] = -2.7; ipulldown[3] = -0.04532;
vpulldown[2] = -2.9; ipulldown[2] = -0.04782;
vpulldown[1] = -3.1; ipulldown[1] = -0.04995;
vpulldown[0] = -3.3; ipulldown[0] = -0.05173;
// gndClamp V/I table
vgndClamp[66] = 3.3; igndClamp[66] = 2.75e-12;
vgndClamp[65] = 3.2; igndClamp[65] = 2.59e-12;
vgndClamp[64] = 3.1; igndClamp[64] = 2.42e-12;
vgndClamp[63] = 3; igndClamp[63] = 2.25e-12;
vgndClamp[62] = 2.9; igndClamp[62] = 2.08e-12;
vgndClamp[61] = 2.8; igndClamp[61] = 1.92e-12;
vgndClamp[60] = 2.7; igndClamp[60] = 1.75e-12;
vgndClamp[59] = 2.6; igndClamp[59] = 1.58e-12;
vgndClamp[58] = 2.5; igndClamp[58] = 1.42e-12;
vgndClamp[57] = 2.4; igndClamp[57] = 1.25e-12;
vgndClamp[56] = 2.3; igndClamp[56] = 1.08e-12;
vgndClamp[55] = 2.2; igndClamp[55] = 9.2e-13;
vgndClamp[54] = 2.1; igndClamp[54] = 7.5e-13;
vgndClamp[53] = 2; igndClamp[53] = 5.8e-13;
vgndClamp[52] = 1.9; igndClamp[52] = 4.2e-13;
vgndClamp[51] = 1.8; igndClamp[51] = 2.5e-13;
vgndClamp[50] = 1.7; igndClamp[50] = 8.361e-14;
vgndClamp[49] = 1.6; igndClamp[49] = -8.309e-14;
vgndClamp[48] = 1.5; igndClamp[48] = -2.5e-13;
vgndClamp[47] = 1.4; igndClamp[47] = -4.2e-13;
vgndClamp[46] = 1.3; igndClamp[46] = -5.8e-13;
vgndClamp[45] = 1.2; igndClamp[45] = -7.5e-13;
vgndClamp[44] = 1.1; igndClamp[44] = -9.2e-13;
vgndClamp[43] = 1; igndClamp[43] = -1.08e-12;
vgndClamp[42] = 0.9; igndClamp[42] = -1.25e-12;
vgndClamp[41] = 0.8; igndClamp[41] = -1.42e-12;
vgndClamp[40] = 0.7; igndClamp[40] = -1.58e-12;
vgndClamp[39] = 0.6; igndClamp[39] = -1.75e-12;
vgndClamp[38] = 0.5; igndClamp[38] = -1.92e-12;
vgndClamp[37] = 0.4; igndClamp[37] = -2.08e-12;
vgndClamp[36] = 0.3; igndClamp[36] = -2.25e-12;
vgndClamp[35] = 0.2; igndClamp[35] = -2.42e-12;
vgndClamp[34] = 0.1; igndClamp[34] = -2.59e-12;
vgndClamp[33] = 0; igndClamp[33] = -2.77e-12;
vgndClamp[32] = -0.1; igndClamp[32] = -3.14e-12;
vgndClamp[31] = -0.2; igndClamp[31] = -3.79e-12;
vgndClamp[30] = -0.3; igndClamp[30] = -5.1e-12;
vgndClamp[29] = -0.4; igndClamp[29] = -2.178e-11;
vgndClamp[28] = -0.5; igndClamp[28] = -5.8e-10;
vgndClamp[27] = -0.6; igndClamp[27] = -2.486e-08;
vgndClamp[26] = -0.7; igndClamp[26] = -1.16e-06;
vgndClamp[25] = -0.8; igndClamp[25] = -5.514e-05;
vgndClamp[24] = -0.9; igndClamp[24] = -0.00263;
vgndClamp[23] = -1; igndClamp[23] = -0.05732;
vgndClamp[22] = -1.1; igndClamp[22] = -0.14;
vgndClamp[21] = -1.2; igndClamp[21] = -0.21;
vgndClamp[20] = -1.3; igndClamp[20] = -0.29;
vgndClamp[19] = -1.4; igndClamp[19] = -0.37;
vgndClamp[18] = -1.5; igndClamp[18] = -0.45;
vgndClamp[17] = -1.6; igndClamp[17] = -0.53;
vgndClamp[16] = -1.7; igndClamp[16] = -0.61;
vgndClamp[15] = -1.8; igndClamp[15] = -0.69;
vgndClamp[14] = -1.9; igndClamp[14] = -0.77;
vgndClamp[13] = -2; igndClamp[13] = -0.85;
vgndClamp[12] = -2.1; igndClamp[12] = -0.93;
vgndClamp[11] = -2.2; igndClamp[11] = -1.01;
vgndClamp[10] = -2.3; igndClamp[10] = -1.09;
vgndClamp[9] = -2.4; igndClamp[9] = -1.17;
vgndClamp[8] = -2.5; igndClamp[8] = -1.24;
vgndClamp[7] = -2.6; igndClamp[7] = -1.32;
vgndClamp[6] = -2.7; igndClamp[6] = -1.4;
vgndClamp[5] = -2.8; igndClamp[5] = -1.48;
vgndClamp[4] = -2.9; igndClamp[4] = -1.56;
vgndClamp[3] = -3; igndClamp[3] = -1.64;
vgndClamp[2] = -3.1; igndClamp[2] = -1.72;
vgndClamp[1] = -3.2; igndClamp[1] = -1.8;
vgndClamp[0] = -3.3; igndClamp[0] = -1.88;
// pwrClamp V/I table
vpwrClamp[33] = 0; ipwrClamp[33] = 2.75e-12;
vpwrClamp[32] = -0.1; ipwrClamp[32] = 3.08e-12;
vpwrClamp[31] = -0.2; ipwrClamp[31] = 3.53e-12;
vpwrClamp[30] = -0.3; ipwrClamp[30] = 4.05e-12;
vpwrClamp[29] = -0.4; ipwrClamp[29] = 2.504e-11;
vpwrClamp[28] = -0.5; ipwrClamp[28] = 1.01e-09;
vpwrClamp[27] = -0.6; ipwrClamp[27] = 4.808e-08;
vpwrClamp[26] = -0.7; ipwrClamp[26] = 2.3e-06;
vpwrClamp[25] = -0.8; ipwrClamp[25] = 0.00011;
vpwrClamp[24] = -0.9; ipwrClamp[24] = 0.00524;
vpwrClamp[23] = -1; ipwrClamp[23] = 0.11;
vpwrClamp[22] = -1.1; ipwrClamp[22] = 0.27;
vpwrClamp[21] = -1.2; ipwrClamp[21] = 0.43;
vpwrClamp[20] = -1.3; ipwrClamp[20] = 0.58;
vpwrClamp[19] = -1.4; ipwrClamp[19] = 0.74;
vpwrClamp[18] = -1.5; ipwrClamp[18] = 0.9;
vpwrClamp[17] = -1.6; ipwrClamp[17] = 1.05;
vpwrClamp[16] = -1.7; ipwrClamp[16] = 1.21;
vpwrClamp[15] = -1.8; ipwrClamp[15] = 1.37;
vpwrClamp[14] = -1.9; ipwrClamp[14] = 1.52;
vpwrClamp[13] = -2; ipwrClamp[13] = 1.68;
vpwrClamp[12] = -2.1; ipwrClamp[12] = 1.84;
vpwrClamp[11] = -2.2; ipwrClamp[11] = 2;
vpwrClamp[10] = -2.3; ipwrClamp[10] = 2.15;
vpwrClamp[9] = -2.4; ipwrClamp[9] = 2.31;
vpwrClamp[8] = -2.5; ipwrClamp[8] = 2.47;
vpwrClamp[7] = -2.6; ipwrClamp[7] = 2.63;
vpwrClamp[6] = -2.7; ipwrClamp[6] = 2.78;
vpwrClamp[5] = -2.8; ipwrClamp[5] = 2.94;
vpwrClamp[4] = -2.9; ipwrClamp[4] = 3.1;
vpwrClamp[3] = -3; ipwrClamp[3] = 3.26;
vpwrClamp[2] = -3.1; ipwrClamp[2] = 3.41;
vpwrClamp[1] = -3.2; ipwrClamp[1] = 3.57;
vpwrClamp[0] = -3.3; ipwrClamp[0] = 3.73;
end
//
if (pol == 1) dataIn = V(chip_sig) - V(gnd);
else if (pol == -1) dataIn = V(pwr) - V(chip_sig);
if (enaType == 1) enaIn = V(enable) - V(gnd);
else if (enaType == -1) enaIn = V(pwr) - V(enable);
vup0 = V(chip_pad);
if ((dataIn > thresh) && (enaIn > thresh)) begin
vup0 = V(pwr);
end
else begin
vup0 = V(chip_pad);
end
vup1 = slew(vup0, 6.74138e+09, -1e15) - V(chip_pad);
if (vup1 < vpullup[0]) 
iup = ipullup[0];
else if (vup1 > vpullup[`npullup - 1])
iup = ipullup[`npullup - 1];
else begin
//generate j (0, `npullup - 1) begin
    for (j=0; j< `npullup; j=j+1) begin
if ((vup1 > vpullup[j])&&(vup1 <= vpullup[j+1])) begin
// this bit of foolishness to avoid a bogus devide-by-zero message
denom = vpullup[j+1] - vpullup[j];
iup = ipullup[j] + (vup1 - vpullup[j]) * (ipullup[j+1] - ipullup[j]) / denom;
end
end
end
if ((dataIn < thresh) && (enaIn > thresh)) begin
vdn0 = V(gnd);
end
else begin
vdn0 = V(chip_pad);
end
vdn1 = V(chip_pad) - slew(vdn0, 1e15, -7.52858e+09);
if (vdn1 < vpulldown[0]) 
idn = ipulldown[0];
else if (vdn1 > vpulldown[`npulldown - 1])
idn = ipulldown[`npulldown - 1];
else begin
//generate j (0, `npulldown - 1) begin
    for(j=0; j < `npulldown; j=j+1) begin
if ((vdn1 > vpulldown[j])&&(vdn1 <= vpulldown[j+1])) begin
// this bit of foolishness to avoid a bogus devide-by-zero message
denom = vpulldown[j+1] - vpulldown[j];
idn = ipulldown[j] + (vdn1 - vpulldown[j]) * (ipulldown[j+1] - ipulldown[j]) / denom;
end
end
end
I(chip_pad, pwr) <+ iup;
I(chip_pad, gnd) <+ idn;
vgnd = V(chip_pad, gnd);
if (vgnd < vgndClamp[0]) 
ignd = igndClamp[0];
else if (vgnd > vgndClamp[`ngndClamp - 1])
ignd = igndClamp[`ngndClamp - 1];
else begin
//generate j (0, `ngndClamp - 1) begin
    for(j=0; j<`ngndClamp; j=j+1) begin
if ((vgnd > vgndClamp[j])&&(vgnd <= vgndClamp[j+1])) begin
// this bit of foolishness to avoid a bogus devide-by-zero message
denom = vgndClamp[j+1] - vgndClamp[j];
ignd = igndClamp[j] + (vgnd - vgndClamp[j]) * (igndClamp[j+1] - igndClamp[j]) / denom;
end
end
end
I(chip_pad, gnd) <+ ignd;
vpwr = V(pwr, chip_pad);
if (vpwr < vpwrClamp[0]) 
ipwr = ipwrClamp[0];
else if (vpwr > vpwrClamp[`npwrClamp - 1])
ipwr = ipwrClamp[`npwrClamp - 1];
else begin
//generate j (0, `npwrClamp - 1) begin
    for(j=0; j<`npwrClamp; j=j+1) begin
if ((vpwr > vpwrClamp[j])&&(vpwr <= vpwrClamp[j+1])) begin
// this bit of foolishness to avoid a bogus devide-by-zero message
denom = vpwrClamp[j+1] - vpwrClamp[j];
ipwr = ipwrClamp[j] + (vpwr - vpwrClamp[j]) * (ipwrClamp[j+1] - ipwrClamp[j]) / denom;
end
end
end
I(chip_pad, pwr) <+ ipwr;
// tristate or assert chip_sig depending on enable
if (enaIn > thresh) begin
rupval = 1e12;
rdnval = 1e12;
end
else begin
if (V(chip_pad) > 1.0625) begin
rupval = 1e-3;
rdnval = 1e12;
end
else begin
rupval = 1e12;
rdnval = 1e-3;
end
end
I(chip_sig, pwr) <+ V(chip_sig, pwr) / rupval;
I(chip_sig, gnd) <+ V(chip_sig, gnd) / rdnval;
end
endmodule
// Resistor, Inductor, and Capacitor modules
module ibisRes(n1, n2);
inout n1, n2;
electrical n1, n2;
parameter real R = 1.0;
analog begin
V(n1, n2) <+ I(n1, n2) * R;
end
endmodule
 
module ibisCap(n1, n2);
inout n1, n2;
electrical n1, n2;
parameter real C = 1e-12;
analog begin
I(n1, n2) <+ ddt(C * V(n1, n2));
end
endmodule

module ibisInd(n1, n2);
inout n1, n2;
electrical n1, n2;
parameter real L = 1e-12;
analog begin
V(n1, n2) <+ ddt(L * I(n1, n2));
end
endmodule
Received on Tue Aug 2 12:40:13 2005

This archive was generated by hypermail 2.1.8 : Tue Aug 02 2005 - 12:40:18 PDT