This commit is contained in:
2026-06-12 07:53:32 +02:00
commit 59e71f3297
259 changed files with 29010 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
`ifndef CALC_AGENT_PKG
`define CALC_AGENT_PKG
package calc_agent_pkg;
import uvm_pkg::*;
`include "uvm_macros.svh"
//////////////////////////////////////////////////////////
// include Agent components : driver,monitor,sequencer
/////////////////////////////////////////////////////////
`include "calc_seq_item.sv"
`include "calc_sequencer.sv"
`include "calc_driver.sv"
endpackage
`endif

View File

@@ -0,0 +1,41 @@
`ifndef CALC_DRIVER_SV
`define CALC_DRIVER_SV
class calc_driver extends uvm_driver#(calc_seq_item);
`uvm_component_utils(calc_driver)
virtual interface calc_if vif;
function new(string name = "calc_driver", uvm_component parent = null);
super.new(name,parent);
endfunction // new
function void build_phase(uvm_phase phase);
if (!uvm_config_db#(virtual calc_if)::get(null, "*", "calc_if", vif))
`uvm_fatal("NOVIF",{"virtual interface must be set:",get_full_name(),".vif"})
endfunction // build_phase
task main_phase(uvm_phase phase);
forever begin
@(posedge vif.clk);
if (!vif.rst)
begin
seq_item_port.get_next_item(req);
`uvm_info(get_type_name(),
$sformatf("Driver sending...\n%s", req.sprint()),
UVM_HIGH)
vif.req1_data_in = req.operand1;
vif.req1_cmd_in = req.cmd;
@(posedge vif.clk);
vif.req1_data_in = req.operand2;
vif.req1_cmd_in = 0;
seq_item_port.item_done();
end
end
endtask : main_phase
endclass : calc_driver
`endif

View File

@@ -0,0 +1,20 @@
`ifndef CALC_SEQ_ITEM_SV
`define CALC_SEQ_ITEM_SV
class calc_seq_item extends uvm_sequence_item;
rand logic [31:0] operand1;
rand logic [31:0] operand2;
rand logic [3:0] cmd;
`uvm_object_utils_begin(calc_seq_item)
`uvm_object_utils_end
function new (string name = "calc_seq_item");
super.new(name);
endfunction // new
endclass : calc_seq_item
`endif

View File

@@ -0,0 +1,15 @@
`ifndef CALC_SEQUENCER_SV
`define CALC_SEQUENCER_SV
class calc_sequencer extends uvm_sequencer#(calc_seq_item);
`uvm_component_utils(calc_sequencer)
function new(string name = "calc_sequencer", uvm_component parent = null);
super.new(name,parent);
endfunction
endclass : calc_sequencer
`endif