mirror of
https://github.com/saymrwulf/pulp-runtime.git
synced 2026-05-14 20:48:09 +00:00
Merge pull request #49 from pulp-platform/lg/hci-ecc
Add APIs for ECC-extended HCI and fix header files inclusion.
This commit is contained in:
commit
3ba9a34966
5 changed files with 94 additions and 2 deletions
|
|
@ -100,6 +100,7 @@
|
|||
#define ARCHI_MCHAN_EXT_OFFSET 0x00001800
|
||||
#define ARCHI_HMR_OFFSET 0x00002000
|
||||
#define ARCHI_TCDM_SCRUBBER_OFFSET 0x00002400
|
||||
#define ARCHI_HWPE_HCI_ECC_OFFSET 0x00002800
|
||||
|
||||
#define ARCHI_CLUSTER_PERIPHERALS_ADDR ( ARCHI_CLUSTER_ADDR + ARCHI_CLUSTER_PERIPHERALS_OFFSET )
|
||||
#define ARCHI_CLUSTER_PERIPHERALS_GLOBAL_ADDR(cid) ( ARCHI_CLUSTER_GLOBAL_ADDR(cid) + ARCHI_CLUSTER_PERIPHERALS_OFFSET )
|
||||
|
|
@ -111,6 +112,7 @@
|
|||
#define ARCHI_MCHAN_EXT_ADDR ( ARCHI_CLUSTER_PERIPHERALS_ADDR + ARCHI_MCHAN_EXT_OFFSET )
|
||||
#define ARCHI_HMR_ADDR ( ARCHI_CLUSTER_PERIPHERALS_ADDR + ARCHI_HMR_OFFSET )
|
||||
#define ARCHI_TCDM_SCRUBBER_ADDR ( ARCHI_CLUSTER_PERIPHERALS_ADDR + ARCHI_TCDM_SCRUBBER_OFFSET )
|
||||
#define ARCHI_HWPE_HCI_ECC_ADDR ( ARCHI_CLUSTER_PERIPHERALS_ADDR + ARCHI_HWPE_HCI_ECC_OFFSET )
|
||||
|
||||
#define ARCHI_CLUSTER_CTRL_GLOBAL_ADDR(cid) ( ARCHI_CLUSTER_PERIPHERALS_GLOBAL_ADDR(cid) + ARCHI_CLUSTER_CTRL_OFFSET )
|
||||
#define ARCHI_ICACHE_CTRL_GLOBAL_ADDR(cid) ( ARCHI_CLUSTER_PERIPHERALS_GLOBAL_ADDR(cid) + ARCHI_ICACHE_CTRL_OFFSET )
|
||||
|
|
@ -120,6 +122,7 @@
|
|||
#define ARCHI_IDMA_EXT_GLOBAL_ADDR(cid) ( ARCHI_CLUSTER_PERIPHERALS_GLOBAL_ADDR(cid) + ARCHI_IDMA_EXT_OFFSET )
|
||||
#define ARCHI_HMR_GLOBAL_ADDR(cid) ( ARCHI_CLUSTER_PERIPHERALS_GLOBAL_ADDR(cid) + ARCHI_HMR_OFFSET )
|
||||
#define ARCHI_TCDM_SCRUBBER_GLOBAL_ADDR(cid) ( ARCHI_CLUSTER_PERIPHERALS_GLOBAL_ADDR(cid) + ARCHI_TCDM_SCRUBBER_OFFSET )
|
||||
#define ARCHI_HWPE_HCI_ECC_GLOBAL_ADDR(cid) ( ARCHI_CLUSTER_PERIPHERALS_GLOBAL_ADDR(cid) + ARCHI_HWPE_HCI_ECC_OFFSET )
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@
|
|||
#include "archi/itc/itc_v1.h"
|
||||
#include "archi/riscv/priv_1_10.h"
|
||||
|
||||
#include "archi/chips/carfield-cluster/memory_map.h"
|
||||
#include "archi/chips/carfield-cluster/apb_soc.h"
|
||||
#include "archi/chips/astral-cluster/memory_map.h"
|
||||
#include "archi/chips/astral-cluster/apb_soc.h"
|
||||
#include "archi/stdout/stdout_v3.h"
|
||||
#include "archi/dma/mchan_v7.h"
|
||||
|
||||
|
|
@ -47,5 +47,6 @@
|
|||
#include "archi/udma/udma_v3.h"
|
||||
#include "archi/hmr/hmr_v1.h"
|
||||
#include "archi/tcdm_scrubber/tcdm_scrubber.h"
|
||||
#include "archi/hwpe_hci_ecc/hwpe_hci_ecc.h"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
44
include/archi/hwpe_hci_ecc/hwpe_hci_ecc.h
Normal file
44
include/archi/hwpe_hci_ecc/hwpe_hci_ecc.h
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (C) 2024 ETH Zurich and University of Bologna
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Generated register defines for HCI_ECC_manager
|
||||
|
||||
#ifndef _HCI_ECC_MANAGER_REG_DEFS_
|
||||
#define _HCI_ECC_MANAGER_REG_DEFS_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
// Register width
|
||||
#define HCI_ECC_MANAGER_PARAM_REG_WIDTH 32
|
||||
|
||||
// Correctable errors on data caught by ecc on interconnect
|
||||
#define HCI_ECC_MANAGER_DATA_CORRECTABLE_ERRORS_REG_OFFSET 0x0
|
||||
|
||||
// Uncorrectable errors on data caught by ecc on interconnect
|
||||
#define HCI_ECC_MANAGER_DATA_UNCORRECTABLE_ERRORS_REG_OFFSET 0x4
|
||||
|
||||
// Correctable errors caught on metadata by ecc on interconnect
|
||||
#define HCI_ECC_MANAGER_METADATA_CORRECTABLE_ERRORS_REG_OFFSET 0x8
|
||||
|
||||
// Uncorrectable errors caught on metadata by ecc on interconnect
|
||||
#define HCI_ECC_MANAGER_METADATA_UNCORRECTABLE_ERRORS_REG_OFFSET 0xc
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
#endif // _HCI_ECC_MANAGER_REG_DEFS_
|
||||
// End generated register defines for HCI_ECC_manager
|
||||
|
|
@ -43,5 +43,6 @@
|
|||
#include "hal/udma/uart/udma_uart_v1.h"
|
||||
#include "hal/hmr/hmr_v1.h"
|
||||
#include "hal/tcdm_scrubber/tcdm_scrubber.h"
|
||||
#include "hal/hwpe_hci_ecc/hwpe_hci_ecc.h"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
43
include/hal/hwpe_hci_ecc/hwpe_hci_ecc.h
Normal file
43
include/hal/hwpe_hci_ecc/hwpe_hci_ecc.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (C) 2024 ETH Zurich and University of Bologna
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __HAL_HWPE_HCI_ECC_H__
|
||||
#define __HAL_HWPE_HCI_ECC_H__
|
||||
|
||||
#include "archi/hwpe_hci_ecc/hwpe_hci_ecc.h"
|
||||
#include "archi/pulp.h"
|
||||
|
||||
// Get the number of correctable errors on data detected by the ECC decoders on the interconnect
|
||||
static inline unsigned int hwpe_hci_ecc_get_data_correctable_count(unsigned int cid) {
|
||||
return pulp_read32(ARCHI_HWPE_HCI_ECC_GLOBAL_ADDR(cid) + HCI_ECC_MANAGER_DATA_CORRECTABLE_ERRORS_REG_OFFSET);
|
||||
}
|
||||
|
||||
// Get the number of uncorrectable errors on data detected by the ECC decoders on the interconnect
|
||||
static inline unsigned int hwpe_hci_ecc_get_data_uncorrectable_count(unsigned int cid) {
|
||||
return pulp_read32(ARCHI_HWPE_HCI_ECC_GLOBAL_ADDR(cid) + HCI_ECC_MANAGER_DATA_UNCORRECTABLE_ERRORS_REG_OFFSET);
|
||||
}
|
||||
|
||||
// Get the number of correctable errors on metadata detected by the ECC decoders on the interconnect
|
||||
static inline unsigned int hwpe_hci_ecc_get_meta_correctable_count(unsigned int cid) {
|
||||
return pulp_read32(ARCHI_HWPE_HCI_ECC_GLOBAL_ADDR(cid) + HCI_ECC_MANAGER_METADATA_CORRECTABLE_ERRORS_REG_OFFSET);
|
||||
}
|
||||
|
||||
// Get the number of uncorrectable errors on metadata detected by the ECC decoders on the interconnect
|
||||
static inline unsigned int hwpe_hci_ecc_get_meta_uncorrectable_count(unsigned int cid) {
|
||||
return pulp_read32(ARCHI_HWPE_HCI_ECC_GLOBAL_ADDR(cid) + HCI_ECC_MANAGER_METADATA_UNCORRECTABLE_ERRORS_REG_OFFSET);
|
||||
}
|
||||
|
||||
#endif // __HAL_HWPE_HCI_ECC_H__
|
||||
Loading…
Reference in a new issue