Skip to content

Commit

Permalink
[uvmgen] case pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragon-Git committed Nov 20, 2023
1 parent b1dbdfe commit 2bf88f0
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/uvmgen/templates/agt_pkg/cov.mako.sv
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ${agent_name}_cov extends uvm_component;
`uvm_component_utils(${agent_name}_cov)

covergroup cg_trans @(cov_event);
coverpoint tr.kind;
// ToDo: coverpoint tr.kind;
// ToDo: Add required ${agent_name}_coverpoints, ${agent_name}_coverbins
endgroup: cg_trans

Expand Down
2 changes: 0 additions & 2 deletions src/uvmgen/templates/agt_pkg/drv.mako.sv
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,9 @@ endtask:configure_phase

task ${agent_name}_drv::run_phase(uvm_phase phase);
super.run_phase(phase);
phase.raise_objection(this,"");
fork
tx_driver();
join
phase.drop_objection(this);
endtask: run_phase


Expand Down
6 changes: 2 additions & 4 deletions src/uvmgen/templates/agt_pkg/mon.mako.sv
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,9 @@ endtask:configure_phase

task ${agent_name}_mon::run_phase(uvm_phase phase);
super.run_phase(phase);
phase.raise_objection(this,"");
fork
tx_monitor();
join
phase.drop_objection(this);

endtask: run_phase

Expand All @@ -139,9 +137,9 @@ task ${agent_name}_mon::tx_monitor();
`uvm_info("TX_MONITOR", "Starting transaction...",UVM_LOW)
// ToDo: Observe first half of transaction

// ToDo: User need to add monitoring logic and remove $finish
// ToDo: User need to add monitoring logic and remove #10
`uvm_info("TX_MONITOR"," User need to add monitoring logic ",UVM_LOW)
// $finish;
#10; // For test to avoid zero-delay-loop
`uvm_do_callbacks(${agent_name}_mon,${agent_name}_mon_callbacks, pre_ack(this, tr))
// ToDo: React to observed transaction with ACK/NAK
`uvm_info("TX_MONITOR", "Completed transaction...",UVM_HIGH)
Expand Down
9 changes: 6 additions & 3 deletions src/uvmgen/templates/env_pkg/env.mako.sv
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ${env_name} extends uvm_env;
% endif
${vsqr_name} vsqr;
// Declear agent
% for child_type, child_name in env_childs.items():
% for child_name, child_type in env_childs.items():
${child_type} ${child_name};
${child_type[:-3]}cfg ${child_name[:-3]}cfg;
% endfor
Expand All @@ -37,13 +37,13 @@ endfunction:new

function void ${env_name}::build_phase(uvm_phase phase);
super.build();
% for child_type, child_name in env_childs.items():
% for child_name, child_type in env_childs.items():
${child_name} = ${child_type}::type_id::create("${child_name}",this);
${child_name[:-3]}cfg = ${child_type[:-3]}cfg::type_id::create("${child_name[:-3]}cfg",this);
uvm_config_db#(${child_type[:-3]}cfg)::set(this, "${child_name}", "cfg", ${child_name[:-3]}cfg);

% endfor

vsqr = ${vsqr_name}::type_id::create("vsqr",this);
//ToDo: Instantiate other components,callbacks and TLM ports if added by user

% if has_regmodle:
Expand All @@ -67,6 +67,9 @@ function void ${env_name}::connect_phase(uvm_phase phase);
regmodel.default_map.set_sequencer(mast_seqr_0,reg2host);
MULT_DRV_END
% endif
% for child_name, child_type in env_childs.items():
$cast(vsqr.${child_name[:-3]}sqr, ${child_name}.sqr);
% endfor
// ToDo: Register any required callbacks

endfunction: connect_phase
Expand Down
6 changes: 6 additions & 0 deletions src/uvmgen/templates/env_pkg/vsqr.mako.sv
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
class ${vsqr_name} extends uvm_sequencer;
% for child_name, child_type in env_childs.items():
${child_type[:-3]}sqr ${child_name[:-3]}sqr;
% endfor
`uvm_component_utils_begin(${vsqr_name})
% for child_name, child_type in env_childs.items():
`uvm_field_object(${child_name[:-3]}sqr,UVM_ALL_ON)
% endfor
//ToDo: add field utils macros here if required
`uvm_component_utils_end

Expand Down
2 changes: 1 addition & 1 deletion test/json/env.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"pkg_name": "spi_env_pkg",
"import_pkgs":["spi_agt_pkg"],
"env_name": "spi_env",
"env_childs": {"spi_agt": "m_spi_agt"},
"env_childs": {"m_spi_agt": "spi_agt"},
"scb_name": "spi_scb",
"vsqr_name": "spi_vsqr",
"mst_action": "spi_item",
Expand Down

0 comments on commit 2bf88f0

Please sign in to comment.