diff options
| author | Fuwn <[email protected]> | 2026-02-24 19:55:11 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-24 19:55:11 -0800 |
| commit | 871c6eae5ffda0ada6b1798209cb784c20afea06 (patch) | |
| tree | a24590b45440f62c67c0aa9aadf408a3bb207659 /homework_2/SRC/env.sv | |
| parent | feat(midterm): Add implementation (diff) | |
| download | cst456-871c6eae5ffda0ada6b1798209cb784c20afea06.tar.xz cst456-871c6eae5ffda0ada6b1798209cb784c20afea06.zip | |
feat(homework_2): Add initial files
Diffstat (limited to 'homework_2/SRC/env.sv')
| -rw-r--r-- | homework_2/SRC/env.sv | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/homework_2/SRC/env.sv b/homework_2/SRC/env.sv new file mode 100644 index 0000000..2b9e01d --- /dev/null +++ b/homework_2/SRC/env.sv @@ -0,0 +1,24 @@ +// The environment is a container object simply to hold
+// all verification components together. This environment can
+// then be reused later and all components in it would be
+// automatically connected and available for use
+class env extends uvm_env;
+ `uvm_component_utils(env)
+ function new(string name="env", uvm_component parent=null);
+ super.new(name, parent);
+ endfunction
+
+ agent a0; // Agent handle
+ scoreboard sb0; // Scoreboard handle
+
+ virtual function void build_phase(uvm_phase phase);
+ super.build_phase(phase);
+ a0 = agent::type_id::create("a0", this);
+ sb0 = scoreboard::type_id::create("sb0", this);
+ endfunction
+
+ virtual function void connect_phase(uvm_phase phase);
+ super.connect_phase(phase);
+ a0.m0.mon_analysis_port.connect(sb0.m_analysis_imp);
+ endfunction
+endclass
\ No newline at end of file |