wuddi Posted December 20, 2012 Report Posted December 20, 2012 Hi UVM experts: Normally, driver gets transaction at posedge clock and then drive transaction to interface. But when driver gets a transaction at non-posedge clock, it cannot drive transaction immediately, and must wait next posedge clock (NBA region) to drive it out. My code as below shows: [example code begin] forever begin seq_item_port.get_next_item(req); vif.cb.address <= req.address; vif.cb.data <= req.data; @(vif.cb); end [example code end] transaction_1 : address = 32'h0000_1010; data = 32'h0000_1111; transaction_2 : address = 32'h0000_1111; data = 32'h1111_0000; When driver gets tranasction_1 at non-posedge clock, and gets transaction_2 at next posedge clock, I found only transaction_2's address=32'h0000_1111 & data=32'h1111_0000 been driven to the interface. So how to fix this bug? Thanks in advence. Best Regards wuddi Quote
dudi Posted December 23, 2012 Report Posted December 23, 2012 Define a SVA sequence in the clocking block: clocking cb @(posedge clk); ... sequence at_posedge; 1; endsequence endclocking Then in the driver use the following code before driving the transaction: wait (vif.cb.at_posedge.triggered); Quote
wuddi Posted December 25, 2012 Author Report Posted December 25, 2012 Hi dudi, Thanks. I solve the problem in a different way. first, I declare a event clock_detected; then use a task to triggered the event. task sync_to_posedge_clk(); fork forever begin @(vif.cb); -> clock_detected; end join_none endtask task run_phase(uvm_phase phase); sync_to_posedge_clk(); seq_item_port.get_next_item(req); wait(clock_detected.triggered); . . . endtask Best Regards wuddi Quote
dudi Posted December 26, 2012 Report Posted December 26, 2012 That will do the trick. You can also move the event to the interface, and trigger it in an always@(posedge clk) block. Then wait for vif.event_name.triggered . This way you won't need to fork it in the run_phase Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.