Skip to content

Commit

Permalink
Adjust TB to fix PULP tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvan Tortorella committed Aug 31, 2024
1 parent 344e11b commit 8dae911
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions target/sim/src/astral_tb.sv
Original file line number Diff line number Diff line change
Expand Up @@ -371,18 +371,29 @@ module tb_astral;
if (!$value$plusargs("PULPD_BINARY=%s", pulpd_preload_elf)) pulpd_preload_elf = "";
if (!$value$plusargs("HYP_USER_PRELOAD=%s", hyp_user_preload)) hyp_user_preload = 0;

// PLL bypass
fix.set_bypass_pll(bypass_pll);

// Wait for reset
// Wait for system reset from Cheshire VIP
fix.chs_vip.wait_for_reset();

// Wait for FLL lock
fix.wait_fll_lock();

if (pulpd_preload_elf != "") begin
// Configure padframe for Serial Link usage depending
// on the selected preload-mode
if (pulpd_boot_mode == 1) begin: gen_pulpd_slink_cfg
// Configure Serial link padframe
fix.configure_sl_pad(jtag_check_write);

wait (pad_configured.triggered);
-> pad_configured;
end else begin: pulpd_jtag_init
$display("[JTAG PULPD] Init ");
fix.chs_vip.jtag_init();
end

// PLL bypass
fix.set_bypass_pll(bypass_pll);
$display("0");

if (pulpd_preload_elf != "") begin

$display("[TB] %t - Enabling PULP cluster clock for stand-alone tests ", $realtime);
// Clock island after PoR
Expand All @@ -393,9 +404,6 @@ module tb_astral;

case (pulpd_boot_mode)
0: begin
// JTAG
$display("[JTAG PULPD] Init ");
fix.chs_vip.jtag_init();
$display("[JTAG PULPD] Halt the core and load the binary to L2 ");
fix.chs_vip.jtag_elf_halt_load(pulpd_preload_elf, pulpd_binary_entry );

Expand All @@ -419,9 +427,7 @@ module tb_astral;
else $display("[JTAG PULP] SUCCESS");
end

1: begin
// serial link

1: begin // -> Serial Link
// preload
$display("[SLINK PULPD] Preload the binary to L2 ");
fix.chs_vip.slink_elf_preload(pulpd_preload_elf, pulpd_binary_entry);
Expand Down Expand Up @@ -451,6 +457,8 @@ module tb_astral;
endcase

$finish;
end else begin
$error("[PULP TB] No binary preloaded.");
end

// Fast preload of hyperram
Expand Down

0 comments on commit 8dae911

Please sign in to comment.