Does VHDL have a statement similar to "event" in Verilog?

N

news reader

I use "event" to trigger comparison in Verilog testbenches.
Are there similar statements in VHDL?

Thanks.
 
E

Evan Lavelle

I use "event" to trigger comparison in Verilog testbenches.
Are there similar statements in VHDL?

Do you mean named events (ie. event X/->X/@X?) This is easy - just
make X a signal in a package; any architecture which can see the
package can then drive or respond to the signal (google for 'global
signal' if you haven't used package signals before).

The obvious implementation is to make X a std_logic, manually toggle
it when you want to raise an event, and test for X'event in an if
statement (something like "if X='1' and X'event", like waiting for a
clock edge).

A better solution is to use X'transaction. When you raise the signal,
you now don't need to change its value; X'transaction automatically
toggles for you, even if you always assign the same value to X. You
can use X'transaction directly inside a sensitivity list, so that

always
begin
@hierarchical_path.X
...
end

becomes the (almost) equivalent:

process
begin
...
wait on X'transaction;
end process;

Even better, you can make your global signal a record, and pass useful
information to your receiver process, which is much more klunky in the
Verilog version. To do this, load the required data into a variable of
the record type, and then assign your complete variable to signal X.

Evan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,017
Latest member
GreenAcreCBDGummiesReview

Latest Threads

Top