Skip to content

Commit

Permalink
Merge branch 'master' into dev/int-clear
Browse files Browse the repository at this point in the history
  • Loading branch information
AyoubJalali authored Oct 11, 2024
2 parents 58c3d62 + 9c3aea2 commit d84f45e
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 11 deletions.
16 changes: 10 additions & 6 deletions verif/env/uvme/cov/uvme_interrupt_covg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,11 @@ function void uvme_interrupt_covg_c::build_phase(uvm_phase phase);
`uvm_fatal("CFG", "Configuration handle is null")
end

interrupt_cg = new("interrupt_cg",
.sw_int_supported(cfg.sw_int_supported));
if (!cfg.disable_all_csr_checks)
interrupt_cg = new("interrupt_cg",
.sw_int_supported(cfg.sw_int_supported));
else
`uvm_warning(get_type_name(), "Interrupt coverage will not be scored since config disable_all_csr_checks is true")

mon_trn_fifo = new("mon_trn_fifo" , this);

Expand All @@ -122,9 +125,10 @@ task uvme_interrupt_covg_c::run_phase(uvm_phase phase);

`uvm_info(get_type_name(), "The Interrupt env coverage model is running", UVM_LOW);

forever begin
mon_trn_fifo.get(mon_trn);
interrupt_cg.sample(mon_trn.instr);
end
if (!cfg.disable_all_csr_checks)
forever begin
mon_trn_fifo.get(mon_trn);
interrupt_cg.sample(mon_trn.instr);
end

endtask : run_phase
30 changes: 30 additions & 0 deletions verif/env/uvme/uvme_cva6_cfg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ class uvme_cva6_cfg_c extends uvma_core_cntrl_cfg_c;
rand bit tandem_enabled;
rand bit cov_model_enabled;
rand bit trn_log_enabled;
rand bit force_disable_csr_checks; // force disable all csr checks in RVFI. Note that all csrs info in instruction from RVFI will be removed
rand int unsigned sys_clk_period;

bit performance_mode; // Will force disable coverage, csr checks, scoreboard and loggers

// Agent cfg handles
rand uvma_clknrst_cfg_c clknrst_cfg;
rand uvma_axi_cfg_c axi_cfg;
Expand Down Expand Up @@ -69,13 +72,15 @@ class uvme_cva6_cfg_c extends uvma_core_cntrl_cfg_c;
`uvm_field_int ( tandem_enabled , UVM_DEFAULT )
`uvm_field_int ( cov_model_enabled , UVM_DEFAULT )
`uvm_field_int ( trn_log_enabled , UVM_DEFAULT )
`uvm_field_int ( force_disable_csr_checks , UVM_DEFAULT )
`uvm_field_int ( ext_zicond_supported , UVM_DEFAULT )
`uvm_field_int ( HPDCache_supported , UVM_DEFAULT )
`uvm_field_int ( nr_pmp_entries , UVM_DEFAULT )
`uvm_field_int ( ext_zihpm_supported , UVM_DEFAULT )
`uvm_field_int ( MmuPresent , UVM_DEFAULT )
`uvm_field_int ( sw_int_supported , UVM_DEFAULT )
`uvm_field_int ( sys_clk_period , UVM_DEFAULT + UVM_DEC)
`uvm_field_int ( performance_mode , UVM_DEFAULT )

`uvm_field_object(clknrst_cfg, UVM_DEFAULT)

Expand All @@ -96,6 +101,7 @@ class uvme_cva6_cfg_c extends uvma_core_cntrl_cfg_c;
soft scoreboard_enabled == 1;
soft cov_model_enabled == 1;
soft trn_log_enabled == 1;
soft force_disable_csr_checks == 0;
soft sys_clk_period == uvme_cva6_sys_default_clk_period; // see uvme_cva6_constants.sv
}

Expand Down Expand Up @@ -189,12 +195,21 @@ class uvme_cva6_cfg_c extends uvma_core_cntrl_cfg_c;
axi_cfg.trn_log_enabled == 1;
rvfi_cfg.trn_log_enabled == 1;
isacov_cfg.trn_log_enabled == 1;
} else {
clknrst_cfg.trn_log_enabled == 0;
axi_cfg.trn_log_enabled == 0;
rvfi_cfg.trn_log_enabled == 0;
isacov_cfg.trn_log_enabled == 0;
}

if (cov_model_enabled) {
isacov_cfg.cov_model_enabled == 1;
axi_cfg.cov_model_enabled == 1;
interrupt_cfg.cov_model_enabled == 1;
} else {
isacov_cfg.cov_model_enabled == 0;
axi_cfg.cov_model_enabled == 0;
interrupt_cfg.cov_model_enabled == 0;
}

}
Expand All @@ -219,6 +234,8 @@ class uvme_cva6_cfg_c extends uvma_core_cntrl_cfg_c;
*/
extern virtual function bit [XLEN-1:0] get_irq_addr();

extern virtual function void read_disable_csr_check_plusargs();

endclass : uvme_cva6_cfg_c


Expand All @@ -237,6 +254,11 @@ function uvme_cva6_cfg_c::new(string name="uvme_cva6_cfg");

$value$plusargs("core_name=%s", this.core_name);

if ($test$plusargs("tb_performance_mode")) begin
performance_mode = 1;
`uvm_info(get_type_name(), "Testbench set in performance mode, coverage & csr checks & scoreboard & loggers will be deactivated", UVM_NONE);
end

endfunction : new

function void uvme_cva6_cfg_c::sample_parameters(uvma_core_cntrl_cntxt_c cntxt);
Expand Down Expand Up @@ -352,4 +374,12 @@ function void uvme_cva6_cfg_c::set_unsupported_csr_mask();

endfunction : set_unsupported_csr_mask

function void uvme_cva6_cfg_c::read_disable_csr_check_plusargs();

super.read_disable_csr_check_plusargs();
if (force_disable_csr_checks)
disable_all_csr_checks = 1;

endfunction : read_disable_csr_check_plusargs

`endif // __UVME_CVA6_CFG_SV__
6 changes: 5 additions & 1 deletion verif/env/uvme/uvme_cva6_env.sv
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ function void uvme_cva6_env_c::connect_phase(uvm_phase phase);
csr_reg_predictor.map = csr_reg_block.default_map;
csr_reg_predictor.adapter = csr_reg_adapter;
csr_reg_block.default_map.set_auto_predict(0);
isacov_agent.monitor.ap.connect(csr_reg_predictor.bus_in);
if (cfg.cov_model_enabled)
isacov_agent.monitor.ap.connect(csr_reg_predictor.bus_in);
end

endfunction: connect_phase
Expand Down Expand Up @@ -292,6 +293,9 @@ function void uvme_cva6_env_c::create_env_components();

if (cfg.scoreboard_enabled) begin
predictor = uvme_cva6_prd_c::type_id::create("predictor", this);
end

if (cfg.scoreboard_enabled || cfg.tandem_enabled) begin
sb = uvme_cva6_sb_c ::type_id::create("sb" , this);
end

Expand Down
4 changes: 4 additions & 0 deletions verif/env/uvme/uvme_cva6_sb.sv
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,10 @@ task uvme_cva6_sb_c::run_phase(uvm_phase phase);

super.run_phase(phase);

if (cfg.scoreboard_enabled && cfg.disable_all_csr_checks)
`uvm_warning(get_type_name(),"Scoreboard enabled while config disable_all_csr_checks is true. Cycle and Trap will not be scoreboarded nor checked");

if (cfg.scoreboard_enabled && !cfg.disable_all_csr_checks)
fork
begin
forever begin
Expand Down
1 change: 1 addition & 0 deletions verif/regress/coremark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,5 @@ python3 cva6.py \
--c_tests "$src0" \
--gcc_opts "${srcA[*]} ${cflags[*]}" \
--iss_timeout=2000 \
--issrun_opts="+tb_performance_mode" \
$DV_OPTS
1 change: 1 addition & 0 deletions verif/regress/dhrystone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ python3 cva6.py \
--iss="$DV_SIMULATORS" \
--iss_yaml=cva6.yaml \
--c_tests "$src0" \
--issrun_opts="+tb_performance_mode" \
--gcc_opts "${srcA[*]} ${cflags[*]}"
2 changes: 1 addition & 1 deletion verif/regress/dv-riscv-arch-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ else
fi

cd verif/sim
python3 cva6.py --testlist=$TESTLIST --target $DV_TARGET --iss_yaml=cva6.yaml --iss=$DV_SIMULATORS $DV_OPTS --linker=../tests/riscv-arch-test/riscv-target/spike/link.ld
python3 cva6.py --testlist=$TESTLIST --target $DV_TARGET --iss_yaml=cva6.yaml --iss=$DV_SIMULATORS --issrun_opts="+tb_performance_mode" $DV_OPTS --linker=../tests/riscv-arch-test/riscv-target/spike/link.ld
2 changes: 1 addition & 1 deletion verif/regress/dv-riscv-compliance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ if ! [ -n "$DV_SIMULATORS" ]; then
fi

cd verif/sim
python3 cva6.py --testlist=../tests/testlist_riscv-compliance-$DV_TARGET.yaml --target $DV_TARGET --iss_yaml=cva6.yaml --iss=$DV_SIMULATORS $DV_OPTS
python3 cva6.py --testlist=../tests/testlist_riscv-compliance-$DV_TARGET.yaml --target $DV_TARGET --iss_yaml=cva6.yaml --iss=$DV_SIMULATORS --issrun_opts="+tb_performance_mode" $DV_OPTS
cd -
2 changes: 1 addition & 1 deletion verif/regress/dv-riscv-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ fi
cd verif/sim
for TESTLIST in $DV_TESTLISTS
do
python3 cva6.py --testlist=$TESTLIST --target $DV_TARGET --iss=$DV_SIMULATORS --iss_yaml=cva6.yaml $DV_OPTS
python3 cva6.py --testlist=$TESTLIST --target $DV_TARGET --iss=$DV_SIMULATORS --iss_yaml=cva6.yaml --issrun_opts="+tb_performance_mode" $DV_OPTS
done
cd -
9 changes: 8 additions & 1 deletion verif/tests/uvmt/base-tests/uvmt_cva6_base_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,14 @@ class uvmt_cva6_base_test_c extends uvm_test;
constraint env_cfg_cons {
env_cfg.enabled == 1;
env_cfg.is_active == UVM_ACTIVE;
env_cfg.trn_log_enabled == 1;
if (!env_cfg.performance_mode) {
env_cfg.trn_log_enabled == 1;
} else {
env_cfg.trn_log_enabled == 0;
env_cfg.cov_model_enabled == 0;
env_cfg.force_disable_csr_checks == 1;
env_cfg.scoreboard_enabled == 0;
}
}

constraint axi_agent_cfg_cons {
Expand Down

0 comments on commit d84f45e

Please sign in to comment.