Vous êtes sur la page 1sur 5

HSPICE vs MAPP

Comparison of features with simple circuita

Parallel RC
Circuit

C = 1F,Vc=2V
Snapshot of HSPICE
code
.option post

R = 1k

n1
Gnd

Snapshot of MAPP
Code
clear
ntlst;
ntlst.cktname = 'rc';
% parallal RC circuit
ntlst.nodenames = {'n1'}; % non-ground nodes
ntlst.groundnodename = 'gnd';
ntlst = add_element(ntlst, resModSpec(), 'r1', {'n1', 'gnd'},
...
{{'R', 1000}}, {});
ntlst = add_element(ntlst, capModSpec(), 'c1', {'n1',
'gnd'}, ...
1e-6, {});
DAE = MNA_EqnEngine(ntlst);
dcop = dot_op(DAE);
feval(dcop.print, dcop);
xinit = 2; %Initial capacitor voltage
tstart = 0; tstep = 0.5e-6; tstop = 5e-3; %transient
LMSobj = dot_transient(DAE, xinit, tstart, tstep, tstop);
feval(LMSobj.plot, LMSobj);
souts = StateOutputs(DAE);
souts = souts.DeleteAll(souts);
souts = souts.Add({'e_n1'}, souts);
feval(LMSobj.plot, LMSobj, souts);

r1 1 0 1000
c1 1 0 1u
.ic V(1)=2
.print tran v(1) i(c1) i(r1) i(v1)
.option delmax=1
.tran 1.5u .005 UIC
.end

Modular approach in
MAPP
With parallel RC circuit

C = 1F,Vc=2V
R = 1k

n1
Snapshot of MAPP
Code
clear
ntlst;

Gnd

ntlst.cktname = 'rc';
% parallal RC circuit
ntlst.nodenames = {'n1'}; % non-ground nodes
ntlst.groundnodename = 'gnd';
ntlst = add_element(ntlst, resModSpec(), 'r1', {'n1', 'gnd'},
...
{{'R', 1000}}, {});
ntlst = add_element(ntlst, capModSpec(), 'c1', {'n1',
'gnd'}, ... 1e-6, {});
DAE = MNA_EqnEngine(ntlst);
dcop = dot_op(DAE);
feval(dcop.print, dcop);
xinit = 2; %Initial capacitor voltage
tstart = 0; tstep = 0.5e-6; tstop = 5e-3; %transient
LMSobj = dot_transient(DAE, xinit, tstart, tstep, tstop);
feval(LMSobj.plot, LMSobj);
souts = StateOutputs(DAE);
souts = souts.DeleteAll(souts);
souts = souts.Add({'e_n1'}, souts);
feval(LMSobj.plot, LMSobj, souts);

function MOD = myR()


MOD = ee_model();
MOD = add_to_ee_model(MOD, 'name', 'myR');
MOD = add_to_ee_model(MOD, 'terminals', {'p', 'n'});
MOD = add_to_ee_model(MOD, 'explicit_outs', {'ipn'});
MOD = add_to_ee_model(MOD, 'parms', {'R', 1000.0});
MOD = add_to_ee_model(MOD, 'fe', @fe);
MOD = add_to_ee_model(MOD, 'qe', @qe);
MOD = finish_ee_model(MOD);
end % myR
function out = fe(S)
v2struct(S);
ipn_fe = vpn/R;
out(1, 1) = ipn_fe;
end % fe
function out = qe(S)
v2struct(S);
ipn_qe = 0;
out(1, 1) = ipn_qe;
end % qe
function MOD = myC()
MOD = ee_model();
MOD = add_to_ee_model(MOD, 'name', 'myC');
MOD = add_to_ee_model(MOD, 'terminals', {'p', 'n'});
MOD = add_to_ee_model(MOD, 'explicit_outs', {'ipn'});
MOD = add_to_ee_model(MOD, 'parms', {'C', 1e-6});
MOD = add_to_ee_model(MOD, 'fe', @fe);
MOD = add_to_ee_model(MOD, 'qe', @qe);
MOD = finish_ee_model(MOD);
end % myC
function out = fe(S)
v2struct(S);
ipn_fe = 0;
out(1, 1) = ipn_fe;
end % fe
function out = qe(S)
v2struct(S);
ipn_qe = C*vpn;
out(1, 1) = ipn_qe;
end % qe

MATLAB vs HSPICE
MATLAB
Advantage in Circuit
Simulation
1. Wide range of functional
features with multipurpose
usage.
2.Availability of vrious
toolbox that can be
incorporated
Disadvanatge
1.Difficulty in defining
circuits without available
analytical expression
2.Slow compared to SPICE

SPICE
Advantage in Circuit Simulation
1.Widely used in last 30 years with inbuilt
circuit functions
2.Highly popular in industry
3.Produce results fast
4.Syntax based approach. Easy to develop
large circuits with repetitive elements with
nodal features through modular approach
Disadvantage
1.Diffiiculty in converging with analytical
expression, the software being a black box
2.Lack of user-friendly GUI unlike MATLAB
3.Often requires client-server connections to
access from terminal PC
4.Dificulty in verifying or debugging
discrepancies for the lack of inbuilt sourcecode
5.Difficulty in adding new features in the circuit
parameters

MATLAB vs HSPICE vs MAPP


MATLAB
Advantage in Circuit Simulation
1. Wide range of functional features with multipurpose usage.
2.Availability of various toolbox that can be incorporated
Disadvantage
1.Difficulty in defining circuits without available analytical
expression
2.Slow compared to HSPICE
HSPICE
Advantage in Circuit Simulation
1.Widely used in last 30 years with various inbuilt circuit
functions
2.Highly popular in industry
3.Produce results fast
4.Syntax based approach. Easy to develop large circuits with
repetitive elements following nodal features through modular
approach
Disadvantage
1.Diffiiculty in converging with analytical expression, the
software acting as black-box
2.Lack of user-friendly GUI unlike MATLAB
3.May require client-server connections to access from
terminal PC
4.Dificulty in verifying or debugging discrepancies for the lack
of inbuilt source-code

MAPP
Advantage in Circuit Simulation
1.Use MATLAB's features and inbuilt
functions to provide wide-purpose
analytical formalism
2.Provides means to debug, verify
discrepancies to deal with convergence
issues
3.Use HSPICE's advantages such as
transient simulations with a modular
functional approach with MODSPEC and
DAE
4.Keeps the code transparent, unlike
HSPICE's blackbox features
5.Excellent GUI
Disadvanatge
1.Often requires longer code compared to
HSPICE
2.Application of modular approach
requires more attention beyond nodal
placements

Vous aimerez peut-être aussi