quic/qbox
Loading...
Searching...
No Matches
hexagon_globalreg.h
1/*
2 * This file is part of libqbox
3 * Copyright (c) 2025 Qualcomm Innovation Center, Inc. All Rights Reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8#ifndef _LIBQBOX_COMPONENTS_HEXAGON_GLOBALREG_INITIATOR_H
9#define _LIBQBOX_COMPONENTS_HEXAGON_GLOBALREG_INITIATOR_H
10
11#include <device.h>
12#include <qemu-instance.h>
13#include <module_factory_registery.h>
14#include <libqemu-cxx/target/hexagon.h>
15
17{
18private:
19 SCP_LOGGER();
20
21public:
22 cci::cci_param<uint64_t> p_config_table_addr;
23 cci::cci_param<uint32_t> p_qtimer_base_addr;
24 cci::cci_param<uint32_t> p_hexagon_start_addr;
25 cci::cci_param<std::string> p_dsp_arch;
26 cci::cci_param<bool> p_isdben_trusted;
27 cci::cci_param<bool> p_isdben_secure;
28
29 hexagon_globalreg(const sc_core::sc_module_name& name, sc_core::sc_object* o)
30 : hexagon_globalreg(name, *(dynamic_cast<QemuInstance*>(o)))
31 {
32 }
33 hexagon_globalreg(const sc_core::sc_module_name& n, QemuInstance& inst)
34 : QemuDevice(n, inst, "hexagon-globalreg")
35 , p_config_table_addr("config_table_addr", 0xffffffffULL, "config table address")
36 , p_qtimer_base_addr("qtimer_base_addr", 0xffffffffULL, "qtimer base address")
37 , p_hexagon_start_addr("hexagon_start_addr", 0xffffffffULL, "execution start address")
38 , p_dsp_arch("dsp_arch", "v68", "DSP arch")
39 , p_isdben_trusted("isdben_trusted", true, "isdben trusted")
40 , p_isdben_secure("isdben_secure", true, "isdben secure")
41 {
42 SCP_TRACE(())("Init");
43 }
44
45 void end_of_elaboration() override
46 {
47 QemuDevice::set_sysbus_as_parent_bus();
48 QemuDevice::end_of_elaboration();
49 }
50
51 void before_end_of_elaboration() override
52 {
53 QemuDevice::before_end_of_elaboration();
54 qemu::Device hex_greg_devs = get_qemu_dev();
55 const std::string dsp_arch = p_dsp_arch.get_value();
56 qemu::CpuHexagon::Rev_t dsp_rev = qemu::CpuHexagon::parse_dsp_arch(dsp_arch);
57 if (dsp_rev == qemu::CpuHexagon::unknown_rev) {
58 SCP_FATAL(())("Unrecognized Architecture Revision: " + dsp_arch);
59 }
60 hex_greg_devs.set_prop_int("config-table-addr", p_config_table_addr);
61 hex_greg_devs.set_prop_int("qtimer-base-addr", p_qtimer_base_addr);
62 hex_greg_devs.set_prop_int("boot-evb", p_hexagon_start_addr);
63 hex_greg_devs.set_prop_int("dsp-rev", dsp_rev);
64 hex_greg_devs.set_prop_bool("isdben-trusted", p_isdben_trusted);
65 hex_greg_devs.set_prop_bool("isdben-secure", p_isdben_secure);
66 }
67};
68
69extern "C" void module_register();
70
71#endif //_LIBQBOX_COMPONENTS_HEXAGON_GLOBALREG_INITIATOR_H
QEMU device abstraction as a SystemC module.
Definition device.h:37
This class encapsulates a libqemu-cxx qemu::LibQemu instance. It handles QEMU parameters and instance...
Definition qemu-instance.h:89
Definition target.h:160
Definition hexagon_globalreg.h:17
Definition libqemu-cxx.h:605