Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17257 Discussions

attribute 'event usage within procedure

Altera_Forum
Honored Contributor II
1,324 Views

Hi, 

 

I'm having a procedure (non-synthesizable code) and I am trying to use the 'event attribute on a signal declared as input to the procedure: 

 

procedure priority_req(signal tb_control : in t_tb_control) is begin while (tb_control.command /= priority_grant) loop wait for tb_control.cycle_time; wait until tb_control.command'event; end loop; end priority_req;  

 

tb_control is a signal (although mode 'in' within procedure) of type t_command 

where t_command is a record. 

 

From the compiler I am getting the error: 

Error, attribute event is only defined for signals. 

 

I have tried all language syntaxes from '87 to '2008, all see it as an error. 

 

Does anyone have an ideea how I can fix/rewrite it so it gets compiled?
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
625 Views

thats because the 'event attribute is not a signal, and hence cannot be waited on. 

 

instead, use: 

 

wait on tb_control.command;
0 Kudos
Altera_Forum
Honored Contributor II
625 Views

@Tricky 

thank you, the compiler is happy with "wait on". 

 

Is "wait on signal" accomplished on assignment of signal or value change?
0 Kudos
Altera_Forum
Honored Contributor II
625 Views

Wait on waits until an event occurs on the signals in the list, so you can list multiple signals.

0 Kudos
Altera_Forum
Honored Contributor II
625 Views

If you want to wait until the the assignment of a signal, you can use: 

 

wait on my_signal'transaction; 

 

So in this case it is every time a signal is assigned, even if it is from the same state, eg: 

 

my_signal <= '1'; wait for 10 ns; my_signal <= '1';  

 

creates 2 'transactions.
0 Kudos
Altera_Forum
Honored Contributor II
625 Views

I am using HDL Designer flow and the error I initially mentioned occurs in the "Generation step" of the ModelSim TCL flow. 

With the proposed 'transaction attribute the tool passes the generation step but triggeres a compile error in ModelSim: 

 

wait on tb_control.command'transaction; 

tb_control is a record containing a signal "command" 

 

ModelSim error: Attribute "transaction" may not be read from formal signal parameter "tb_control". VHDL Compiler exiting 

 

It seems that various tools interpret these attributes differently: 

1. ModelSim accepts 'event, HDL Designer doesn't 

2. HDL Designer accepts 'transaction, ModelSim doesn't
0 Kudos
Reply