Skip to content

Commit

Permalink
Merge pull request #52 from pulp-platform/rt/thales-tapeout-culsans
Browse files Browse the repository at this point in the history
Bump deps to include Culsans
  • Loading branch information
yvantor authored Sep 4, 2024
2 parents cdadaff + 814f326 commit 1e4591e
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 241 deletions.
19 changes: 14 additions & 5 deletions Bender.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
packages:
ace:
revision: ea2fc9ced5be964b47cfcbcd6eb6518771a9e85d
version: null
source:
Git: https://github.com/pulp-platform/ace.git
dependencies:
- axi
apb:
revision: 77ddf073f194d44b9119949d2421be59789e69ae
version: 0.2.4
Expand Down Expand Up @@ -46,7 +53,7 @@ packages:
dependencies:
- axi_slice
axi_llc:
revision: 62079f9cc13e64d1ef131377aee6801eeef52642
revision: 2f23e6fc40ac7256f177a44c1f106c70c05c6cca
version: null
source:
Git: https://github.com/pulp-platform/axi_llc
Expand Down Expand Up @@ -114,11 +121,12 @@ packages:
Git: https://github.com/AlSaqr-platform/can_bus.git
dependencies: []
cheshire:
revision: ac8b56958ca89e7ce5ebece004ea19844dd4b8ef
revision: f111bc9194f93c7d1ed5658dd2beec15f777d723
version: null
source:
Git: https://github.com/pulp-platform/cheshire.git
dependencies:
- ace
- apb_uart
- axi
- axi_llc
Expand Down Expand Up @@ -205,11 +213,12 @@ packages:
- fpnew
- tech_cells_generic
cva6:
revision: 8ccc3ff4d5dd51278d4af2b1e587b760a8e52b0d
revision: 125c68eeb1a64c20db652be15491c19e03730b70
version: null
source:
Git: https://github.com/pulp-platform/cva6.git
dependencies:
- ace
- axi
- common_cells
- fpnew
Expand Down Expand Up @@ -529,8 +538,8 @@ packages:
dependencies:
- tech_cells_generic
serial_link:
revision: 5a25f5a71074f1ebb6de7b5280f2b16924bcc666
version: 1.1.1
revision: c55df03a1da06b00e567cf968b1b1a5f40c9f802
version: 1.1.2
source:
Git: https://github.com/pulp-platform/serial_link.git
dependencies:
Expand Down
4 changes: 2 additions & 2 deletions Bender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ package:
dependencies:
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: ac8b56958ca89e7ce5ebece004ea19844dd4b8ef } # branch: astral-v0
cheshire: { git: https://github.com/pulp-platform/cheshire.git, rev: f111bc9194f93c7d1ed5658dd2beec15f777d723 } # branch: astral-v0
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 All @@ -25,7 +25,7 @@ dependencies:
apb_adv_timer: { git: https://github.com/pulp-platform/apb_adv_timer.git, version: 1.0.4 }
can_bus: { git: https://github.com/AlSaqr-platform/can_bus.git, rev: 0ec0bf8b7dab6d5e4b3f7ec58338a8efee066379 } # branch: pulp
spatz: { git: https://github.com/pulp-platform/spatz.git, rev: 98de97f24fe42675c9b4a8cc08354a03af57400a } # branch: yt/astral
common_cells: { git: https://github.com/pulp-platform/common_cells.git, version: 1.37.0 } # branch: master
common_cells: { git: https://github.com/pulp-platform/common_cells.git, version: 1.37.0 } # branch: master
pulp-ethernet: { git: https://github.com/pulp-platform/pulp-ethernet.git, rev: 1f8f1776ec494773f8e6c48e16685eb35d5f445e } # branch: handshake
riscv-dbg: { git: https://github.com/pulp-platform/riscv-dbg.git, version: =0.8.0 }
streamer: { path: /usr/scratch2/lagrev5/mciani/astral-project/streamer }
Expand Down
2 changes: 1 addition & 1 deletion bender-common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ common_targs += -t mchan
common_targs += -t integer_cluster
common_targs += -t cv32e40p_use_ff_regfile
common_targs += -t scm_use_fpga_scm
common_targs += -t cv64a6_imafdcsclic_sv39
common_targs += -t cv64a6_imafdch_sv39_wb # cv64a6_imafdcsclic_sv39
common_targs += -t rtl
# The `snitch_cluster` target is needed for iDMA backend generation
common_targs += -t snitch_cluster
Expand Down
2 changes: 1 addition & 1 deletion carfield.mk
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ car-check-litmus-tests: $(LITMUS_WORK_DIR)/litmus.log
##############
tech-repo := [email protected]:Astral/gf12.git
# no commit by default, change during development
tech-commit := 9fe2a2bcb7a636c93bceada37e23bfc08902b6b3 # branch: yt/thales
tech-commit := 183a9cde1130f2558b359619377c0afa06a7c571 # branch: yt/thales

tech-clone:
git clone $(tech-repo) tech
Expand Down
6 changes: 0 additions & 6 deletions sw/include/car_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,6 @@ uint32_t pulp_cluster_get_return(){
return readw(pulp_return_addr);
}

// Wake up sleeping hart using CLINT
static inline void wakeup_hart(unsigned int hart_id) {
writew(0x1, CAR_CLINT_BASE_ADDR + 0x4*(hart_id));
writew(0x0, CAR_CLINT_BASE_ADDR + 0x4*(hart_id));
}

// Write synchronization request in Cheshire's dedicated register
static inline void sync_req(){
writew(readw(CHESHIRE_HARTS_SYNC) | (0x1 << hart_id()), CHESHIRE_HARTS_SYNC);
Expand Down
189 changes: 0 additions & 189 deletions sw/include/hmr.h

This file was deleted.

66 changes: 29 additions & 37 deletions sw/tests/bare-metal/hostd/hmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,38 @@
//
// Test for HMR functionalities.

#include "car_util.h"
#include "util.h"
#include "printf.h"
#include "hmr.h"

int main(void) {

// We read the number of available harts.
uint32_t NumHarts = readw(CHESHIRE_NUM_INT_HARTS);
uint32_t OtherHart = NumHarts - 1 - hart_id(); // If hart_id() == 0 -> return 1;
// If hart_id() == 1 -> return 0;

// Hart 0 enters first
if (hart_id() != 0) wfi();

printf("%d!\n", hart_id());

// Only hart 0 gets here
if (hart_id() == 0){
// Check if DMR is enabled. If not, enable it
if (!readw(HMR_DMR_ENABLE))
writew(0x1, HMR_DMR_ENABLE);

// Wake up sleeping hart
wakeup_hart(OtherHart);
}

hmr_store_state(); // -> Save state on top of the stack
// Save sp (x2) in HMR dedicated reg
// Save ra (x1) in DMR checkpoint reg
// Write synchronization request
// wfi() until reset

// Both harts restart from here, but are locked as one
hmr_load_state(); // -> Code restarts executing from here because we
// re-boot from the return address (x1)
// Re-loads the saved state
// Restores the sp

printf("DMR: we are locked as hart %d!\n", hart_id());

// The two locked harts return
return 0;
// Hart 0 enters first
printf("%d!\n", hart_id());

// Only hart 0 gets here
if (hart_id() == 0) {
// Check if DMR is enabled. If not, enable it
if (!(*reg32(&__base_hmr, HMR_DMR_ENABLE))) *reg32(&__base_hmr, HMR_DMR_ENABLE) = 0x1;
// Wake up the SMP core
smp_resume();
}

chs_hmr_store_state(); // -> Save state on top of the stack
// Fence.i to flush caches
// Save sp (x2) in HMR dedicated reg
// Save ra (x1) in DMR checkpoint reg
// Write synchronization request
// wfi() until reset

// Both harts restart from here, but are locked as one
chs_hmr_load_state(); // -> Code restarts executing from here because we
// re-boot from the return address (x1)
// Re-loads the saved state
// Restores the sp

printf("DMR: %d!\n", hart_id());

// The two locked harts return
return 0;
}

0 comments on commit 1e4591e

Please sign in to comment.