From 871c6eae5ffda0ada6b1798209cb784c20afea06 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 24 Feb 2026 19:55:11 -0800 Subject: feat(homework_2): Add initial files --- homework_2/SRC/agent.sv | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 homework_2/SRC/agent.sv (limited to 'homework_2/SRC/agent.sv') diff --git a/homework_2/SRC/agent.sv b/homework_2/SRC/agent.sv new file mode 100644 index 0000000..735b1cf --- /dev/null +++ b/homework_2/SRC/agent.sv @@ -0,0 +1,24 @@ +// driver, monitor and sequencer +class agent extends uvm_agent; + `uvm_component_utils(agent) + function new(string name="agent", uvm_component parent=null); + super.new(name, parent); + endfunction + + driver d0; // Driver handle + monitor m0; // Monitor handle + uvm_sequencer #(Item) s0; // Sequencer Handle + + virtual function void build_phase(uvm_phase phase); + super.build_phase(phase); + s0 = uvm_sequencer#(Item)::type_id::create("s0", this); + d0 = driver::type_id::create("d0", this); + m0 = monitor::type_id::create("m0", this); + endfunction + + virtual function void connect_phase(uvm_phase phase); + super.connect_phase(phase); + d0.seq_item_port.connect(s0.seq_item_export); + endfunction + +endclass \ No newline at end of file -- cgit v1.2.3