※ pipe_env.sv |
class pipe_env_c extends uvm_env; `uvm_component_utils(pipe_env_c) pipe_agent_c pipe_agent; pipe_sb_c pipe_sb; function new(string name, uvm_component parent); super.new(name, parent); endfunction function void build_phase(uvm_phase phase); super.build_phase(phase); `uvm_info(get_type_name(), $sformatf("build_phase() starts.."), UVM_LOW) pipe_agent = pipe_agent_c::type_id::create("pipe_agent", this); pipe_sb = pipe_sb_c::type_id::create("pipe_sb", this); endfunction function void connect_phase(uvm_phase phase); super.connect_phase(phase); // scoreboard의 analysis port와 monitor의 analysis port를 연결 pipe_agent.pipe_monitor.data_port.connect(pipe_sb.pipe_imp_port); endfunction endclass |
pipe_env 는 uvm_env 로 부터 상속 받은 class 이다. agent class 와 scoreboard class 를 object 로 선언하였고 build_phase() 에서 두 object 들을 생성하였다. 추후 agent 내 monitor class 의 transaction 을 데이터 비교를 위해 scoreboard 로 전달해야하는데 이 역할을 하는 것이 두 class 에 정의 된 TLM port 이다. 두 class 간 TLM port 를 연결해주는 역할을 상위 component 인 env class 가 하는 것이고, 위 code 와 같이 connect_phase() 에서 기술하였다.