Skip to content

Commit

Permalink
Restore set_bypass_pll task and pass BYPASS_PLL param to start script.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvan Tortorella committed Aug 30, 2024
1 parent 9d1c62b commit 344e11b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
8 changes: 6 additions & 2 deletions target/sim/src/astral_fix.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions target/sim/src/astral_tb.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions target/sim/vsim/start.carfield_soc.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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} " }
Expand Down

0 comments on commit 344e11b

Please sign in to comment.