From 3c1e48ce1a20c4f95d13917562b4d6a3f3c99b20 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Thu, 5 Dec 2024 22:48:36 +0100 Subject: [PATCH] [dif] Add empty soc_proxy DIF Thid DIF exports not function beyond the autogenerated one. It is necessary to have it so that the isr_tstutils and the autogenerated plic tests can compile on Darjeeling. Signed-off-by: Amaury Pouly --- sw/device/lib/dif/BUILD | 21 +++++++++++++++++++++ sw/device/lib/dif/defs.bzl | 3 +-- sw/device/lib/dif/dif_soc_proxy.h | 22 ++++++++++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 sw/device/lib/dif/dif_soc_proxy.h diff --git a/sw/device/lib/dif/BUILD b/sw/device/lib/dif/BUILD index 4b3037fde21e0..44cfe5e1ee40e 100644 --- a/sw/device/lib/dif/BUILD +++ b/sw/device/lib/dif/BUILD @@ -1344,6 +1344,27 @@ cc_test( ], ) +cc_library( + name = "soc_proxy", + srcs = [ + "//sw/device/lib/dif/autogen:soc_proxy_hdr", + "//sw/device/lib/dif/autogen:soc_proxy_src", + ], + hdrs = [ + "dif_soc_proxy.h", + ], + deps = [ + ":base", + "//hw/top:dt_soc_proxy", + "//hw/top:soc_proxy_c_regs", + "//sw/device/lib/base:bitfield", + "//sw/device/lib/base:macros", + "//sw/device/lib/base:memory", + "//sw/device/lib/base:mmio", + "//sw/device/lib/base:multibits", + ], +) + cc_library( name = "all_difs", deps = flatten([ diff --git a/sw/device/lib/dif/defs.bzl b/sw/device/lib/dif/defs.bzl index e8c2095da2ecb..f53c85277f57b 100644 --- a/sw/device/lib/dif/defs.bzl +++ b/sw/device/lib/dif/defs.bzl @@ -5,5 +5,4 @@ # This is the list of all IPs that do not have a DIF. IPS_WITHOUT_DIF = [ "ast", - "soc_proxy", -] \ No newline at end of file +] diff --git a/sw/device/lib/dif/dif_soc_proxy.h b/sw/device/lib/dif/dif_soc_proxy.h new file mode 100644 index 0000000000000..a44dd55f1c1d9 --- /dev/null +++ b/sw/device/lib/dif/dif_soc_proxy.h @@ -0,0 +1,22 @@ +// Copyright lowRISC contributors (OpenTitan project). +// Licensed under the Apache License, Version 2.0, see LICENSE for details. +// SPDX-License-Identifier: Apache-2.0 + +#ifndef OPENTITAN_SW_DEVICE_LIB_DIF_DIF_SOC_PROXY_H_ +#define OPENTITAN_SW_DEVICE_LIB_DIF_DIF_SOC_PROXY_H_ + +/** + * This is an empty DIF. It's sole purpose is to export the autogenerated DIF + * functions so that the PLIC tests and ISR testutils can use it. + */ + +#include +#include + +#include "sw/device/lib/base/macros.h" +#include "sw/device/lib/base/mmio.h" +#include "sw/device/lib/dif/dif_base.h" + +#include "sw/device/lib/dif/autogen/dif_soc_proxy_autogen.h" + +#endif // OPENTITAN_SW_DEVICE_LIB_DIF_DIF_SOC_PROXY_H_