qualcomm/qbox
Loading...
Searching...
No Matches
hexagon.h
1/*
2 * This file is part of libqemu-cxx
3 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
4 * Author: GreenSocs 2021
5 *
6 * SPDX-License-Identifier: BSD-3-Clause
7 */
8
9#pragma once
10
11#include <libqemu-cxx/libqemu-cxx.h>
12
13#define DSP_REV(arch) \
14 { \
15#arch, arch##_rev \
16 }
17
18namespace qemu {
19class CpuHexagon : public Cpu
20{
21public:
22 typedef enum {
23 unknown_rev = 0x0,
24 v66_rev = 0xa666,
25 v68_rev = 0x8d68,
26 v69_rev = 0x8c69,
27 v73_rev = 0x8c73,
28 v79_rev = 0x8c79,
29 v81_rev = 0x8781,
30 v85_rev = 0x8085,
31 v89_rev = 0xa289,
32 v91_rev = 0x8291,
33 } Rev_t;
34
35 static constexpr const char* const TYPE = "v67-hexagon-cpu";
36
37 using MipUpdateCallbackFn = std::function<void(uint32_t)>;
38
39 CpuHexagon() = default;
40 CpuHexagon(const CpuHexagon&) = default;
41 CpuHexagon(const Object& o): Cpu(o) {}
42 void register_reset();
43 static Rev_t parse_dsp_arch(const std::string arch_str)
44 {
45 static const std::unordered_map<std::string, Rev_t> DSP_REVS = { DSP_REV(v66), DSP_REV(v68), DSP_REV(v69),
46 DSP_REV(v73), DSP_REV(v79), DSP_REV(v81),
47 DSP_REV(v85), DSP_REV(v89), DSP_REV(v91) };
48 auto rev = DSP_REVS.find(arch_str);
49 Rev_t dsp_rev = unknown_rev;
50 if (rev != DSP_REVS.end()) {
51 dsp_rev = rev->second;
52 }
53 return dsp_rev;
54 }
55};
56} // namespace qemu
Definition libqemu-cxx.h:247