Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding CI flow. #2

Merged
merged 12 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
uses: pulp-platform/pulp-actions/gitlab-ci@v1
with:
domain: iis-git.ee.ethz.ch
repo: github-mirror/carfield
repo: github-mirror/astral
token: ${{ secrets.GITLAB_TOKEN }}
poll-count: 2160
1 change: 0 additions & 1 deletion Bender.local
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ overrides:
axi: { git: https://github.com/pulp-platform/axi.git , version: 0.39.1 }
axi_riscv_atomics: { git: https://github.com/pulp-platform/axi_riscv_atomics.git , version: 0.8.2 }
apb: { git: "https://github.com/pulp-platform/apb.git" , version: 0.2.3 }
register_interface: { git: "https://github.com/pulp-platform/register_interface.git" , rev: "e4b20be8833180863ebc64675c93b1694239c505" } # branch: astral
redundancy_cells: { git: "https://github.com/pulp-platform/redundancy_cells.git" , rev: "c37bdb47339bf70e8323de8df14ea8bbeafb6583" } # branch: astral-rebase
hci: { git: "https://github.com/pulp-platform/hci.git" , rev: v1.1 }
tech_cells_generic: { git: "https://github.com/pulp-platform/tech_cells_generic.git" , version: =0.2.13 }
Expand Down
10 changes: 5 additions & 5 deletions Bender.lock
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ packages:
Git: https://github.com/AlSaqr-platform/can_bus.git
dependencies: []
cheshire:
revision: fc09f729a3ead5efcdd7b7ff579776820e0f5443
revision: 6d389373df6b54c09888f89411b7e231d2430722
version: null
source:
Git: https://github.com/pulp-platform/cheshire.git
Expand Down Expand Up @@ -162,8 +162,8 @@ packages:
dependencies:
- hci
common_cells:
revision: 2bd027cb87eaa9bf7d17196ec5f69864b35b630f
version: 1.32.0
revision: 13f28aa0021fc22c0d01a12d618fda58d2c93239
version: 1.33.0
source:
Git: https://github.com/pulp-platform/common_cells.git
dependencies:
Expand Down Expand Up @@ -419,8 +419,8 @@ packages:
- register_interface
- tech_cells_generic
register_interface:
revision: e4b20be8833180863ebc64675c93b1694239c505
version: null
revision: e25b36670ff7aab3402f40efcc2b11ee0f31cf19
version: 0.4.3
source:
Git: https://github.com/pulp-platform/register_interface.git
dependencies:
Expand Down
4 changes: 2 additions & 2 deletions Bender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ package:
- "Yvan Tortorella <[email protected]>"

dependencies:
register_interface: { git: https://github.com/pulp-platform/register_interface.git, version: 0.4.2 }
register_interface: { git: https://github.com/pulp-platform/register_interface.git, version: 0.4.3 }
axi: { git: https://github.com/pulp-platform/axi.git, version: 0.39.1 }
cheshire: { git: https://github.com/pulp-platform/cheshire.git, rev: fc09f729a3ead5efcdd7b7ff579776820e0f5443 } # branch: astral
cheshire: { git: https://github.com/pulp-platform/cheshire.git, rev: 6d389373df6b54c09888f89411b7e231d2430722 } # branch: astral-new
hyperbus: { git: https://github.com/pulp-platform/hyperbus.git, rev: f039e601c8b6590181734e6d26ff8b77aa380412 } # branch: chi/add_fsm_with_Tcsh
dyn_mem: { git: https://github.com/pulp-platform/dyn_spm.git, rev: 480590062742230dc9bd4050358a15b4747bdf34 } # branch: main
safety_island: { git: https://github.com/pulp-platform/safety_island.git, rev: aaef55c798ab53560faaf451a86668fa1e6d0f3b } # branch: carfield
Expand Down
12 changes: 6 additions & 6 deletions carfield.mk
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ include $(CAR_ROOT)/bender-safed.mk
# Nonfree components #
######################

CAR_NONFREE_REMOTE ?= [email protected]:carfield/carfield-nonfree.git
CAR_NONFREE_COMMIT ?= 54ce7e49
CAR_NONFREE_REMOTE ?= [email protected]:astral/astral-nonfree.git
CAR_NONFREE_COMMIT ?= d68da8ed

## @section Carfield platform nonfree components
## Clone the non-free verification IP for Carfield. Some components such as CI scripts and ASIC
## implementations with tech-specific resources are not open-sourced and contained in a `nonfree`
## folder cloned from a remote location, whose access is restricted. If you do not have access, this
## step will be skipped and the usage of the repository will **not** be compromised.
car-nonfree-init:
git clone $(CAR_NONFREE_REMOTE) $(CAR_ROOT)/nonfree
cd nonfree && git checkout $(CAR_NONFREE_COMMIT)
cd nonfree/intel16 && icdesign intel16 -update all -nogui
git clone $(CAR_NONFREE_REMOTE) nonfree
cd $(CAR_ROOT)/nonfree && git checkout $(CAR_NONFREE_COMMIT)
#cd nonfree/intel16 && icdesign intel16 -update all -nogui
yvantor marked this conversation as resolved.
Show resolved Hide resolved

-include nonfree/nonfree.mk
-include $(CAR_ROOT)/nonfree/nonfree.mk

#####################################
# Islands' variables initialization #
Expand Down
24 changes: 17 additions & 7 deletions hw/carfield.sv
Original file line number Diff line number Diff line change
Expand Up @@ -756,14 +756,20 @@ for (genvar i=0; i<NumSyncRegSlv; i++ ) begin : gen_chs_ext_reg_cut
);
end

// Passsing the `ext_reg_req_cut[CarfieldRegBusSlvIdx.pcrs]` value to the
yvantor marked this conversation as resolved.
Show resolved Hide resolved
yvantor marked this conversation as resolved.
Show resolved Hide resolved
// reg_req_i/rsp_o buses results in Questa's `Fatal: Unexpected signal: 11.`
// at compile time. Direct casting 'int(CarfieldRegBusSlvIdx.pcrs) also does
// not work resulting in the ext_reg_rsp_cut bus being all X. The localparam
// seems to solve the issue.
localparam int unsigned PcrsIdx = CarfieldRegBusSlvIdx.pcrs;
carfield_reg_top #(
.reg_req_t(carfield_reg_req_t),
.reg_rsp_t(carfield_reg_rsp_t)
) i_carfield_reg_top (
.clk_i (host_clk_i),
.rst_ni (host_pwr_on_rst_n),
.reg_req_i(ext_reg_req_cut[int'(CarfieldRegBusSlvIdx.pcrs)]),
.reg_rsp_o(ext_reg_rsp_cut[int'(CarfieldRegBusSlvIdx.pcrs)]),
.reg_req_i(ext_reg_req_cut[PcrsIdx]),
.reg_rsp_o(ext_reg_rsp_cut[PcrsIdx]),
.reg2hw (car_regs_reg2hw),
.hw2reg (car_regs_hw2reg),
.devmode_i (1'b1)
Expand Down Expand Up @@ -1410,9 +1416,7 @@ end
// PULP integer cluster

logic pulpcl_mbox_intr;
assign car_regs_hw2reg.pulp_cluster_eoc.de = 1'b1;
assign car_regs_hw2reg.pulp_cluster_busy.de = 1'b1;
assign car_regs_hw2reg.pulp_cluster_eoc.d = pulpcl_eoc;
assign pulpcl_eoc = car_regs_hw2reg.pulp_cluster_eoc.d;

if (CarfieldIslandsCfg.pulp.enable) begin : gen_pulp_cluster
assign pulp_rst_n = rsts_n[CarfieldDomainIdx.pulp];
Expand Down Expand Up @@ -1453,7 +1457,7 @@ if (CarfieldIslandsCfg.pulp.enable) begin : gen_pulp_cluster
.cluster_id_i ( IntClusterIndex ),
.en_sa_boot_i ( car_regs_reg2hw.pulp_cluster_boot_enable ),
.fetch_en_i ( car_regs_reg2hw.pulp_cluster_fetch_enable ),
.eoc_o ( pulpcl_eoc ),
.eoc_o ( car_regs_hw2reg.pulp_cluster_eoc.d ),
.busy_o ( car_regs_hw2reg.pulp_cluster_busy.d ),
.axi_isolate_i ( slave_isolate_req [IntClusterSlvIdx] ),
.axi_isolated_o ( master_isolated_rsp [IntClusterMstIdx] ),
Expand Down Expand Up @@ -1530,8 +1534,10 @@ end else begin : gen_no_pulp_cluster

assign safed_pulpcl_mbox_intr = '0;

assign pulpcl_eoc = '0;
assign car_regs_hw2reg.pulp_cluster_eoc.d = '0;
assign car_regs_hw2reg.pulp_cluster_eoc.de = 1'b0;
assign car_regs_hw2reg.pulp_cluster_busy.d = '0;
assign car_regs_hw2reg.pulp_cluster_busy.de = 1'b0;

assign car_regs_hw2reg.pulp_cluster_isolate_status.d = '0;
assign car_regs_hw2reg.pulp_cluster_isolate_status.de = '0;
Expand Down Expand Up @@ -1578,6 +1584,7 @@ if (CarfieldIslandsCfg.spatz.enable) begin : gen_spatz_cluster
assign slave_isolate_req[FPClusterSlvIdx] = car_regs_reg2hw.spatz_cluster_isolate.q;
assign car_regs_hw2reg.spatz_cluster_isolate_status.d = slave_isolated[FPClusterSlvIdx];
assign car_regs_hw2reg.spatz_cluster_isolate_status.de = 1'b1;
assign car_regs_hw2reg.spatz_cluster_busy.de = 1'b1;

assign slave_isolated[FPClusterSlvIdx] = slave_isolated_rsp[FPClusterSlvIdx] &
master_isolated_rsp[FPClusterMstIdx];
Expand Down Expand Up @@ -1696,7 +1703,10 @@ if (CarfieldIslandsCfg.spatz.enable) begin : gen_spatz_cluster
end else begin : gen_no_spatz_cluster
assign spatzcl_mbox_intr = '0;
assign spatzcl_timer_intr = '0;
assign car_regs_hw2reg.spatz_cluster_isolate_status.d = 1'b0;
assign car_regs_hw2reg.spatz_cluster_isolate_status.de = 1'b0;
assign car_regs_hw2reg.spatz_cluster_busy.d = '0;
assign car_regs_hw2reg.spatz_cluster_busy.de = 1'b0;
assign safed_spatzcl_mbox_intr = '0;
assign hostd_spatzcl_mbox_intr = '0;
assign spatzcl_hostd_mbox_intr = '0;
Expand Down
2 changes: 1 addition & 1 deletion hw/carfield_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -549,9 +549,9 @@ localparam cheshire_cfg_t CarfieldCfgDefault = '{
AxiUserErrLsb : 4,
RegMaxReadTxns : 8,
RegMaxWriteTxns : 8,
AxiToRegCut : 1,
RegAmoNumCuts : 1,
RegAmoPostCut : 1,
RegAdaptMemCut : 1,
// External AXI ports (at most 8 ports and rules)
AxiExtNumMst : CarfieldAxiNumMasters,
AxiExtNumSlv : CarfieldAxiNumSlaves,
Expand Down
4 changes: 2 additions & 2 deletions sw/include/hmr.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
void __attribute__((naked)) hmr_store_state() {
// Disable caches
__asm__ __volatile__ (
"csrrwi x0, 0x701, 0x0 \n\t"
"csrrwi x0, 0x7C1, 0x0 \n\t"
yvantor marked this conversation as resolved.
Show resolved Hide resolved
: : : "memory");

__asm__ __volatile__ (
Expand Down Expand Up @@ -106,7 +106,7 @@ void __attribute__((naked)) hmr_store_state() {

// Re-enable caches
__asm__ __volatile__ (
"csrrwi x0, 0x701, 0x1 \n\t"
"csrrwi x0, 0x7C1, 0x1 \n\t"
: : : "memory");

// Sleep until reset
Expand Down
8 changes: 2 additions & 6 deletions sw/tests/bare-metal/hostd/helloworld.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "params.h"
#include "util.h"
#include "car_util.h"
#include "printf.h"

int main(void) {

Expand All @@ -22,11 +23,6 @@ int main(void) {
// Init the HW
car_init_start();

char str[] = "Hello World!\r\n";
uint32_t rtc_freq = *reg32(&__base_regs, CHESHIRE_RTC_FREQ_REG_OFFSET);
uint64_t reset_freq = clint_get_core_freq(rtc_freq, 2500);
uart_init(&__base_uart, reset_freq, 115200);
uart_write_str(&__base_uart, str, sizeof(str));
uart_write_flush(&__base_uart);
printf("Hi\n");
return 0;
}
17 changes: 9 additions & 8 deletions target/sim/src/carfield_tb.sv
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module tb_carfield_soc;

// carfield top
carfield_soc_fixture fix();
bit jtag_check_write = 1'b0;

// cheshire
string chs_preload_elf;
Expand Down Expand Up @@ -336,14 +337,14 @@ module tb_carfield_soc;
// Write bootaddress to 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);
fix.chs_vip.jtag_write_reg32(PulpdBootAddr + c*32'h4, PulpdBootAddrL2, jtag_check_write);
end
// Write boot enable
$display("[JTAG PULPD] Write PULP cluster boot enable");
fix.chs_vip.jtag_write_reg32(CarSocCtrlPulpdBootEnAddr, 32'h1);
fix.chs_vip.jtag_write_reg32(CarSocCtrlPulpdBootEnAddr, 32'h1, jtag_check_write);
// Write fetch enable
$display("[JTAG PULPD] Write PULP cluster fetch enable");
fix.chs_vip.jtag_write_reg32(CarSocCtrlPulpdFetchEnAddr, 32'h1);
fix.chs_vip.jtag_write_reg32(CarSocCtrlPulpdFetchEnAddr, 32'h1, jtag_check_write);

// Poll memory address for PULP EOC
fix.chs_vip.jtag_poll_bit0(CarSocCtrlPulpdEocAddr, pulpd_exit_code, 20);
Expand Down Expand Up @@ -480,22 +481,22 @@ module tb_carfield_soc;

// write start address into the csr
$display("[JTAG SPATZD] write the CSR %x of spatz with the entry point %x", spatz_cluster_pkg::PeriStartAddr + spatz_cluster_peripheral_reg_pkg::SPATZ_CLUSTER_PERIPHERAL_CLUSTER_BOOT_CONTROL_OFFSET, spatzd_binary_entry);
fix.chs_vip.jtag_write_reg(spatz_cluster_pkg::PeriStartAddr + spatz_cluster_peripheral_reg_pkg::SPATZ_CLUSTER_PERIPHERAL_CLUSTER_BOOT_CONTROL_OFFSET, spatzd_binary_entry );
fix.chs_vip.jtag_write_reg32(spatz_cluster_pkg::PeriStartAddr + spatz_cluster_peripheral_reg_pkg::SPATZ_CLUSTER_PERIPHERAL_CLUSTER_BOOT_CONTROL_OFFSET, spatzd_binary_entry, jtag_check_write);

// Set interrupt on mailbox mailbox id MBOX_SPATZD_CORE0_ID and MBOX_SPATZD_CORE1_ID
spatzd_reg_value = 64'h1;
$display("[JTAG SPATZD] Set mailbox interrupt ID %x at %x ",MBOX_SPATZ_CORE0_ID, CAR_MBOX_BASE + MBOX_INT_SND_SET_OFFSET + (MBOX_SPATZ_CORE0_ID*32'h100));
fix.chs_vip.jtag_write_reg32(CAR_MBOX_BASE + MBOX_INT_SND_SET_OFFSET + (MBOX_SPATZ_CORE0_ID*32'h100) , spatzd_reg_value);
fix.chs_vip.jtag_write_reg32(CAR_MBOX_BASE + MBOX_INT_SND_SET_OFFSET + (MBOX_SPATZ_CORE0_ID*32'h100) , spatzd_reg_value, jtag_check_write);

$display("[JTAG SPATZD] Set mailbox interrupt ID %x at %x ",MBOX_SPATZ_CORE1_ID, CAR_MBOX_BASE + MBOX_INT_SND_SET_OFFSET + (MBOX_SPATZ_CORE1_ID*32'h100));
fix.chs_vip.jtag_write_reg32(CAR_MBOX_BASE + MBOX_INT_SND_SET_OFFSET + (MBOX_SPATZ_CORE1_ID*32'h100) , spatzd_reg_value);
fix.chs_vip.jtag_write_reg32(CAR_MBOX_BASE + MBOX_INT_SND_SET_OFFSET + (MBOX_SPATZ_CORE1_ID*32'h100) , spatzd_reg_value, jtag_check_write);

// Enable interrupt on mailbox id MBOX_SPATZ_CORE0_ID and MBOX_SPATZ_CORE1_ID
$display("[JTAG SPATZD] Enable mailbox interrupt ID %x at %x ",MBOX_SPATZ_CORE0_ID, CAR_MBOX_BASE + MBOX_INT_SND_EN_OFFSET + (MBOX_SPATZ_CORE0_ID*32'h100) ,spatzd_reg_value);
fix.chs_vip.jtag_write_reg32(CAR_MBOX_BASE + MBOX_INT_SND_EN_OFFSET + (MBOX_SPATZ_CORE0_ID*32'h100) , spatzd_reg_value);
fix.chs_vip.jtag_write_reg32(CAR_MBOX_BASE + MBOX_INT_SND_EN_OFFSET + (MBOX_SPATZ_CORE0_ID*32'h100) , spatzd_reg_value, jtag_check_write);

$display("[JTAG SPATZD] Enable mailbox interrupt ID %x at %x ",MBOX_SPATZ_CORE1_ID, CAR_MBOX_BASE + MBOX_INT_SND_EN_OFFSET + (MBOX_SPATZ_CORE1_ID*32'h100) ,spatzd_reg_value);
fix.chs_vip.jtag_write_reg32(CAR_MBOX_BASE + MBOX_INT_SND_EN_OFFSET + (MBOX_SPATZ_CORE1_ID*32'h100) , spatzd_reg_value);
fix.chs_vip.jtag_write_reg32(CAR_MBOX_BASE + MBOX_INT_SND_EN_OFFSET + (MBOX_SPATZ_CORE1_ID*32'h100) , spatzd_reg_value, jtag_check_write);

// Poll memory address for Spatz EOC
fix.chs_vip.jtag_poll_bit0(spatz_cluster_pkg::PeriStartAddr + spatz_cluster_peripheral_reg_pkg::SPATZ_CLUSTER_PERIPHERAL_CLUSTER_EOC_EXIT_OFFSET, spatzd_exit_code, 20);
Expand Down
Loading