From 4ddad098652cc1e051a5e10f627244e0ac3608f8 Mon Sep 17 00:00:00 2001 From: Jaedon Kim Date: Mon, 14 Aug 2023 02:27:49 +0000 Subject: [PATCH] [flash_ctrl,dv] update fast alert receiver `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 --- hw/ip/flash_ctrl/dv/env/flash_ctrl_env.sv | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/ip/flash_ctrl/dv/env/flash_ctrl_env.sv b/hw/ip/flash_ctrl/dv/env/flash_ctrl_env.sv index bb28f002eaa0a..38bd0f76831f3 100644 --- a/hw/ip/flash_ctrl/dv/env/flash_ctrl_env.sv +++ b/hw/ip/flash_ctrl/dv/env/flash_ctrl_env.sv @@ -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