1

I want to emit an event only at the first rising edge of clock.

for example

event clkr_e is rise ('pll_clk') @ sim; 

clkr_e is emitted at every rising clock.

But I need to emit an event only at first rising edge of pll_clk. Could any one please shed some light on this.

Thanks.

Ross Rogers
  • 23,523
  • 27
  • 108
  • 164
kumar
  • 11
  • 1

1 Answers1

1

Use a flag:

clk_has_risen : bool;
keep clk_has_risen == FALSE;

event first_clk_rise_e is true(clk_has_risen == FALSE) @ clkr_e;
on first_clk_rise_e {
    clk_has_risen = TRUE;
};

Also, this is a performance no-no:

event clkr_e is rise ('pll_clk') @ sim; 

You should use the Specman simple_port construct. We doubled the speed of our simulations when we switched to ports instead of tick-accesses. Look it up in your Specman docs.

Ross Rogers
  • 23,523
  • 27
  • 108
  • 164