From 344e11bdb977b4d8760a2f075d89e84f05524138 Mon Sep 17 00:00:00 2001 From: Yvan Tortorella Date: Fri, 30 Aug 2024 20:02:29 +0200 Subject: [PATCH] Restore `set_bypass_pll` task and pass BYPASS_PLL param to start script. --- target/sim/src/astral_fix.sv | 8 ++++++-- target/sim/src/astral_tb.sv | 10 +++++----- target/sim/vsim/start.carfield_soc.tcl | 1 + 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/target/sim/src/astral_fix.sv b/target/sim/src/astral_fix.sv index 68eb10ff..673d5b77 100644 --- a/target/sim/src/astral_fix.sv +++ b/target/sim/src/astral_fix.sv @@ -292,10 +292,10 @@ module astral_fixture; // Clock assign w_ref_clk = ref_clk; - // PLL bypass - assign w_bypass_pll = bypass_pll; // External clock assign w_ext_clk = ext_clk; + // PLL/FLL bypass + assign w_bypass_pll = bypass_pll; // POR `ifndef BYPASS_PLL assign w_pwr_on_rst_n = pwr_on_rst_n; @@ -868,6 +868,10 @@ module astral_fixture; `endif endtask + task set_bypass_pll(input logic bypass); + bypass_pll = bypass; + endtask + task set_secure_boot(input logic sb); secure_boot = sb; endtask // set_secure_boot diff --git a/target/sim/src/astral_tb.sv b/target/sim/src/astral_tb.sv index 132aa7d0..935c3d33 100644 --- a/target/sim/src/astral_tb.sv +++ b/target/sim/src/astral_tb.sv @@ -86,7 +86,7 @@ module tb_astral; if (!$value$plusargs("CHS_MEM_RAND=%d", chs_mem_rand)) chs_mem_rand = 0; // PLL bypass - fix.bypass_pll = bypass_pll; + fix.set_bypass_pll(bypass_pll); // Set boot mode and preload boot image if there is one fix.set_secure_boot(secure_boot); @@ -231,7 +231,7 @@ module tb_astral; if (!$value$plusargs("SAFED_BINARY=%s", safed_preload_elf)) safed_preload_elf = ""; // PLL bypass - fix.bypass_pll = bypass_pll; + fix.set_bypass_pll(bypass_pll); // set secure boot mode fix.set_secure_boot(secure_boot); @@ -294,7 +294,7 @@ module tb_astral; if (!$value$plusargs("SECD_BOOTMODE=%d", secd_boot_mode)) secd_boot_mode = 0; // PLL bypass - fix.bypass_pll = bypass_pll; + fix.set_bypass_pll(bypass_pll); // set secure boot mode fix.set_secure_boot(secure_boot); @@ -372,7 +372,7 @@ module tb_astral; if (!$value$plusargs("HYP_USER_PRELOAD=%s", hyp_user_preload)) hyp_user_preload = 0; // PLL bypass - fix.bypass_pll = bypass_pll; + fix.set_bypass_pll(bypass_pll); // Wait for reset fix.chs_vip.wait_for_reset(); @@ -525,7 +525,7 @@ module tb_astral; if (!$value$plusargs("SPATZD_BINARY=%s", spatzd_preload_elf)) spatzd_preload_elf = ""; // PLL bypass - fix.bypass_pll = bypass_pll; + fix.set_bypass_pll(bypass_pll); // set secure boot mode fix.set_secure_boot(secure_boot); diff --git a/target/sim/vsim/start.carfield_soc.tcl b/target/sim/vsim/start.carfield_soc.tcl index 08f9c153..968938fa 100644 --- a/target/sim/vsim/start.carfield_soc.tcl +++ b/target/sim/vsim/start.carfield_soc.tcl @@ -12,6 +12,7 @@ if {[info exists VSIM_FLAGS]} { append flags "${VSIM_FLAGS}" } set pargs "" if {[info exists HYP_USER_PRELOAD]} { append pargs "+HYP_USER_PRELOAD=${HYP_USER_PRELOAD} " } +if {[info exists BYPASS_PLL]} { append pargs "+BYPASS_PLL=${BYPASS_PLL} " } if {[info exists SECURE_BOOT]} { append pargs "+SECURE_BOOT=${SECURE_BOOT} " } if {[info exists CHS_BOOTMODE]} { append pargs "+CHS_BOOTMODE=${CHS_BOOTMODE} " } if {[info exists CHS_PRELMODE]} { append pargs "+CHS_PRELMODE=${CHS_PRELMODE} " }