23.01.2015 Views

Download - Wolfram Research

Download - Wolfram Research

Download - Wolfram Research

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.2 Subcircuit and Device Model Definition 195<br />

Internally, all model selectors are converted to strings. Therefore, Selector−>symbol and<br />

Selector−>ToString[symbol] are equivalent selector specifications.<br />

Likewise, you can specify the selector in a model reference (see Section 3.1.8) either as a<br />

symbol or a string regardless of the data type used in the model definition.<br />

Scope<br />

Scope−>Local<br />

Scope−>Global<br />

restrict the visibility of the model definition to the<br />

surrounding Circuit object<br />

store the model definition in the global subcircuit database<br />

Format of the Scope argument.<br />

The optional argument Scope determines the scope of the model definition. With the default setting<br />

Scope −> Local, the model can only be referenced from Netlist objects inside the Circuit object<br />

that contains the corresponding Model statement. With Scope −> Global, the model is stored in the<br />

global subcircuit database and can be accessed by other Circuit objects.<br />

You can use the Scope mechanism to implement a library of frequently used device models separately<br />

from any top-level circuit description and load the models into Analog Insydes’ global subcircuit<br />

database. This can be accomplished by implementing a set of models in a Mathematica *.m file as<br />

illustrated below.<br />

(* Begin MyModels.m *)<br />

Circuit[<br />

Model[Name −> "BJT", Selector −> "AC", Scope −> Global, <br />

Definition −> ],<br />

Model[Name −> "MOSFET", Selector −> "AC", Scope −> Global, <br />

Definition −> ],<br />

<br />

] // ExpandSubcircuits;<br />

(* End MyModels.m *)<br />

The library file "MyModels.m" can then be loaded using the command Get["MyModels.m"].<br />

See also: GlobalSubcircuits (Section 3.3.4), RemoveSubcircuit (Section 3.3.8).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!