virtual task runphase(uvmphase phase); @(negedge aif.rst); forever begin…
- User
virtual task run_phase(uvm_phase phase); @(negedge aif.rst); forever begin repeat(2)@(posedge aif.clk); t.a = aif.a; t.b = aif.b; t.y = aif.y; `uvm_info("MON", $sformatf("Data send to Scoreboard a : %0d , b : %0d and y : %0d", t.a,t.b,t.y), UVM_NONE); send.write(t); end endtask //////// clock is always #10 aif.clk = ~aif.clk; here I have one issue he said @(negedge aif.rst); so that means if negedge rst happens at 10 and clk also happens at 10 seconds repeat(2)@(posedge aif.clk); does that mean i this line repeat(2)@(posedge aif.clk); happens at 30 or at 50
- Assistant
In the given code, the
@(negedge aif.rst)statement waits for the negative edge of theaif.rstsignal. If theaif.rstsignal goes low at 10 time units, the code will continue to the next line after the reset is done.The
repeat(2)@(posedge aif.clk)statement waits for two positive edges of theaif.clksignal. Since the clock is toggling every 10 time units (always #10 aif.clk = ~aif.clk;), the first positive edge will occur at 10 time units, and the second positive edge will occur at 20 time units.So, the
repeat(2)@(posedge aif.clk)statement will complete at 20 time units, not 30 or 50. Thet.a = aif.a;,t.b = aif.b;, andt.y = aif.y;statements, as well as thesend.write(t);statement, will execute immediately after the clock edges, at 20 time units.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.