Page 88 - Mechatronic Systems Modelling and Simulation with HDLs
P. 88
4.5 MODELLING PARADIGMS 77
Alternatively, a sequential description can also be provided, see Hardware des-
cription 4.9. Here the causality is specified by the assignments. However, some
possibilities for sequential modelling exist such as the use of IF-THEN-ELSE con-
structs, CASE instructions or loops, meaning that this form of modelling also has
its attraction. However formulated, the two descriptions should, however, supply
the same outputs.
ARCHITECTURE procedural OF diode IS
QUANTITY ud ACROSS id, ic THROUGH anode TO cathode;
QUANTITY q: real;
CONSTANT ut: voltage := 0.0258;
BEGIN
p1: PROCEDURAL BEGIN -- defining assignments
id := is0*(exp((ud-rd*id)/ut)-1.0);
q := tau*id TOLERANCE "charge";
ic := q’DOT;
END PROCEDURAL;
END ARCHITECTURE procedural;
Hardware description 4.9 Sequential behavioural description of a diode
Physical domains and associated quantities
When describing analogue relationships in VHDL-AMS the physical domains that
can be described are not specified in advance. Rather, it is even possible to declare
domains with their associated quantities subsequently. Here a differentiation is
made between potentials and flows, which are declared by the keywords ACROSS
and THROUGH. For electronics these may be voltage and current. Hardware descrip-
tion 4.10 shows the corresponding declaration as PACKAGE.
PACKAGE electrical_system IS
SUBTYPE voltage IS real TOLERANCE "low_voltage";
SUBTYPE current IS real TOLERANCE "low_current";
NATURE electrical IS
voltage ACROSS; -- Potential
current THROUGH; -- Flow
ALIAS ground IS electrical’reference;
...
END PACKAGE electrical_system;
Hardware description 4.10 Declaration of electrical potentials and flows
In the same manner, potentials and flows can be declared to arbitrary other
domains. For translational mechanics these might be velocity and force; for rota-
tional mechanics, rotational velocity and torque.
In a model the quantities used can be declared as either a THROUGH or an ACROSS
QUANTITY. This is a real number that describes a continuous variable. Kirchhoff’s