ポートと分析ポートの違いは何ですか? uvm_blocking_put_portの使用場所とuvm_analysis_portの使用場所 uvm_analysis_portがuvm_blocking_put_portより優れている点は何ですか?uvm_blocking_put_portとuvm_analysis_portはどこで使用しますか?
1
A
答えて
2
ポート接続は、2つの独立したブロック(コンポーネント)を接続するために使用されます。 uvm_blocking_put_portとuvm_analysis_portの両方が、プロデューサからコンシューマにデータを転送するために使用されました。
(1)uvm_blocking_put_port: 単一のプロデューサから単一のコンシューマへのデータ転送に使用されます。
(2)uvm_analysis_port: 単一のプロデューサから単一のコンシューマまたは複数のコンシューマへのデータ転送に使用されます。
この分析ポートの利点は、ユーザーが単一のプロデューサからuvm_blocking_put_portの助けを借りてアーカイブされていない複数のコンシューマにデータを転送できることです。
このことも図で説明します。
ここでは、uvm_blocking_put_portとuvm_analysis_portをより明確にするためのサンプルコードを提供します。
This image explain use of uvm_blocking_put_port
注意:ポート接続が2つ以上の独立したコンポーネントを接続するために使用されます。
(1)uvm_blocking_put_port例。実施例uvm_analysis_port
class transaction extends uvm_sequence_item;
`uvm_object_utils(transaction);
rand int unsigned a;
rand int unsigned b;
function new(string name ="");
super.new(name);
endfunction
endclass
class producer extends uvm_component;
`uvm_component_utils(producer);
transaction tr_inst;
uvm_blocking_put_port #(transaction) produce_to_consumer_p;
function new(string name ="",uvm_component parent);
super.new(name,parent);
produce_to_consumer_p = new("produce_to_consumer_p",this);
tr_inst = new("tr_inst");
endfunction
task run_phase(uvm_phase phase) ;
super.run_phase(phase);
phase.raise_objection(this);
//tr_inst.randomize();
`uvm_info(get_full_name(),"Write the data from PRODUCER",UVM_LOW)
tr_inst.a = 10; tr_inst.b = 20;
produce_to_consumer_p.put(tr_inst);
phase.drop_objection(this);
endtask
endclass
class consumer extends uvm_component;
`uvm_component_utils(consumer);
uvm_blocking_put_imp#(transaction,consumer) put_imp;
//transaction tr_inst;
function new(string name ="",uvm_component parent);
super.new(name,parent);
put_imp = new("put_imp",this);
endfunction
function void put(transaction tr_inst);
`uvm_info(get_full_name(),"Got the data in CONSUMER",UVM_LOW);
`uvm_info(get_full_name(),$sformatf("the value of a %0d and b is %0d",tr_inst.a,tr_inst.b),UVM_LOW);
endfunction
endclass
class env extends uvm_component;
`uvm_component_utils(env);
producer p_inst;
consumer c_inst;
function new(string name="",uvm_component parent);
super.new(name,parent);
p_inst = new("p_inst",this);
c_inst = new("c_inst",this);
endfunction
function void connect();
p_inst.produce_to_consumer_p.connect(c_inst.put_imp);
endfunction
endclass
module main();
env env_inst;
initial
begin
env_inst = new("env_inst",null);
run_test();
end
endmodule
This image gives explanation of uvm_analysis_port (2)
class transaction extends uvm_sequence_item;
`uvm_object_utils(transaction);
rand int unsigned a;
rand int unsigned b;
function new(string name ="");
super.new(name);
endfunction
endclass
class producer extends uvm_component;
`uvm_component_utils(producer);
transaction tr_inst;
uvm_analysis_port #(transaction) produce_to_consumer_p;
function new(string name ="",uvm_component parent);
super.new(name,parent);
produce_to_consumer_p = new("produce_to_consumer_p",this);
tr_inst = new("tr_inst");
endfunction
task run_phase(uvm_phase phase);
super.run_phase(phase);
phase.raise_objection(this);
// tr_inst.randomize();
`uvm_info(get_full_name(),"Write the data from PRODUCER",UVM_LOW);
tr_inst.a = 10; tr_inst.b = 20;
produce_to_consumer_p.write(tr_inst);
phase.drop_objection(this);
endtask
endclass
class consumer_1 extends uvm_component;
`uvm_component_utils(consumer_1);
uvm_analysis_imp#(transaction,consumer_1) write_imp_1;
function new(string name ="",uvm_component parent);
super.new(name,parent);
write_imp_1 = new("write_imp_1",this);
endfunction
function void write(transaction tr_inst);
`uvm_info(get_full_name(),"Got the data in CONSUMER_1",UVM_LOW);
`uvm_info(get_full_name(),$sformatf("The value of a = %0d and b = %0d",tr_inst.a,tr_inst.b),UVM_LOW);
endfunction
endclass
class consumer_2 extends uvm_component;
`uvm_component_utils(consumer_2);
uvm_analysis_imp#(transaction,consumer_2) write_imp_2;
function new(string name ="",uvm_component parent);
super.new(name,parent);
write_imp_2 = new("write_imp_2",this);
endfunction
function void write(transaction tr_inst);
`uvm_info(get_full_name(),"Got the data in CONSUMER_2",UVM_LOW);
`uvm_info(get_full_name(),$sformatf("The value of a = %0d and b = %0d",tr_inst.a,tr_inst.b),UVM_LOW);
endfunction
endclass
class consumer_3 extends uvm_component;
`uvm_component_utils(consumer_3);
uvm_analysis_imp#(transaction,consumer_3) write_imp_3;
function new(string name ="",uvm_component parent);
super.new(name,parent);
write_imp_3 = new("write_imp_3",this);
endfunction
function void write(transaction tr_inst);
`uvm_info(get_full_name(),"Got the data in CONSUMER_3",UVM_LOW);
`uvm_info(get_full_name(),$sformatf("The value of a = %0d and b = %0d",tr_inst.a,tr_inst.b),UVM_LOW);
endfunction
endclass
class env extends uvm_component;
`uvm_component_utils(env);
producer p_inst;
consumer_1 c_inst_1;
consumer_2 c_inst_2;
consumer_3 c_inst_3;
function new(string name="",uvm_component parent);
super.new(name,parent);
p_inst = new("p_inst",this);
c_inst_1 = new("c_inst_1",this);
c_inst_2 = new("c_inst_2",this);
c_inst_3 = new("c_inst_3",this);
endfunction
function void connect();
p_inst.produce_to_consumer_p.connect(c_inst_1.write_imp_1);
p_inst.produce_to_consumer_p.connect(c_inst_2.write_imp_2);
p_inst.produce_to_consumer_p.connect(c_inst_3.write_imp_3);
endfunction
endclass
module main();
env env_inst;
initial
begin
env_inst = new("env_inst",null);
run_test();
end
endmodule
関連する問題
- 1. どこでElasticSearchを使うことができますか?MongoDBはどこで利用できますか?
- 2. DATEFORMATとCONVERTはどこで使用できますか? (SQLサーバー)
- 3. Live Wallpaper内ではどこでgetWindowManager()を使用しますか?
- 4. スクリプトエンジンとして使用されるルビはどこですか?
- 5. どこでどこで使用できますか?
- 6. Composer for PHPはどこで使用しますか?
- 7. python3.5 my_script.pyを使用すると、Pythonはどこでmy_script.pyを探しますか?
- 8. どこでデータベースを使うべきですか?また、mysqlのどこでテーブルを使用しますか?
- 9. どのプログラミングパラダイムルアを使用することができますか?
- 10. yooスライダーはどこでPHPで使用できますか?
- 11. アンダースコア 'どこに'または '?'を使用できますか?
- 12. プログラムはここでどのようにスタックを使用していますか?
- 13. npmパッケージはどこで使用できますか?
- 14. constはどこでも使用できますか?
- 15. ここでawakeFromNibまたはinitWithCoderを使用しますか?
- 16. ここで使用するデータ構造はどれですか?
- 17. POCOを使用するときのビヘイビアロジックはどこに配置しますか?
- 18. MySQL LIKEとBOOLEAN MODE(FULLTEXT)はいつどこで使用できますか?
- 19. DjangoとNode.Jsを使用することはできますか?
- 20. JPaとHibernateを使用することはできますか?
- 21. これにはどのUML図を使用しますか?
- 22. これにはどのコントローラーを使用しますか?
- 23. NLogを使用して$ {basedir}はどこにありますか?
- 24. これにはどのデザインパターンを使用しますか?
- 25. 私はvirtualenvを使用しています。 Ziplineのextension.pyはどこですか?
- 26. どのシーンでこのphp配列を使用しますか?
- 27. いつ/どこでPDOを使用しますか?
- 28. どこでも同じコンテキストを使用していますか?
- 29. どこで拡張子を使用しますか?
- 30. これらのPostMessage LparamとWparamはどのように使用しますか?