Skip to content

Commit

Permalink
Merge pull request #54 from pulp-platform/yt/fix-pulp-tb
Browse files Browse the repository at this point in the history
Fix PULP cluster testbench and parameters.
  • Loading branch information
yvantor authored Sep 5, 2024
2 parents 1e4591e + d84e270 commit d200567
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion sw/include/car_properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

#define IntClustNumCores 12
#define IntClustNumCores 8
26 changes: 15 additions & 11 deletions target/sim/src/astral_tb.sv
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ module tb_astral;
// Useful register addresses
localparam int unsigned CarL2StartAddr = carfield_configuration::L2Port0Base;
localparam int unsigned CarDramStartAddr = 32'h8000_0000;
localparam int unsigned PulpdNumCores = 12;
localparam int unsigned PulpdBootAddrL2 = CarL2StartAddr + 32'h8080;
localparam int unsigned PulpdBootAddrDram = CarDramStartAddr + 32'h8080;
localparam int unsigned PulpdBootAddr = carfield_configuration::PulpClusterBase + 32'h00200040;
Expand Down Expand Up @@ -387,27 +386,32 @@ module tb_astral;
fix.configure_sl_pad(jtag_check_write);

-> pad_configured;
$display("[TB] %t - Enabling PULP cluster clock for stand-alone tests ", $realtime);
// Clock island after PoR
fix.chs_vip.slink_write_32(CarSocCtrlPulpdClkEnRegAddr, 32'h1);
$display("[TB] %t - De-isolate PULP cluster for stand-alone tests ", $realtime);
// De-isolate island after PoR
fix.chs_vip.slink_write_32(CarSocCtrlPulpdIsolateRegAddr, 32'h0);
end else begin: pulpd_jtag_init
$display("[JTAG PULPD] Init ");
fix.chs_vip.jtag_init();
$display("[TB] %t - Enabling PULP cluster clock for stand-alone tests ", $realtime);
// Clock island after PoR
fix.chs_vip.jtag_write_reg32(CarSocCtrlPulpdClkEnRegAddr, 32'h1, jtag_check_write);
$display("[TB] %t - De-isolate PULP cluster for stand-alone tests ", $realtime);
// De-isolate island after PoR
fix.chs_vip.jtag_write_reg32(CarSocCtrlPulpdIsolateRegAddr, 32'h0, jtag_check_write);
end

$display("[TB] %t - Enabling PULP cluster clock for stand-alone tests ", $realtime);
// Clock island after PoR
fix.chs_vip.slink_write_32(CarSocCtrlPulpdClkEnRegAddr, 32'h1);
$display("[TB] %t - De-isolate PULP cluster for stand-alone tests ", $realtime);
// De-isolate island after PoR
fix.chs_vip.slink_write_32(CarSocCtrlPulpdIsolateRegAddr, 32'h0);

case (pulpd_boot_mode)
0: begin
$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 );
fix.chs_vip.jtag_elf_preload(pulpd_preload_elf, pulpd_binary_entry );

// boot
// Write bootaddress to each core
$display("[JTAG PULPD] Write PULP cluster boot address for each core");
for (int c = 0; c < PulpdNumCores; c++) begin
for (int c = 0; c < carfield_pkg::IntClusterNumCores; c++) begin
fix.chs_vip.jtag_write_reg32(PulpdBootAddr + c*32'h4, PulpdBootAddrL2, jtag_check_write);
end
// Write boot enable
Expand All @@ -432,7 +436,7 @@ module tb_astral;
// boot
// Write bootaddress to each core
$display("[SLINK PULPD] Write PULP cluster boot address for each core");
for (int c = 0; c < PulpdNumCores; c++) begin
for (int c = 0; c < carfield_pkg::IntClusterNumCores; c++) begin
fix.chs_vip.slink_write_32(PulpdBootAddr + c*32'h4, PulpdBootAddrL2);
end
// Write boot enable
Expand Down

0 comments on commit d200567

Please sign in to comment.