Always_ff event controls

In reply to manjush_pv:

See section 9.4.2 Event Controls Statement 5 is an error because you can’t perform any logical or arithmetic operation on an event expression. Statements 3 and 4 are creating event expressions from the result of logical expression (clk || rat). It the same as if you had written

assign temp = clk || rest;
always_ff @(posedge temp)

An event control is @(event_expression). As long as there is one ‘@’ then that is valid for always_ff, Synthesis coding rules require that the synchronous and asynchronous be listed in the single event control.

Most synthesis tool do not allow more than one event control in any always block, but higher level synthesis tool, and any code you write that will not be synthesized can have more than one event control

always begin
     @(posedge clk)
        state = s1;
     @(posedge clk)
       state = s2;
     end