From 44ed2584d869510406b8ec13f6533f9c9376acf9 Mon Sep 17 00:00:00 2001 From: Yvan Tortorella Date: Thu, 8 Jun 2023 07:27:26 +0200 Subject: [PATCH 1/5] Aligned Hart IDs of all subsystems except Spatz. --- Bender.local | 2 +- Bender.lock | 8 ++++---- Bender.yml | 4 ++-- hw/carfield.sv | 2 ++ hw/carfield_pkg.sv | 13 ++++++++++++- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Bender.local b/Bender.local index 9f104646..1fd7ef34 100644 --- a/Bender.local +++ b/Bender.local @@ -13,4 +13,4 @@ overrides: hier-icache: { git: "https://github.com/pulp-platform/hier-icache.git" , rev: a7e3f4e4c7fe607bcd6b9d94db77f612fd6ef6be } scm: { git: "https://github.com/pulp-platform/scm.git" , rev: f7b51416f3c407e4c31e9c016616d57aae2687bd } cluster_interconnect: { git: "https://github.com/pulp-platform/cluster_interconnect.git", rev: 89e1019d64a86425211be6200770576cbdf3e8b3 } # branch: assertion-fix - obi: { git: "https://github.com/pulp-platform/obi.git" , rev: c54a7374bce9f4239c07f950ced339af926b5ff8 } # branch: atops + obi: { git: "https://github.com/pulp-platform/obi.git" , rev: c54a7374bce9f4239c07f950ced339af926b5ff8 } # branch: atops \ No newline at end of file diff --git a/Bender.lock b/Bender.lock index fc41a889..a7e1d362 100644 --- a/Bender.lock +++ b/Bender.lock @@ -77,7 +77,7 @@ packages: revision: 97dcb14ef057cbe5bd70dda2060b5bb9e7e04c6d version: 0.7.0 source: - Git: https://github.com/pulp-platform/axi_riscv_atomics + Git: https://github.com/pulp-platform/axi_riscv_atomics.git dependencies: - axi - common_cells @@ -348,7 +348,7 @@ packages: - common_cells - common_verification opentitan: - revision: ed1e7f1d53e28de556a3b02bc1bd1b855f51af15 + revision: cce5a6e0bacba31374109969adcd7abb0f70f7ec version: null source: Git: https://github.com/alsaqr-platform/opentitan.git @@ -371,7 +371,7 @@ packages: dependencies: - axi_slice pulp_cluster: - revision: bd8182aaa33f2b0ac7bf924621f094a382d8ab17 + revision: a389cab95ac978ddeaeb557c7e8a311863e0de90 version: null source: Git: https://github.com/pulp-platform/pulp_cluster.git @@ -433,7 +433,7 @@ packages: - common_cells - common_verification riscv: - revision: 4ceb402db8619718a9170058bb31f75fcdf7ed1c + revision: 4ef49607a0093378d3f6dccce2e673178d6481af version: null source: Git: git@github.com:AlSaqr-platform/riscv_nn.git diff --git a/Bender.yml b/Bender.yml index 5ad9d03f..5de21dfd 100644 --- a/Bender.yml +++ b/Bender.yml @@ -16,8 +16,8 @@ dependencies: hyperbus: { git: https://github.com/pulp-platform/hyperbus.git, rev: 2adb7271438cdb96c19fbaf3e2a6bf89ffeee568 } # branch: lv/phys_in_use car_l2: { git: git@iis-git.ee.ethz.ch:carfield/carfield_l2_mem.git, rev: 08503a05307ef556ed5439619c70c039ff93d77a } # branch: main safety_island: { git: git@iis-git.ee.ethz.ch:carfield/safety-island.git, rev: 60e768a3ef29f47339e31674d497293f5a768893 } # branch: atops - pulp_cluster: { git: https://github.com/pulp-platform/pulp_cluster.git, rev: bd8182aaa33f2b0ac7bf924621f094a382d8ab17 } # branch: yt/carfield-integration - opentitan: { git: https://github.com/alsaqr-platform/opentitan.git, rev: ed1e7f1d53e28de556a3b02bc1bd1b855f51af15 } # branch: lowRISC-rebase + pulp_cluster: { git: https://github.com/pulp-platform/pulp_cluster.git, rev: a389cab95ac978ddeaeb557c7e8a311863e0de90 } # branch: yt/carfield-integration + opentitan: { git: https://github.com/alsaqr-platform/opentitan.git, rev: cce5a6e0bacba31374109969adcd7abb0f70f7ec } # branch: yt/hartid mailbox_unit: { git: git@github.com:pulp-platform/mailbox_unit.git, version: 1.1.0 } apb: { git: https://github.com/pulp-platform/apb.git, version: 0.2.3 } timer_unit: { git: https://github.com/pulp-platform/timer_unit.git, version: 1.0.2 } diff --git a/hw/carfield.sv b/hw/carfield.sv index 2f521a83..21f4f9c2 100644 --- a/hw/carfield.sv +++ b/hw/carfield.sv @@ -1302,6 +1302,7 @@ assign car_regs_hw2reg.pulp_cluster_busy.de = 1'b1; assign car_regs_hw2reg.pulp_cluster_eoc.d = pulpcl_eoc; pulp_cluster #( + .HartIdOffs ( PulpHartIdOffs ), .NB_CORES ( IntClusterNumCores ), .NB_HWPE_PORTS ( IntClusterNumHwpePorts ), .NB_DMAS ( IntClusterNumDmas ), @@ -1505,6 +1506,7 @@ spatz_cluster_wrapper #( logic secd_mbox_intr; secure_subsystem_synth_wrap #( + .HartIdOffs ( OpnTitHartIdOffs ), .AxiAddrWidth ( Cfg.AddrWidth ), .AxiDataWidth ( Cfg.AxiDataWidth ), .AxiUserWidth ( Cfg.AxiUserWidth ), diff --git a/hw/carfield_pkg.sv b/hw/carfield_pkg.sv index 78552f3b..8802584c 100644 --- a/hw/carfield_pkg.sv +++ b/hw/carfield_pkg.sv @@ -152,9 +152,20 @@ localparam bit [3:0] AxiNumExtSlv = 3'd2 + 3'd1 + 3'd1 + 3'd1 + 3'd1 + 3'd1 + 3' // Ext Masters: Integer Cluster + Security Island + Safety Island + Floating Point Cluster localparam bit [2:0] AxiNumExtMst = 3'd1 + 3'd1 + 3'd1 + 3'd1; +// Hart IDs +typedef bit [5:0] hartid_t; + +typedef enum hartid_t { + ChsHartIdOffs = 'd0 , + OpnTitHartIdOffs = 'd4 , + SafetyIslHartIdOffs = 'd8 , + SpatzHartIdOffs = 'd16, + PulpHartIdOffs = 'd32 +} hartid_offs_e; + // Safety island configuration localparam safety_island_cfg_t SafetyIslandCfg = '{ - HartId: 32'd8, + HartId: SafetyIslHartIdOffs, BankNumBytes: 32'h0001_0000, // JTAG ID code: // LSB [0]: 1'h1 From d6da0a87952a51135703debc610d2add43c5b538 Mon Sep 17 00:00:00 2001 From: Yvan Tortorella Date: Thu, 8 Jun 2023 07:29:21 +0200 Subject: [PATCH 2/5] Making the rule for compile script a PHONY target (this is needed to be sure the compile script is recreated when we update deps and compile the code). --- carfield.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/carfield.mk b/carfield.mk index 8a1548f9..6cfdb270 100644 --- a/carfield.mk +++ b/carfield.mk @@ -131,6 +131,7 @@ $(CAR_ROOT)/tb/hyp_vip: cp model_tmp/exe_folder/S27ks0641/model/s27ks0641.v model_tmp/exe_folder/S27ks0641/model/s27ks0641_verilog.sdf $@ rm -rf model_tmp +.PHONY: scripts/carfield_compile.tcl scripts/carfield_compile.tcl: $(BENDER) script vsim $(TARGETS) $(DEFINES) --vlog-arg="$(VLOG_ARGS)" > $@ echo 'vlog "$(CURDIR)/$(CHS_ROOT)/target/sim/src/elfloader.cpp" -ccflags "-std=c++11"' >> $@ From ab04e449ac321027c7035e7f01ea07a83a02b116 Mon Sep 17 00:00:00 2001 From: Yvan Tortorella Date: Thu, 8 Jun 2023 13:12:48 +0200 Subject: [PATCH 3/5] Updating Bender.lock after rebasing on main. --- Bender.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bender.lock b/Bender.lock index a7e1d362..7a77ce0b 100644 --- a/Bender.lock +++ b/Bender.lock @@ -77,7 +77,7 @@ packages: revision: 97dcb14ef057cbe5bd70dda2060b5bb9e7e04c6d version: 0.7.0 source: - Git: https://github.com/pulp-platform/axi_riscv_atomics.git + Git: https://github.com/pulp-platform/axi_riscv_atomics dependencies: - axi - common_cells From 0564dd5da4bc657552693825e420c3c14bb0df36 Mon Sep 17 00:00:00 2001 From: Yvan Tortorella Date: Fri, 9 Jun 2023 10:43:33 +0200 Subject: [PATCH 4/5] Aligned Spatz Hart ID. --- Bender.lock | 4 ++-- Bender.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Bender.lock b/Bender.lock index 7a77ce0b..e2c88bb1 100644 --- a/Bender.lock +++ b/Bender.lock @@ -189,7 +189,7 @@ packages: revision: 9c07fa860593b2caabd9b5681740c25fac04b878 version: 0.2.3 source: - Git: https://github.com/pulp-platform/common_verification.git + Git: https://github.com/pulp-platform/common_verification dependencies: [] cv32e40p: revision: 9b77611a1d0c681f4819798d95422b0b895528a2 @@ -486,7 +486,7 @@ packages: - common_cells - register_interface spatz: - revision: dbc4c442bd54a538bcafd0d62fec2b608a359dc3 + revision: e947ee755579402e29d7faf919d175707e6d8ad9 version: null source: Git: git@iis-git.ee.ethz.ch:spatz/spatz.git diff --git a/Bender.yml b/Bender.yml index 5de21dfd..59b56d33 100644 --- a/Bender.yml +++ b/Bender.yml @@ -23,7 +23,7 @@ dependencies: timer_unit: { git: https://github.com/pulp-platform/timer_unit.git, version: 1.0.2 } apb_adv_timer: { git: https://github.com/pulp-platform/apb_adv_timer.git, version: 1.0.4 } can_bus: { git: git@github.com:AlSaqr-platform/can_bus.git, rev: 230222cc568b49b39a3385b12edaf680657bc69d } - spatz: { git: git@iis-git.ee.ethz.ch:spatz/spatz.git, rev: dbc4c442bd54a538bcafd0d62fec2b608a359dc3 } # branch: main + spatz: { git: git@iis-git.ee.ethz.ch:spatz/spatz.git, rev: e947ee755579402e29d7faf919d175707e6d8ad9 } # branch: yt/hartid bus_err_unit: { git: git@iis-git.ee.ethz.ch:carfield/bus_err_unit.git, rev: 47a6436dc4b4b7f4a44f7786033b22c6d01530b2 } # branch: main common_cells: { git: https://github.com/pulp-platform/common_cells.git, version: 1.30.0 } From e4301b5d2625e16b811e72879b82e98e1e0fe97f Mon Sep 17 00:00:00 2001 From: Yvan Tortorella Date: Mon, 26 Jun 2023 20:04:22 +0200 Subject: [PATCH 5/5] Bumped Spatz and PULP clusters to meet the Hart ID scheme. --- Bender.lock | 6 +++--- Bender.yml | 4 ++-- hw/carfield.sv | 1 - hw/carfield_pkg.sv | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Bender.lock b/Bender.lock index e2c88bb1..ea248444 100644 --- a/Bender.lock +++ b/Bender.lock @@ -371,7 +371,7 @@ packages: dependencies: - axi_slice pulp_cluster: - revision: a389cab95ac978ddeaeb557c7e8a311863e0de90 + revision: a746000f9dc9965e1351186905b59bca36edef57 version: null source: Git: https://github.com/pulp-platform/pulp_cluster.git @@ -433,7 +433,7 @@ packages: - common_cells - common_verification riscv: - revision: 4ef49607a0093378d3f6dccce2e673178d6481af + revision: 4eac53237c6d0062715d17016fe95462eb81ebc3 version: null source: Git: git@github.com:AlSaqr-platform/riscv_nn.git @@ -486,7 +486,7 @@ packages: - common_cells - register_interface spatz: - revision: e947ee755579402e29d7faf919d175707e6d8ad9 + revision: 05b01d6a0045496ad82d393355158e3b3438438e version: null source: Git: git@iis-git.ee.ethz.ch:spatz/spatz.git diff --git a/Bender.yml b/Bender.yml index 59b56d33..983a11cb 100644 --- a/Bender.yml +++ b/Bender.yml @@ -16,14 +16,14 @@ dependencies: hyperbus: { git: https://github.com/pulp-platform/hyperbus.git, rev: 2adb7271438cdb96c19fbaf3e2a6bf89ffeee568 } # branch: lv/phys_in_use car_l2: { git: git@iis-git.ee.ethz.ch:carfield/carfield_l2_mem.git, rev: 08503a05307ef556ed5439619c70c039ff93d77a } # branch: main safety_island: { git: git@iis-git.ee.ethz.ch:carfield/safety-island.git, rev: 60e768a3ef29f47339e31674d497293f5a768893 } # branch: atops - pulp_cluster: { git: https://github.com/pulp-platform/pulp_cluster.git, rev: a389cab95ac978ddeaeb557c7e8a311863e0de90 } # branch: yt/carfield-integration + pulp_cluster: { git: https://github.com/pulp-platform/pulp_cluster.git, rev: a746000f9dc9965e1351186905b59bca36edef57 } # branch: yt/carfield-integration opentitan: { git: https://github.com/alsaqr-platform/opentitan.git, rev: cce5a6e0bacba31374109969adcd7abb0f70f7ec } # branch: yt/hartid mailbox_unit: { git: git@github.com:pulp-platform/mailbox_unit.git, version: 1.1.0 } apb: { git: https://github.com/pulp-platform/apb.git, version: 0.2.3 } timer_unit: { git: https://github.com/pulp-platform/timer_unit.git, version: 1.0.2 } apb_adv_timer: { git: https://github.com/pulp-platform/apb_adv_timer.git, version: 1.0.4 } can_bus: { git: git@github.com:AlSaqr-platform/can_bus.git, rev: 230222cc568b49b39a3385b12edaf680657bc69d } - spatz: { git: git@iis-git.ee.ethz.ch:spatz/spatz.git, rev: e947ee755579402e29d7faf919d175707e6d8ad9 } # branch: yt/hartid + spatz: { git: git@iis-git.ee.ethz.ch:spatz/spatz.git, rev: 05b01d6a0045496ad82d393355158e3b3438438e } # branch: yt/hartid bus_err_unit: { git: git@iis-git.ee.ethz.ch:carfield/bus_err_unit.git, rev: 47a6436dc4b4b7f4a44f7786033b22c6d01530b2 } # branch: main common_cells: { git: https://github.com/pulp-platform/common_cells.git, version: 1.30.0 } diff --git a/hw/carfield.sv b/hw/carfield.sv index 21f4f9c2..d1b943ab 100644 --- a/hw/carfield.sv +++ b/hw/carfield.sv @@ -1302,7 +1302,6 @@ assign car_regs_hw2reg.pulp_cluster_busy.de = 1'b1; assign car_regs_hw2reg.pulp_cluster_eoc.d = pulpcl_eoc; pulp_cluster #( - .HartIdOffs ( PulpHartIdOffs ), .NB_CORES ( IntClusterNumCores ), .NB_HWPE_PORTS ( IntClusterNumHwpePorts ), .NB_DMAS ( IntClusterNumDmas ), diff --git a/hw/carfield_pkg.sv b/hw/carfield_pkg.sv index 8802584c..f61b6f30 100644 --- a/hw/carfield_pkg.sv +++ b/hw/carfield_pkg.sv @@ -373,8 +373,8 @@ localparam int unsigned IntClusterAxiIdInWidth = $clog2(IntClusterNumCacheBanks) localparam int unsigned IntClusterAxiIdOutWidth = IntClusterAxiIdInWidth + $clog2(IntClusterNumAxiSlv); localparam int unsigned IntClusterMaxUniqId = 1; -localparam logic [ 5:0] IntClusterIndex = '0; localparam int unsigned IntClusterNumEoc = 1; +localparam logic [ 5:0] IntClusterIndex = (PulpHartIdOffs >> 5); /*******************************/ /* Narrow Parameters: A32, D32 */