-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sw: Add LLC test and bump Cheshire with LLC fix
- Loading branch information
Showing
6 changed files
with
118 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ packages: | |
dependencies: | ||
- axi_slice | ||
axi_llc: | ||
revision: 7d7fc1349d4915a657de535a491bc26fbf0d2cfa | ||
revision: 7c681312ae1eb912052de98ddaf5d19e1c2b76ff | ||
version: null | ||
source: | ||
Git: https://github.com/pulp-platform/axi_llc | ||
|
@@ -114,7 +114,7 @@ packages: | |
Git: [email protected]:AlSaqr-platform/can_bus.git | ||
dependencies: [] | ||
cheshire: | ||
revision: 0c95210cf242c384fafe3019e84b8974c3ff1e92 | ||
revision: 0071e68fdca331a81e9467ea11be222fefeae4cc | ||
version: null | ||
source: | ||
Git: https://github.com/pulp-platform/cheshire.git | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,11 +9,12 @@ package: | |
- "Alessandro Ottaviano <[email protected]>" | ||
- "Robert Balas <[email protected]>" | ||
- "Yvan Tortorella <[email protected]>" | ||
- "Cyril Koenig <[email protected]>" | ||
|
||
dependencies: | ||
register_interface: { git: https://github.com/pulp-platform/register_interface.git, version: 0.4.2 } | ||
axi: { git: https://github.com/pulp-platform/axi.git, version: 0.39.1 } | ||
cheshire: { git: https://github.com/pulp-platform/cheshire.git, rev: 0c95210cf242c384fafe3019e84b8974c3ff1e92 } # branch: aottaviano/carfield | ||
cheshire: { git: https://github.com/pulp-platform/cheshire.git, rev: 0071e68fdca331a81e9467ea11be222fefeae4cc } # branch: aottaviano/carfield | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
// Copyright 2023 ETH Zurich and University of Bologna. | ||
// Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// Cyril Koenig <[email protected]> | ||
// | ||
// Simple program to test LLC enable, disable, flush and bypass | ||
|
||
#include "regs/cheshire.h" | ||
#include "dif/clint.h" | ||
#include "params.h" | ||
#include "util.h" | ||
#include "car_memory_map.h" | ||
#include "car_util.h" | ||
|
||
volatile uint32_t dram_data_cached[64]; | ||
volatile uint32_t *dram_data_uncached; | ||
|
||
int main(void) { | ||
|
||
// Init the HW | ||
car_init_start(); | ||
|
||
// Disable CVA6 cache | ||
fence(); | ||
asm volatile ("csrwi 0x701, 0" :: ); | ||
|
||
dram_data_uncached = (uint32_t *)((void *)dram_data_cached + CAR_LLC_BYPASS_OFFSET); | ||
|
||
for ( int i = 0; i < 64 ; i++ ) { | ||
dram_data_uncached[i] = dram_data_uncached[i] + 1; | ||
if(dram_data_uncached[i] != 1) goto fail; | ||
} | ||
fence(); | ||
|
||
llc_enable(); | ||
|
||
for ( int i = 0; i < 64 ; i++ ) { | ||
dram_data_cached[i] = dram_data_cached[i] + 10; | ||
if(dram_data_cached[i] != 11) goto fail; | ||
} | ||
fence(); | ||
|
||
for ( int i = 0; i < 64 ; i++ ) { | ||
dram_data_uncached[i] = dram_data_uncached[i] + 1; | ||
if(dram_data_uncached[i] != 2) goto fail; | ||
} | ||
fence(); | ||
|
||
for ( int i = 0; i < 64 ; i++ ) { | ||
dram_data_cached[i] = dram_data_cached[i] + 10; | ||
if(dram_data_cached[i] != 21) goto fail; | ||
} | ||
fence(); | ||
|
||
fence(); | ||
llc_flush(); | ||
|
||
for ( int i = 0; i < 64 ; i++ ) { | ||
dram_data_uncached[i] = dram_data_uncached[i] + 1; | ||
if(dram_data_uncached[i] != 22) goto fail; | ||
} | ||
fence(); | ||
|
||
// The LLC has been flushed, thus will have the latest value (22) | ||
for ( int i = 0; i < 64 ; i++ ) { | ||
dram_data_cached[i] = dram_data_cached[i] + 10; | ||
if(dram_data_cached[i] != 32) goto fail; | ||
} | ||
fence(); | ||
|
||
for ( int i = 0; i < 64 ; i++ ) { | ||
dram_data_uncached[i] = dram_data_uncached[i] + 1; | ||
if(dram_data_uncached[i] != 23) goto fail; | ||
} | ||
fence(); | ||
|
||
// From now on, we are not anymore synched with the DRAM content | ||
for ( int i = 0; i < 64 ; i++ ) { | ||
dram_data_cached[i] = dram_data_cached[i] + 10; | ||
if(dram_data_cached[i] != 42) goto fail; | ||
} | ||
fence(); | ||
|
||
llc_disable(); | ||
|
||
for ( int i = 0; i < 64 ; i++ ) { | ||
if(dram_data_cached[i] != dram_data_uncached[i]) goto fail; | ||
} | ||
|
||
// Stress a bit more the LLC with the icache | ||
llc_enable(); | ||
fencei(); | ||
llc_disable(); | ||
|
||
return 0; | ||
fail: | ||
return 1; | ||
} |