Often it's desirable to monitor the status of a signal and display messages whenever it changes. A good example for this is an interrupt signal. Here presented are two possibilities for implementing this:
-- report changes of the interrupt signal monitor: process(INT_L) begin print("I@TB: INT_L="& str(INT_L)); end process monitor;The process will be executed each time there is an event on INT_L. Whenever that happens a message will be printed.
Here is an alternative using an extensions of the print command which is available in txt_util.vhd:
-- report when interrupt is asserted print(INT_L'event and INT_L = '0', "I@TB: INT_L="& str(INT_L));This function has as a first parameter a boolean expression and as the second parameter a message text. The message text will be printed whenever the boolean expression is true. (In this case whenever INT_L changes to '0'). The function does not need to be part of a process, it can be used as a concurrent statement.
Below are the files which have been simulated in this section:
txt_util.vhd | simple_mon.vhd |