Skip to content

Commit

Permalink
Merge pull request #212 from pulp-platform/pulp-regressions
Browse files Browse the repository at this point in the history
Add more regressions for Integer cluster
  • Loading branch information
alex96295 authored Oct 28, 2023
2 parents f62f01d + 5ee4fd8 commit df55eb8
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 20 deletions.
6 changes: 3 additions & 3 deletions Bender.lock
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ packages:
dependencies:
- common_cells
cluster_peripherals:
revision: a596f17fc77713909bceb7eecf3ea2c3cdfe707c
revision: c015839816938a790c8da5fd5829cfc536f1ca9c
version: null
source:
Git: https://github.com/pulp-platform/cluster_peripherals.git
Expand Down Expand Up @@ -375,7 +375,7 @@ packages:
dependencies:
- axi_slice
pulp_cluster:
revision: b38a18b1594f1aa4faf8b15e426a276be7ead3aa
revision: 450eb8780a3fe62cac6bcb0b34542ede2bc7c3c0
version: null
source:
Git: https://github.com/pulp-platform/pulp_cluster.git
Expand Down Expand Up @@ -436,7 +436,7 @@ packages:
- common_cells
- common_verification
riscv:
revision: 6c56a943f272e987968a53df6dca095f939c1915
revision: 8d1fac5542625f30551f3bfd44f512e83c6a6a50
version: null
source:
Git: [email protected]:AlSaqr-platform/riscv_nn.git
Expand Down
2 changes: 1 addition & 1 deletion Bender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
hyperbus: { git: https://github.com/pulp-platform/hyperbus.git, version: 0.0.4 }
car_l2: { git: [email protected]:carfield/carfield_l2_mem.git, rev: 0143fb296e3614adf8894ff7335cc3f9b92783bd } # branch: main
safety_island: { git: [email protected]:carfield/safety-island.git, rev: 00ad366cf8823fa4d482ee0cffc866bf61f6d783 } # branch: michaero/carfield
pulp_cluster: { git: https://github.com/pulp-platform/pulp_cluster.git, rev: b38a18b1594f1aa4faf8b15e426a276be7ead3aa } # branch: yt/rapidrecovery
pulp_cluster: { git: https://github.com/pulp-platform/pulp_cluster.git, rev: 450eb8780a3fe62cac6bcb0b34542ede2bc7c3c0 } # branch: yt/rapidrecovery
opentitan: { git: https://github.com/pulp-platform/opentitan.git, rev: 4215f93b4fddbb6dcaea48a5a1dc71c2bdc38061 } # branch: carfield_soc
mailbox_unit: { git: [email protected]:pulp-platform/mailbox_unit.git, version: 1.1.0 }
apb: { git: https://github.com/pulp-platform/apb.git, version: 0.2.3 }
Expand Down
6 changes: 4 additions & 2 deletions sw/include/car_memory_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ extern void *__base_l2;
#define CAR_INT_CLUSTER_SPM_BASE_ADDR 0x50000000
#define CAR_INT_CLUSTER_SPM_END_ADDR 0x50040000

#define CAR_INT_CLUSTER_PERIPH_OFFS 0x00200000
#define CAR_INT_CLUSTER_CTRL_UNIT_OFFS 0x00000000
#define CAR_INT_CLUSTER_PERIPH_OFFS 0x00200000
#define CAR_INT_CLUSTER_CTRL_UNIT_OFFS 0x00000000
#define CAR_INT_CLUSTER_CTRL_UNIT_RETURN_OFFS 0x100
#define CAR_INT_CLUSTER_RETURN_ADDR (CAR_INT_CLUSTER_SPM_BASE_ADDR + CAR_INT_CLUSTER_PERIPH_OFFS + CAR_INT_CLUSTER_CTRL_UNIT_OFFS + CAR_INT_CLUSTER_CTRL_UNIT_RETURN_OFFS)

#define CAR_INT_CLUSTER_BOOT_ADDR_OFFS 0x40
#define CAR_INT_CLUSTER_BOOT_ADDR_REG (CAR_INT_CLUSTER_SPM_BASE_ADDR + CAR_INT_CLUSTER_PERIPH_OFFS + CAR_INT_CLUSTER_CTRL_UNIT_OFFS + CAR_INT_CLUSTER_BOOT_ADDR_OFFS)
Expand Down
5 changes: 5 additions & 0 deletions sw/include/car_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,4 +371,9 @@ void pulp_cluster_wait_eoc() {

}

uint32_t pulp_cluster_get_return(){
volatile uint32_t *pulp_return_addr = (uint32_t*)(CAR_INT_CLUSTER_RETURN_ADDR);
return readw(pulp_return_addr);
}

#endif
5 changes: 4 additions & 1 deletion sw/tests/bare-metal/hostd/pulp-offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ int main(void)
load_binary();

volatile uint32_t pulp_boot_default = 0x78008080;
volatile uint32_t pulp_ret_val = 0;

pulp_cluster_set_bootaddress(pulp_boot_default);

Expand All @@ -41,6 +42,8 @@ int main(void)

pulp_cluster_wait_eoc();

return 0;
pulp_ret_val = pulp_cluster_get_return();

return pulp_ret_val;

}
5 changes: 2 additions & 3 deletions sw/tests/bare-metal/pulpd/sw.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@

# List all the directories in the 'tests' folder
CAR_PULPD_SW := $(CAR_SW_DIR)/tests/bare-metal/pulpd
PULPD_SW_DIR := $(PULPD_ROOT)/regression-tests/parallel_bare_tests
PULPD_TEST_DIRS := $(wildcard $(PULPD_ROOT)/regression-tests/parallel_bare_tests/*)
PULPD_TEST_DIRS := $(filter-out $(wildcard $(PULPD_ROOT)/regression-tests/parallel_bare_tests/*.cfg),$(PULPD_TEST_DIRS))
PULPD_SW_DIR := $(PULPD_ROOT)/regression-tests/carfield
PULPD_TEST_DIRS := $(wildcard $(PULPD_ROOT)/regression-tests/carfield/*)

# We remove unneded TCDM sections directly from the binary we want to generate. This speeds up the standalone
# simulation when preloading the L2 memory using JTAG and Serial Link.
Expand Down
11 changes: 11 additions & 0 deletions tb/carfield_fix.sv
Original file line number Diff line number Diff line change
Expand Up @@ -448,4 +448,15 @@ module carfield_soc_fixture;
secure_boot = sb;
endtask

task automatic slink_read_reg(
input doub_bt addr,
output word_bt data,
input int unsigned idle_cycles
);
axi_data_t beats [$];
#(ClkPeriodSys * idle_cycles);
chs_vip.slink_read_beats(addr, 2, 0, beats);
data = beats[0];
endtask

endmodule
22 changes: 12 additions & 10 deletions tb/carfield_tb.sv
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ module tb_carfield_soc;
localparam int unsigned PulpdBootAddrL2 = CarL2StartAddr + 32'h8080;
localparam int unsigned PulpdBootAddrDram = CarDramStartAddr + 32'h8080;
localparam int unsigned PulpdBootAddr = 32'h50200040;
localparam int unsigned PulpdRetAddr = 32'h50200100;
localparam int unsigned CarSocCtrlPulpdClkEnRegAddr = 32'h20010078;
localparam int unsigned CarSocCtrlPulpdIsolateRegAddr = 32'h20010048;
localparam int unsigned CarSocCtrlPulpdIsolateStatusRegAddr = 32'h20010060;
Expand All @@ -78,6 +79,7 @@ module tb_carfield_soc;
string pulpd_preload_elf;
logic [1:0] pulpd_boot_mode;
bit [31:0] pulpd_exit_code;
bit [31:0] pulpd_ret_val;
doub_bt pulpd_binary_entry;
doub_bt pulpd_reg_value;

Expand Down Expand Up @@ -314,21 +316,21 @@ module tb_carfield_soc;

// boot
// Write bootaddress to each core
$display("[SLINK PULPD] Write PULP cluster boot address for each core");
$display("[JTAG PULPD] Write PULP cluster boot address for each core");
for (int c = 0; c < PulpdNumCores; c++) begin
fix.chs_vip.jtag_write_reg32(PulpdBootAddr + c*32'h4, PulpdBootAddrL2);
end
// Write boot enable
$display("[SLINK PULPD] Write PULP cluster boot enable");
$display("[JTAG PULPD] Write PULP cluster boot enable");
fix.chs_vip.jtag_write_reg32(CarSocCtrlPulpdBootEnAddr, 32'h1);
// Write fetch enable
$display("[SLINK PULPD] Write PULP cluster fetch enable");
$display("[JTAG PULPD] Write PULP cluster fetch enable");
fix.chs_vip.jtag_write_reg32(CarSocCtrlPulpdFetchEnAddr, 32'h1);

// Poll memory address for PULP EOC
fix.chs_vip.jtag_poll_bit0(CarSocCtrlPulpdEocAddr, pulpd_exit_code, 20);
pulpd_exit_code >>= 1;
if (pulpd_exit_code) $error("[JTAG PULP] FAILED: return code %0d", pulpd_exit_code);
fix.slink_read_reg(PulpdRetAddr, pulpd_ret_val, 20);
if (pulpd_ret_val[30:0] != 'h0) $error("[JTAG PULP] FAILED: return code %x", pulpd_ret_val);
else $display("[JTAG PULP] SUCCESS");
end

Expand All @@ -343,7 +345,7 @@ module tb_carfield_soc;
// Write bootaddress to each core
$display("[SLINK PULPD] Write PULP cluster boot address for each core");
for (int c = 0; c < PulpdNumCores; c++) begin
fix.chs_vip.jtag_write_reg32(PulpdBootAddr + c*32'h4, PulpdBootAddrL2);
fix.chs_vip.slink_write_32(PulpdBootAddr + c*32'h4, PulpdBootAddrL2);
end
// Write boot enable
$display("[SLINK PULPD] Write PULP cluster boot enable");
Expand All @@ -354,8 +356,8 @@ module tb_carfield_soc;

// Poll memory address for PULP EOC
fix.chs_vip.slink_poll_bit0(CarSocCtrlPulpdEocAddr, pulpd_exit_code, 20);
pulpd_exit_code >>= 1;
if (pulpd_exit_code) $error("[SLINK PULP] FAILED: return code %0d", pulpd_exit_code);
fix.slink_read_reg(PulpdRetAddr, pulpd_ret_val, 20);
if (pulpd_ret_val[30:0] != 'h0) $error("[SLINK PULP] FAILED: return code %x", pulpd_ret_val);
else $display("[SLINK PULP] SUCCESS");
end
default: begin
Expand Down Expand Up @@ -402,8 +404,8 @@ module tb_carfield_soc;

// Poll memory address for PULP EOC
fix.chs_vip.slink_poll_bit0(CarSocCtrlPulpdEocAddr, pulpd_exit_code, 20);
pulpd_exit_code >>= 1;
if (pulpd_exit_code) $error("[SLINK PULP] FAILED: return code %0d", pulpd_exit_code);
fix.slink_read_reg(PulpdRetAddr, pulpd_ret_val, 20);
if (pulpd_ret_val[30:0] != 'h0) $error("[JTAG PULP] FAILED: return code %x", pulpd_ret_val);
else $display("[SLINK PULP] SUCCESS");

$finish;
Expand Down

0 comments on commit df55eb8

Please sign in to comment.