qualcomm/qbox
Loading...
Searching...
No Matches
apss_hm_apss_shared_apss_intu.h
1/*
2 * Quic Module apss_hm_apss_shared_apss_intu
3 *
4 * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All Rights Reserved.
5 *
6 * SPDX-License-Identifier: BSD-3-Clause
7 */
8
9#ifndef apss_hm_apss_shared_apss_intu_H
10#define apss_hm_apss_shared_apss_intu_H
11
12#include <systemc>
13#include <cci_configuration>
14#include <cciutils.h>
15#include <scp/report.h>
16#include <tlm>
17#include <ports/biflow-socket.h>
18#include <cciutils.h>
19#include <module_factory_registery.h>
20#include "apss_hm_apss_shared_apss_intu_gen.h"
21#include "sysc/kernel/sc_time.h"
22#include "tlm_core/tlm_2/tlm_generic_payload/tlm_gp.h"
23#include <ports/initiator-signal-socket.h>
24#include <ports/target-signal-socket.h>
25
26namespace quic {
27class apss_hm_apss_shared_apss_intu : public sc_core::sc_module, public apss_hm_apss_shared_apss_intu_gen
28{
29 SCP_LOGGER();
30 cci::cci_broker_handle m_broker; // Should be a private broker for efficiency, but requires fixes to cci utils to
31 // prevent use of cci_get_broker()
33 bool loaded_ok;
35
36public:
37 tlm_utils::multi_passthrough_target_socket<apss_hm_apss_shared_apss_intu> target_socket;
39 /*
40 * Below "cdsp_ipc" needs to align with the lua file's expectation:
41 * cdsp_ipc_# = {bind = "&hex_plugin.target_signal_socket_0"},
42 */
43#define NUM_INTS 3
44 sc_core::sc_vector<InitiatorSignalSocket<bool>> cdsp_ipc;
45
46 apss_hm_apss_shared_apss_intu(sc_core::sc_module_name name);
47
48 void start_of_simulation()
49 {
50 /* NB writes should not happen before simulation starts,
51 * Write any special register initial values here (e.g. over-right what is in the
52 * configuration files)
53 */
54 }
55 void before_end_of_elaboration()
56 {
57 SCP_TRACE(())("Before End of Elaboration, registering callbacks");
58
59 IPC_INTERRUPT.post_write([&](TXN()) {
60 SCP_DEBUG(())
61 ("IPC_INTERRUPT was written to with value: {:x}) ", IPC_INTERRUPT[0]);
62 uint32_t irq = CDSP_IPC;
63 if (irq & 0x1) {
64 cdsp_ipc[0]->write(1);
65 }
66 if (irq & 0x2) {
67 cdsp_ipc[1]->write(1);
68 }
69 if (irq & 0x4) {
70 cdsp_ipc[2]->write(1);
71 }
72 });
73 }
74};
75} // namespace quic
76
77extern "C" void module_register();
78
79#endif // apss_hm_apss_shared_apss_intu_H
Definition target-signal-socket.h:163
Definition reg_model_maker.h:457
Definition reg_model_maker.h:35
Definition aoss_pmic_arb_pmic_arb_core.h:27