quic/qbox
Loading...
Searching...
No Matches
arm.h
1/*
2 * This file is part of libqbox
3 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
4 * Author: GreenSocs 2020
5 *
6 * SPDX-License-Identifier: BSD-3-Clause
7 */
8
9#pragma once
10
11#include "cpu.h"
12
13class QemuCpuArm : public QemuCpu
14{
15public:
16 static constexpr qemu::Target ARCH = qemu::Target::AARCH64;
17
18 QemuCpuArm(const sc_core::sc_module_name& name, QemuInstance& inst, const std::string& type_name)
19 : QemuCpu(name, inst, type_name)
20 {
21 }
22
27
28 void end_of_elaboration() override
29 {
30 QemuCpu::end_of_elaboration();
31
32 // This is needed for KVM otherwise the GIC won't reset properly when a system reset is requested
33 get_cpu_aarch64().register_reset();
34 }
35
36 void start_of_simulation() override
37 {
38 // According to qemu/hw/arm/virt.c:
39 // virt_cpu_post_init() must be called after the CPUs have been realized
40 // and the GIC has been created.
41 // I am not sure if this the right place where to call it. I wonder if a
42 // `before_start_of_simulation` stage would be a better place for this.
43 // It MUST be called before `QemuCpu::start_of_simulation()`.
44 get_cpu_aarch64().post_init();
45
46 QemuCpu::start_of_simulation();
47 }
48};
Definition arm.h:14
qemu::CpuAarch64 get_cpu_aarch64() const
Definition arm.h:26
Definition cpu.h:30
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 aarch64.h:36