johnrossserco Posted June 21, 2012 Report Share Posted June 21, 2012 Backdoor write value deposited on the register variable appears to get overwritten on the next clock edge. See code below. If I move the write conditional into the always_ff block the backdoor access sticks. Where in the time slot does the backdoor DPI call get executed: prepone, observe, re-nba or postpone? always_ff @(posedge clk) begin reg_name <= reg_name_next; end always_comb begin reg_name_next = reg_name; if (write) reg_name_next = write_data; end Quote Link to comment Share on other sites More sharing options...
janick Posted June 21, 2012 Report Share Posted June 21, 2012 The DPI gets called by the thread that calls the write() method and thus executes in the same region. And since it is a simple immediate variable assignment, it will get overwritten should/when other threads assign a different value. What you have here is a classic race condition... Quote Link to comment Share on other sites More sharing options...
johnrossserco Posted June 22, 2012 Author Report Share Posted June 22, 2012 Thanks for the reply. Is this a matter of UVM not supporting this coding style, or do I have to get smarter about when the write() method gets executed? Quote Link to comment Share on other sites More sharing options...
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.