Professional Documents
Culture Documents
1) Array attributes
2) Type attributes
3) Signal attributes
Examples:
Examples:
If s1 has had a transaction in the current simulation cycle, s1’ACTIVE will be TRUE for this
simulation cycle.
‘LAST_ACTIVE TR s1’LAST_ACTIVE VALUE TIME
A signal that is TRUE if s1 has not changed in the last 5 NS. If no parameter or 0, the resulting signal is
TRUE if s1 has not changed in the current simulation time.
A signal that is TRUE if no transaction has been placed on s1 in the last 5 NS. If no parameter or 0, the
current simulation cycle is assumed.
A signal that toggles each time a transaction occurs on s1. Initial value of this attribute is not defined.
Entity attr_ex is
End attr_ex;
Begin
A <= B and C;
Check: process
Begin
Assert (D’stable(setup_time))
Severity error;
Assert (D’stable(hold_time))
Severity error;
procedure Addvec2
(Add1,Add2: in bit_vector;
Cin: in bit;
begin
severity error;
end loop;
Cout <= C;
end Addvec2;
Z1
Z2
Z3
0 10 20 30 40 50
1. Write a VHDL function that will take two integer vectors, A and B, and find the
dot product C=å ai * bi. The function call should be of the form DOT (A, B),
where A and B are integer vector signals. Use attributes inside the function to
determine the length and ranges of the vectors. Make no assumptions about
the high and low values of the ranges. For example:
C = 3 * 6 + 2 * 5 + 1 * 4 = 32
Begin
Assert (A’Range = B’Range)
Severity warning;
Severity error;
End loop;
Return sum;
End DOT;
2.AVHDL entity has inputs A and B, and outputs C and D. A and B are initially high.
Whenever A goes low, C will go high 5 ns later, and if A changes again, C will
change 5 ns later. D will change if A has not had any transactions for 5 ns.
Write the VHDL architecture with a process that determines the outputs C and D.
Entity dm is
C, D: inout bit);
End dm;
Architecture dm of dm is
Begin
Begin