Skip to content

Commit

Permalink
[flash_ctrl,dv] update fast alert receiver
Browse files Browse the repository at this point in the history
`flash_ctrl_mp_regions` test requires 32 consequtive recover alerts.
When async frequency of alert agent is too slow, receiver alert agent misses alerts
and causes test fail.
Adjust frequency range of receiver alert agent just for this test.

Signed-off-by: Jaedon Kim <[email protected]>
  • Loading branch information
jdonjdon committed Aug 18, 2023
1 parent 1325eda commit ee4f829
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions hw/ip/flash_ctrl/dv/env/flash_ctrl_env.sv
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,16 @@ class flash_ctrl_env #(
cfg.m_fpp_agent_cfg.scb_otf_en = cfg.scb_otf_en;
endfunction

virtual function void end_of_elaboration_phase(uvm_phase phase);
super.end_of_elaboration_phase(phase);
// For fast receiver, set the range of asyn frequency between 1/5 and 10 times
// of core frequency
foreach (cfg.m_alert_agent_cfgs[i]) begin
if (cfg.m_alert_agent_cfgs[i].fast_rcvr) begin
int freq_mhz = cfg.clk_freq_mhz / 5;
cfg.m_alert_agent_cfgs[i].vif.clk_rst_async_if.set_freq_mhz(
$urandom_range(freq_mhz, cfg.clk_freq_mhz * 10));
end
end
endfunction
endclass

0 comments on commit ee4f829

Please sign in to comment.