Well, like I hinted above: if you want it to be synthesizable, it should be clock-based. So the quick answer is: forget about events and think about a clocked state machine.
I assume EVENT1 is an asynchronous input? So I would put it through a shift register of 3 flipflops. The first 2 are to synchronize it to the clock domain; the 3rd flop is to detect changes. Maybe like this:
- Code: Select all
reg sr[2:0];
always @(posedge clk) sr <= { sr[1:0], input1 };
wire rising_edge_seen = sr[1] & ~sr[2];
Then maybe use "rising_edge_seen" as an input to a synchronous state machine (which would also manage the counter: strictly speaking, the counter is part of its state).
I'm not going to go into any more detail, because I didn't understand your description. I didn't know what you meant by EVENT2 having to "go on and complete itself". Events are atomic. It sounds more like a timer than an event.
Sorry if that's not the kind of answer you wanted, but I don't think there's any better way to design it, than as a state machine with a built-in counter.
Regards,
Nick