summaryrefslogtreecommitdiff
path: root/homework_2/SRC/agent.sv
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-24 19:55:11 -0800
committerFuwn <[email protected]>2026-02-24 19:55:11 -0800
commit871c6eae5ffda0ada6b1798209cb784c20afea06 (patch)
treea24590b45440f62c67c0aa9aadf408a3bb207659 /homework_2/SRC/agent.sv
parentfeat(midterm): Add implementation (diff)
downloadcst456-871c6eae5ffda0ada6b1798209cb784c20afea06.tar.xz
cst456-871c6eae5ffda0ada6b1798209cb784c20afea06.zip
feat(homework_2): Add initial files
Diffstat (limited to 'homework_2/SRC/agent.sv')
-rw-r--r--homework_2/SRC/agent.sv24
1 files changed, 24 insertions, 0 deletions
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