UVM TLM通信
一.PORT與IMP的鏈接
PORT | TYPE | IMP | TYPE | TASK/FUNCTION IN COMPONENT B |
A | uvm_blocking_put_port#(my_transaction) | B | uvm_blocking_put_imp#(my_transaction, this) | put |
A | uvm_noblocking_put_port#(my_transaction) | B | uvm_noblocking_put_imp#(my_transaction, this) | try_put can_put |
A | uvm_put_port#(my_transaction) | B | uvm_put_imp#(my_transaction, this) | put try_put can_put |
A | uvm_blocking_get_port#(my_transaction) | B | uvm_blocking_get_imp#(my_transaction, this) | get |
A | uvm_noblocking_get_port#(my_transaction) | B | uvm_noblocking_get_imp#(my_transaction, this) | try_get can_get |
A | uvm_get_port#(my_transaction) | B | uvm_get_imp#(my_transaction, this) | get try_get can_get |
A | uvm_blocking_peek#(my_transaction) | B | uvm_blocking_peek_imp#(my_transaction, this) | peek |
A | uvm_noblocking_peek_port#(my_transaction) | B | uvm_noblocking_peek_imp#(my_transaction, this) | try_peek can_peek |
A | uvm_peek_port#(my_transaction) | B | uvm_peek_imp#(my_transaction, this) | peek try_peek can_peek |
A | uvm_blocking_get_peek#(my_transaction) | B | uvm_blocking_get_peek_imp#(my_transaction, this) | get peek |
A | uvm_noblocking_get_peek_port#(my_transaction) | B | uvm_noblocking_get_peek_imp#(my_transaction, this) | try_get can_get try_peek can_peek |
A | uvm_get_peek_port#(my_transaction) | B | uvm_get_peek_imp#(my_transaction, this) | get try_get can_get peek try_peek can_peek |
A | uvm_blocking_transport_port#(my_transaction) | B | uvm_blocking_transport_imp#(my_transaction, this) | transport |
A | uvm_noblocking_transport_port#(my_transaction) | B | uvm_noblocking_transport_imp#(my_transaction, this) | nb_transport |
A | uvm_transport_port#(my_transaction) | B | uvm_transport_imp#(my_transaction, this) | transport nb_transport |
二.PORT與IMP的代碼實例
2.1.A_PORT
class A extends uvm_component;
`uvm_component_utils(A)
uvm_blocking_put_port#(my_transaction) A_PORT;
virtual function void build_phase(uvm_phase phase);
super.build_phase(phase);
A_PORT = new("A_PORT", this);
endfunction
virtual task main_phase(uvm_phase phase);
endtask
endclass
2.2.B_IMP
class A extends uvm_component;
`uvm_component_utils(B)
uvm_blocking_put_imp#(my_transaction, B_IMP) B_IMP;
virtual function void build_phase(uvm_phase phase);
super.build_phase(phase);
B_IMP = new("B_IMP", this);
endfunction
virtual function void put(my_transaction tr);
`uvm_info("B", "Receive A Transaction", UVM_LOW)
tr.print();
endfunction : put
virtual task main_phase(uvm_phase phase);
endtask
endclass