Is it possible to synthesize an enable signal that asserts on a cycle if and only if an interface method/task is invoked on that cycle? Something similar to the following is desired:
interface RAM (logic clk);
logic enable;
// ...
always_ff @(posedge clk) enable = 0;
task Read(input address_t address);
enable = 1;
// ...
endtask
//...
modport server(input clk, input enable, ...);
modport client(input clk, export Read, ...);
endinterface
Clearly the above is illegal. The only idea I've had is to save the previous state, compare if the current and previous assignment are the same or not in the always_ff, and negate in the task invocation. That doesn't seem practical though - it's very specific and thus less likely to be optimized away during P&R. What I really need is a logic element with the semantics that when assign to it takes the value assigned, otherwise it goes to a default value.
Readis called? IsReada blocking task, or is it really a function? - dave_59enableis set either before or after thealwaysthat wants to clear it, or is there a race? Can you draw a circuit diagram of what you want to happen? - EML