PROCEDURE
thank_you
IS
BEGIN
ASSERT
false
REPORT
"Thank You !"
SEVERITY
note ;
END
thank_you ;
|
Definition of the procedure
thank_you
.
If the condition
false
is not fulfilled
"Thank You !" is reported as
note
in the severity level.
|
FUNCTION
convert(B : Bit )
RETURN
fuzzy_bit
IS
VARIABLE
v : fuzzy_bit ;
BEGIN
IF
B = '1'
THEN
v := High ;
ELSE
v := Low ;
END IF
;
RETURN
v ;
END
convert ;
|
Definition of the function
convert
with the transfer
value
B
and the result type
fuzzy_bit
.
In the If-loop the variable
v
is assigned the value
High or Low depending on the value of
B
.
v
is transferred as transfer value.
|
PROCEDURE
regist(
SIGNAL
D :
IN
Bit ;
SIGNAL
CK :
IN
Bit ;
SIGNAL
Q :
OUT
Bit )
IS
BEGIN
LOOP
WAIT ON
CK ;
IF
CK = '1'
THEN
Q <= D
AFTER
1 ns ;
END IF
;
END LOOP
;
END
regist ;
|
Definition of the procedure
regist
with the
transfer values of the signals
D
,
CK
and
Q
.
Within the endless loop (LOOP) a register
is declared which takes on the value of input
D
from
output
Q
at the positive clock-edge with a delay of 1 ns.
|
PROCEDURE
p(
VARIABLE
COL :
INOUT
color ;
CONSTANT
C :
IN
choice )
IS
SUBTYPE
primary_color
IS
color
RANGE
yellow
TO
red ;
VARIABLE
X, Y, Z : primary_color ;
BEGIN
...
...
END
p ;
|
Definition of the procedure
p;
transfer values of the
variable
COL
and the constant
C
.
The subtype
primary_color
is declared from
the type
colour
with a range of
yellow
to
red
(from the enumeration type
colour
).
The variables
X
,
Y
and
Z
are declared.
|
FUNCTION
exfunc
RETURN
INTEGER
;
ATTRIBUTE FOREIGN OF
exfunc
FUNCTION
IS
"C:modellib.so.0.1 ELAB:mod_lab";
|
The external function
exfunc
is declared.
The attribute
FOREIGN
of
exfunc
gets (simulator-)
program specific information.
|