1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
/* autogenerated from "macros/Electrical/PMOS.sci" */
function PMOS() {
PMOS.prototype.define = function PMOS() {
model = scicos_model();
this.W = 50.0e-6;
this.L = 6.0e-6;
this.Beta = 0.0105e-3;
this.Vt = -1;
this.K2 = 0.41;
this.K5 = 0.839;
this.dW = -2.5e-6;
this.dL = -2.1e-6;
this.RDS = 1.e+7;
model.sim = "PMOS";
model.blocktype = "c";
model.dep_ut = [true,false];
mo = modelica();
mo.model = "PMOS";
mo.outputs = [["D"],["B"],["S"]];
mo.inputs = "G";
mo.parameters = list([["W"],["L"],["Beta"],["Vt"],["K2"],["K5"],["dW"],["dL"],["RDS"]],[[this.W],[this.L],[this.Beta],[this.Vt],[this.K2],[this.K5],[this.dW],[this.dL],[this.RDS]]);
model.equations = mo;
model.in1 = ones(size(mo.inputs,"*"),1);
model.out = ones(size(mo.outputs,"*"),1);
exprs = [[string(this.W)],[string(this.L)],[string(this.Beta)],[string(this.Vt)],[string(this.K2)],[string(this.K5)],[string(this.dW)],[string(this.dL)],[string(this.RDS)]];
gr_i = [];
this.x = standard_define([2,2],model,exprs,gr_i);
this.x.graphics.in_implicit = ["I"];
this.x.graphics.out_implicit = [["I"],["I"],["I"]];
return new BasicBlock(this.x);
}
PMOS.prototype.details = function PMOS() {
return this.x;
}
PMOS.prototype.get = function PMOS() {
var options = {
W:["Width [m]",this.W],
L:["Length [m]",this.L],
Beta:["Transconductance parameter [A/(V*V)]",this.Beta],
Vt:["Zero bias threshold voltage [V]",this.Vt],
K2:["Bulk threshold parameter",this.K2],
K5:["Reduction of pinch-off region",this.K5],
dW:["Narrowing of channel [m]",this.dW],
dL:["Shortening of channel [m]",this.dL],
RDS:["Drain-Source-Resistance [Ohm]",this.RDS],
}
return options;
}
PMOS.prototype.set = function PMOS() {
this.W = parseFloat((arguments[0]["W"]))
this.L = parseFloat((arguments[0]["L"]))
this.Beta = parseFloat((arguments[0]["Beta"]))
this.Vt = parseFloat((arguments[0]["Vt"]))
this.K2 = parseFloat((arguments[0]["K2"]))
this.K5 = parseFloat((arguments[0]["K5"]))
this.dW = parseFloat((arguments[0]["dW"]))
this.dL = parseFloat((arguments[0]["dL"]))
this.RDS = parseFloat((arguments[0]["RDS"]))
this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
[ok,this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS,exprs] = scicos_getvalue("Set PMOS Transistor parameters",["Width [m]","Length [m]","Transconductance parameter [A/(V*V)]","Zero bias threshold voltage [V]","Bulk threshold parameter","Reduction of pinch-off region","Narrowing of channel [m]","Shortening of channel [m]","Drain-Source-Resistance [Ohm]"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs);
if (!ok) {
break;
}
model.equations.parameters[2-1] = list(this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS);
graphics.exprs = exprs;
this.x.graphics = graphics;
this.x.model = model;
break;
}
return new BasicBlock(this.x);
}
}
|