Here is the code:
wait for 1 ns;
print("x is checked, last changed at " & time'image(x'last_event));
wait for 10 ns;
print("x is checked, last changed at " & time'image(x'last_event));
wait for 100 ns;
print("x is checked, last changed at " & time'image(x'last_event));
wait for 100 ns;
print("x is checked, last changed at " & time'image(x'last_event));
wait for 100 ns;
print("x is checked, last changed at " & time'image(x'last_event));
The print command is from VUnit. It just prints to stdout.
Here is the result:
# ** Note: (vsim-12125) Error and warning message counts have been reset to '0' because of 'restart'.
# ** Note: (vsim-8009) Loading existing optimized design _opt
# ** Note: (vsim-12126) Error and warning message counts have been restored: Errors=0, Warnings=2.
# x is checked, last changed at 1000 ps
# x is checked, last changed at 11000 ps
# x is checked, last changed at 11000 ps
# x is checked, last changed at 61000 ps
# x is checked, last changed at 61000 ps
The time values are printed in ps. What is the method to change the output to use a different time unit like ns or us? I could do this by writing my own function of course. However, there must be something that can be done via the tool settings or using VHDL attribute perhaps.