Unable to capture correct axi_awvalid value on the posedge axi_clk

Hi,
In the following code if axi_awvalid=1 at ‘n’ cycle and axi_awvalid=0 at ‘n+1’ cycle, getting “CAPTURED” at n+1 cycle, means valid has not captured on the exact clock edge.
forever
@(posedge clk) begin
if(axi_awvalid)
`uvm_info(“MON”,“CAPTURED”, UVM_NONE);
end
end

In the following code if axi_awvalid=1 at ‘n’ cycle and axi_awvalid=0 at ‘n+1’ cycle, getting “CAPTURED” on both ‘n’ and ‘n+1’ cycles. means valid has captured on the both raise and fall of valid.
forever
@(posedge clk && axi_awvalid) begin
`uvm_info(“MON”,“CAPTURED”, UVM_NONE);
end
end

  1. Is there a way to capture axi_awvalid=1 at ‘n’ cycle ?
  2. If axi_awvalid=1 for back-to-back 3 cycles, how to capture them without delay?

In reply to smasalthi:
If you need to test axi_awvalid at every cycle n, and then test axi_valid at every n+1 cycle, then you can do something like something below:


always @(posedge ck) begin
    fork t_axi(); 
    join_none    
end

task automatic t_axi();
    if(axi_awvalid) begin : n_awi
      `uvm_info("MON","axi_awvalid at cycle n ", UVM_NONE);
        @(posedge clk) if(axi_valid) begin : nPlus1
            `uvm_info("MON","CAPTURED", UVM_NONE); 
            // axi_awvalid=1 at 'n' cycle and axi_valid=1 at 'n+1' cycle,
            // Other statements 
        end : nPlus1
    end : n_awi
    else  `uvm_info("MON","NO axi_awvalid at cycle n ", UVM_NONE);
endtask

Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us
For training, consulting, services: contact Home - My cvcblr

** SVA Handbook 4th Edition, 2016 ISBN 978-1518681448

  1. SVA Package: Dynamic and range delays and repeats SVA: Package for dynamic and range delays and repeats | Verification Academy
  2. Free books: Component Design by Example FREE BOOK: Component Design by Example … A Step-by-Step Process Using VHDL with UART as Vehicle | Verification Academy
    Real Chip Design and Verification Using Verilog and VHDL($3) Amazon.com
  3. Papers: