when i searched for examples for how to write assertions for checking clock period or frequency, i came across assertions like this,
property clk_chk(int clk_period)
int start_time
(`1,start_time=$time)|=>($time-start_time==clk_period);
endproperty
I understand the logic. What i dont understand is, what does that `1 indicates? what variable is supposed to be true for assignment to be executed? Could someone clarify on this, please?
The '1 means boolean expression that is always true. So the antecedent is true every clock cycle and unconditionally save the start_time with the current time.
It is a good apprach to check clock frequency using asertions. Only the property you were showing is not realistically.
What you need is clock signal which is running faster as the clock you want to evaluate. This clock samples the signal under consideration.
Actually, im integrating SPI and APB vip’s. there i want to check the spi clock frequency sck with respect to system clock. How to do that? Can you please help me out? because im still confused.