Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Where are the multiple disciplines in this example?

Status
Not open for further replies.

ruwan2

Member level 5
Member level 5
Joined
Nov 29, 2011
Messages
90
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
2,141
Hi,
I learn Verilog_ams. In its reference book, it has the following example, but I do not see any discipline inside it. There is no discipline keyword at all. Could you explain it to me?


Thanks,





....................
Multi-disciplinary example
Disciplines in Verilog-AMS HDL allow designs of multiple disciplines to be easily defined and simulated.
Disciplines can be used to allow unique tolerances based on the size of the signals and outputs displayed in
the actual units of the discipline. This example shows how an application spanning multiple disciplines can
be modeled in Verilog-AMS HDL. It models a DC-motor driven by a voltage source.

module motorckt;
parameter real freq=100;
electrical gnd; ground gnd;
electrical drive;
rotational shaft;
motor m1 (drive, gnd, shaft);
vsine #(.freq(freq), .ampl(1.0)) v1 (drive, gnd);
endmodule
// vp: positive terminal [V,A] vn: negative terminal [V,A]
// shaft:motor shaft [rad,Nm]
// INSTANCE parameters
// Km = motor constant [Vs/rad] Kf = flux constant [Nm/A]
// j = inertia factor [Nms^2/rad] D= drag (friction) [Nms/rad]
// Rm = motor resistance [Ohms] Lm = motor inductance [H]
// A model of a DC motor driving a shaft
module motor(vp, vn, shaft);
inout vp, vn, shaft;
electrical vp, vn;
rotational shaft;
parameter real Km = 4.5, Kf = 6.2;
parameter real j = 0.004, D = 0.1;
parameter real Rm = 5.0, Lm = 0.02;
analog begin
V(vp, vn) <+ Km*Theta(shaft) + Rm*I(vp, vn) + ddt(Lm*I(vp, vn));
Tau(shaft) <+ Kf*I(vp, vn) - D*Theta(shaft) - ddt(j*Theta(shaft));
end
endmodule
 

Here the modules (motorckt & motor) are constructed using two disciplines, "electrical" and "rotational". These disciplines are pre-defined in the "disciplines.vams" file with their associated natures. You can access the voltage & current of the ports that you have declared as 'electrical" (vp, vn, drive). For the rotational ports (shaft) you can access their angle and angular force. Capture.PNG
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top