私は、1ビットのクロックを設定し、それをクリアするタスクを作成しようとしています。 set_then_clearタスクの「信号」への非ブロックの割り当てにタスクを介して仮想インターフェイス信号のビットスライスを駆動する
** Error: path_to_driver.svh(53): LHS in non-blocking assignment may not be an automatic variable
** Error: path_to_driver.svh(55): LHS in non-blocking assignment may not be an automatic variable
これらのポイント:私は、次のエラー(クエスタ10.6)を取得
class my_if_driver extends uvm_driver;
`uvm_component_utils(my_if_driver)
// Members
// UVM stuff
virtual my_if_interface vif;
function new(string name="my_if_driver", uvm_component parent);
super.new(name, parent);
endfunction
extern function void build_phase(uvm_phase phase);
extern function void connect_phase(uvm_phase phase);
extern task run_phase(uvm_phase phase);
extern task drive_my_if(my_if_transaction txn);
extern task set_then_clear(ref logic signal);
endclass
function void my_if_driver::build_phase(uvm_phase phase);
endfunction
function void my_if_driver::connect_phase(uvm_phase phase);
endfunction
task my_if_driver::run_phase(uvm_phase phase);
@(posedge vif.resetn);
forever begin
seq_item_port.get_next_item(req);
fork
drive_my_if(req);
join_none
seq_item_port.item_done(req);
end
endtask
// NOTE: each 'command-signal' has bit for each tid (transaction ID)
task my_if_driver::drive_my_if(my_if_transaction txn);
// Wait for delay
repeat (txn.cycle_delay) @(posedge vif.clk);
// Then drive appropriate signal
if (txn.my_if_cmd == my_if_transaction::CMDA) begin
set_then_clear(vif.my_if_cmd_a[txn.tid]);
end
else if (txn.my_if_cmd == my_if_transaction::CMDB) begin
set_then_clear(vif.my_if_cmd_b[txn.tid]);
end
else if (txn.my_if_cmd == my_if_transaction::CMDC) begin
set_then_clear(vif.my_if_cmd_c[txn.tid]);
end
endtask
task my_if_driver::set_then_clear(ref logic signal);
signal <= 1'b1;
@(posedge vif.clk);
signal <= 1'b0;
endtask
:私のドライバのコードを下に装着されています。 ref引数を使って仮想インタフェースのビットスライスを指す方法はありますか?
これらの2行のノンブロッキング割り当てをブロッキングに変更してみてください。私はあなたのコードをEDAplaygroundで試してみましたが、別のエラーが出ました。 "オブジェクト 'this.vif.my_if_cmd_a [txn.tid]'は参照渡しできません。 (私はこのエラーがシミュレータの問題かSVのルールかどうかはチェックしていません) – Greg
Daveの答えに基づいて、それはLRMルールです(13.5.2項)。私がノンブロッキングをした理由は、すべての監視活動の後に値を更新したいと思ったからです(今はCBを使用していません)。 –