Mind Jammed ! What will be the sensitivity list for the code below?

Hello All,

Was kind-off skeptic about the way code in the sensitivity list gets created. Let me know your view.


 always_comb
    begin
      if (clktk)
        state_nxt = {evt_m, state_r, ip_r};
      else
        state_nxt = state_r;
    end

What will be the sensitivity list for the above code ? Does even the clktk also gets into the list ? Or Not ?


 forever@(clktk, evt_m, state_r, ip_r) // Note: Does clktk also gets into the sensitivity list or not ?
  begin
    if (clktk)
      state_nxt = {evt_m, state_r, ip_r};
    else
      state_nxt = state_r;
  end

Share your inputs/view.

Thanks,
Desperado

The way to look at an always_comb block is to ask what it is not in the sensitivity list. There are only two exceptions to the implicit sensitivity list: local variables declared within the always block, and variables written to as part of the LHS expression of an assignment are not included. So state_nxt is not in the sensitivity list.

In your forever block statement, you are explicitly listing the variable sensitivity, so there should be no question about which variables are in the list.
You could replace the explicit list with @, but there are a few minor differences listed in section _9.2.2.2.2 always_comb compared to always @_, mostly how @* ignores sensitivity introduced by function calls.

In reply to dave_59:

Thanks Dave for your inputs !! I wish we had such option like forever @(*) [inside a task]? Does the tool support such format ? [i.e. Questa, VCS, Incisive etc !]. VCS throws not supported format. Can you kindly clarify on it !

Thanks,
Desperado