I have a module which running in specif two frequency.
I wan to develope assertions for checking two freq simultaneously. But ()either of them will exist in one simulation randomly.
Can anyone pls suggest some approch of doing same?
I have a module which running in specif two frequency.
I wan to develope assertions for checking two freq simultaneously. But ()either of them will exist in one simulation randomly.
Can anyone pls suggest some approch of doing same?
module test9;
// I have a module that runs in specifically two frequencies.
// I wan to develop assertions for checking two freq simultaneously.
// But ()either of them will exist in one simulation randomly.
parameter time P1=20ns; // half period
parameter time P2=35; // half period
bit clk1, clk2, f1_select, f2_select;
property p_f1_check;
time v_t;
@(posedge clk1) (f1_select, v_t=$time) |-> @(negedge clk1) $time-v_t==P1;
endproperty
ap_f1: assert property(p_f1_check);
property p_f2_check;
time v_t;
@(posedge clk2) (f2_select, v_t=$time) |-> @(negedge clk2) $time-v_t==P2;
endproperty
ap_f2: assert property(p_f2_check);
// If you need an activity detector for the frequency that is not running, you'll need to
// do that is code. An alternate solution is to create a test clock to check that at
// those edges, the inactive clock is indeed stable, or at the 0 level (if that is the case).
endmodule
Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us