Skip to content

Commit

Permalink
Merged PR 134981: Update kv scan sequence
Browse files Browse the repository at this point in the history
Update lower level scan mode sequence to make debugUnlock input to KV a pulse instead of a level
Add some helpful prints to predictor

Related work items: #591177
  • Loading branch information
Kiran Upadhyayula authored and calebofearth committed Dec 1, 2023
1 parent 340a3cd commit c5884b8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ class kv_predictor #(
p_kv_rm.val_reg.debug_mode_unlocked.set(1'b1);
p_kv_rm.val_reg.cptra_in_debug_scan_mode.set(1'b1);

`uvm_info("PRED", "Clear_secrets reg is set in debug/scan mode. Flushing KV", UVM_MEDIUM)
if (clear_secrets_data[p_kv_rm.kv_reg_rm.CLEAR_SECRETS.sel_debug_value.get_lsb_pos()] == 'h1) begin
for(entry = 0; entry < KV_NUM_KEYS; entry++) begin
//Debug mode should flush all regs inspite of locks
Expand Down Expand Up @@ -654,6 +655,7 @@ class kv_predictor #(
//Only allow clear operation if in debug mode
//if (data_active[1:0] == 'h1) begin
if (data_active [p_kv_rm.kv_reg_rm.CLEAR_SECRETS.wr_debug_values.get_lsb_pos()] && !data_active[p_kv_rm.kv_reg_rm.CLEAR_SECRETS.sel_debug_value.get_lsb_pos()]) begin
`uvm_info("PRED", "Clear_secrets reg is set in debug/scan mode. Flushing KV with DEBUG0 values", UVM_MEDIUM)
for(entry = 0; entry < KV_NUM_KEYS; entry++) begin
//Read locks before clearing - do not clear if locked
kv_reg = p_kv_rm.get_reg_by_name($sformatf("KEY_CTRL[%0d]",entry));
Expand All @@ -668,6 +670,7 @@ class kv_predictor #(
end
//else if(data_active[1:0] == 'h3) begin
else if (data_active [p_kv_rm.kv_reg_rm.CLEAR_SECRETS.wr_debug_values.get_lsb_pos()] && data_active[p_kv_rm.kv_reg_rm.CLEAR_SECRETS.sel_debug_value.get_lsb_pos()]) begin
`uvm_info("PRED", "Clear_secrets reg is set in debug/scan mode. Flushing KV with DEBUG1 values", UVM_MEDIUM)
for(entry = 0; entry < KV_NUM_KEYS; entry++) begin
//Read locks before clearing
kv_reg = p_kv_rm.get_reg_by_name($sformatf("KEY_CTRL[%0d]",entry));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,27 @@ class kv_rst_scan_on_sequence extends kv_rst_sequence_base;

task body();

// Assert debug mode
req=kv_rst_transaction::type_id::create("pwr_req");
// Assert scan mode, debugUnlock_or_scan_mode_switch
req=kv_rst_transaction::type_id::create("dbg_on_req");
start_item(req);
// Randomize the transaction
if(!req.randomize()) `uvm_fatal("KV_RST_SCAN_ON", "kv_rst_scan_on_sequence::body()-kv_rst_transaction randomization failed")
`uvm_info("KV_RST_SCAN_ON", "Enabling scan mode", UVM_MEDIUM)
`uvm_info("KV_RST_SCAN_ON", "Enabling scan mode, emulate pulse on debug_mode input", UVM_MEDIUM)
req.set_pwrgood = 1'b1;
req.assert_rst = 1'b0;
req.assert_core_rst = 1'b0;
req.debug_mode = 1'b1;
req.scan_mode = 1'b1;

finish_item(req);
`uvm_info("KV_RST_SCAN_ON", {"Response:",req.convert2string()},UVM_MEDIUM)

// Assert scan mode, deassert debugUnlock_or_scan_mode_switch
req=kv_rst_transaction::type_id::create("dbg_off_req");
start_item(req);
// Randomize the transaction
if(!req.randomize()) `uvm_fatal("KV_RST_SCAN_ON", "kv_rst_scan_on_sequence::body()-kv_rst_transaction randomization failed")
`uvm_info("KV_RST_SCAN_ON", "Reset debug_mode input", UVM_MEDIUM)
req.set_pwrgood = 1'b1;
req.assert_rst = 1'b0;
req.assert_core_rst = 1'b0;
Expand Down

0 comments on commit c5884b8

Please sign in to comment.