2021-02-08 08:45:54 +03:00
|
|
|
/*
|
2023-04-28 01:40:49 +03:00
|
|
|
* Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
|
2021-02-08 08:45:54 +03:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "qemu/osdep.h"
|
|
|
|
#include "qemu/qemu-print.h"
|
|
|
|
#include "cpu.h"
|
|
|
|
#include "internal.h"
|
|
|
|
#include "exec/exec-all.h"
|
|
|
|
#include "qapi/error.h"
|
|
|
|
#include "hw/qdev-properties.h"
|
2021-04-09 04:07:38 +03:00
|
|
|
#include "fpu/softfloat-helpers.h"
|
2023-02-27 16:51:59 +03:00
|
|
|
#include "tcg/tcg.h"
|
2023-05-04 18:37:35 +03:00
|
|
|
#include "exec/gdbstub.h"
|
2021-02-08 08:45:54 +03:00
|
|
|
|
2023-04-28 01:40:49 +03:00
|
|
|
static void hexagon_v67_cpu_init(Object *obj) { }
|
|
|
|
static void hexagon_v68_cpu_init(Object *obj) { }
|
|
|
|
static void hexagon_v69_cpu_init(Object *obj) { }
|
|
|
|
static void hexagon_v71_cpu_init(Object *obj) { }
|
|
|
|
static void hexagon_v73_cpu_init(Object *obj) { }
|
2021-02-08 08:45:54 +03:00
|
|
|
|
|
|
|
static ObjectClass *hexagon_cpu_class_by_name(const char *cpu_model)
|
|
|
|
{
|
|
|
|
ObjectClass *oc;
|
|
|
|
char *typename;
|
|
|
|
char **cpuname;
|
|
|
|
|
|
|
|
cpuname = g_strsplit(cpu_model, ",", 1);
|
|
|
|
typename = g_strdup_printf(HEXAGON_CPU_TYPE_NAME("%s"), cpuname[0]);
|
|
|
|
oc = object_class_by_name(typename);
|
|
|
|
g_strfreev(cpuname);
|
|
|
|
g_free(typename);
|
2023-09-08 11:09:23 +03:00
|
|
|
|
2021-02-08 08:45:54 +03:00
|
|
|
return oc;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Property hexagon_lldb_compat_property =
|
|
|
|
DEFINE_PROP_BOOL("lldb-compat", HexagonCPU, lldb_compat, false);
|
|
|
|
static Property hexagon_lldb_stack_adjust_property =
|
|
|
|
DEFINE_PROP_UNSIGNED("lldb-stack-adjust", HexagonCPU, lldb_stack_adjust,
|
|
|
|
0, qdev_prop_uint32, target_ulong);
|
Hexagon (target/hexagon) Short-circuit packet register writes
In certain cases, we can avoid the overhead of writing to hex_new_value
and write directly to hex_gpr. We add need_commit field to DisasContext
indicating if the end-of-packet commit is needed. If it is not needed,
get_result_gpr() and get_result_gpr_pair() can return hex_gpr.
We pass the ctx->need_commit to helpers when needed.
Finally, we can early-exit from gen_reg_writes during packet commit.
There are a few instructions whose semantics write to the result before
reading all the inputs. Therefore, the idef-parser generated code is
incompatible with short-circuit. We tell idef-parser to skip them.
For debugging purposes, we add a cpu property to turn off short-circuit.
When the short-circuit property is false, we skip the analysis and force
the end-of-packet commit.
Here's a simple example of the TCG generated for
0x004000b4: 0x7800c020 { R0 = #0x1 }
BEFORE:
---- 004000b4
movi_i32 new_r0,$0x1
mov_i32 r0,new_r0
AFTER:
---- 004000b4
movi_i32 r0,$0x1
This patch reintroduces a use of check_for_attrib, so we remove the
G_GNUC_UNUSED added earlier in this series.
Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Brian Cain <bcain@quicinc.com>
Message-Id: <20230427230012.3800327-12-tsimpson@quicinc.com>
2023-04-28 02:00:02 +03:00
|
|
|
static Property hexagon_short_circuit_property =
|
|
|
|
DEFINE_PROP_BOOL("short-circuit", HexagonCPU, short_circuit, true);
|
2021-02-08 08:45:54 +03:00
|
|
|
|
|
|
|
const char * const hexagon_regnames[TOTAL_PER_THREAD_REGS] = {
|
|
|
|
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
|
|
|
|
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
|
|
|
|
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
|
|
|
|
"r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
|
|
|
|
"sa0", "lc0", "sa1", "lc1", "p3_0", "c5", "m0", "m1",
|
|
|
|
"usr", "pc", "ugp", "gp", "cs0", "cs1", "c14", "c15",
|
2021-02-26 14:30:12 +03:00
|
|
|
"c16", "c17", "c18", "c19", "pkt_cnt", "insn_cnt", "hvx_cnt", "c23",
|
2021-02-08 08:45:54 +03:00
|
|
|
"c24", "c25", "c26", "c27", "c28", "c29", "c30", "c31",
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* One of the main debugging techniques is to use "-d cpu" and compare against
|
|
|
|
* LLDB output when single stepping. However, the target and qemu put the
|
|
|
|
* stacks at different locations. This is used to compensate so the diff is
|
|
|
|
* cleaner.
|
|
|
|
*/
|
2021-04-09 04:07:31 +03:00
|
|
|
static target_ulong adjust_stack_ptrs(CPUHexagonState *env, target_ulong addr)
|
2021-02-08 08:45:54 +03:00
|
|
|
{
|
2021-04-09 04:07:32 +03:00
|
|
|
HexagonCPU *cpu = env_archcpu(env);
|
2021-02-08 08:45:54 +03:00
|
|
|
target_ulong stack_adjust = cpu->lldb_stack_adjust;
|
|
|
|
target_ulong stack_start = env->stack_start;
|
|
|
|
target_ulong stack_size = 0x10000;
|
|
|
|
|
|
|
|
if (stack_adjust == 0) {
|
|
|
|
return addr;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (stack_start + 0x1000 >= addr && addr >= (stack_start - stack_size)) {
|
|
|
|
return addr - stack_adjust;
|
|
|
|
}
|
|
|
|
return addr;
|
|
|
|
}
|
|
|
|
|
2022-12-29 12:20:06 +03:00
|
|
|
/* HEX_REG_P3_0_ALIASED (aka C4) is an alias for the predicate registers */
|
2021-04-09 04:07:31 +03:00
|
|
|
static target_ulong read_p3_0(CPUHexagonState *env)
|
2021-02-08 08:45:54 +03:00
|
|
|
{
|
|
|
|
int32_t control_reg = 0;
|
|
|
|
int i;
|
|
|
|
for (i = NUM_PREGS - 1; i >= 0; i--) {
|
|
|
|
control_reg <<= 8;
|
|
|
|
control_reg |= env->pred[i] & 0xff;
|
|
|
|
}
|
|
|
|
return control_reg;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void print_reg(FILE *f, CPUHexagonState *env, int regnum)
|
|
|
|
{
|
|
|
|
target_ulong value;
|
|
|
|
|
2022-12-29 12:20:06 +03:00
|
|
|
if (regnum == HEX_REG_P3_0_ALIASED) {
|
2021-02-08 08:45:54 +03:00
|
|
|
value = read_p3_0(env);
|
|
|
|
} else {
|
|
|
|
value = regnum < 32 ? adjust_stack_ptrs(env, env->gpr[regnum])
|
|
|
|
: env->gpr[regnum];
|
|
|
|
}
|
|
|
|
|
|
|
|
qemu_fprintf(f, " %s = 0x" TARGET_FMT_lx "\n",
|
|
|
|
hexagon_regnames[regnum], value);
|
|
|
|
}
|
|
|
|
|
2021-03-17 19:48:57 +03:00
|
|
|
static void print_vreg(FILE *f, CPUHexagonState *env, int regnum,
|
|
|
|
bool skip_if_zero)
|
|
|
|
{
|
|
|
|
if (skip_if_zero) {
|
|
|
|
bool nonzero_found = false;
|
|
|
|
for (int i = 0; i < MAX_VEC_SIZE_BYTES; i++) {
|
|
|
|
if (env->VRegs[regnum].ub[i] != 0) {
|
|
|
|
nonzero_found = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!nonzero_found) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
qemu_fprintf(f, " v%d = ( ", regnum);
|
|
|
|
qemu_fprintf(f, "0x%02x", env->VRegs[regnum].ub[MAX_VEC_SIZE_BYTES - 1]);
|
|
|
|
for (int i = MAX_VEC_SIZE_BYTES - 2; i >= 0; i--) {
|
|
|
|
qemu_fprintf(f, ", 0x%02x", env->VRegs[regnum].ub[i]);
|
|
|
|
}
|
|
|
|
qemu_fprintf(f, " )\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
void hexagon_debug_vreg(CPUHexagonState *env, int regnum)
|
|
|
|
{
|
|
|
|
print_vreg(stdout, env, regnum, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void print_qreg(FILE *f, CPUHexagonState *env, int regnum,
|
|
|
|
bool skip_if_zero)
|
|
|
|
{
|
|
|
|
if (skip_if_zero) {
|
|
|
|
bool nonzero_found = false;
|
|
|
|
for (int i = 0; i < MAX_VEC_SIZE_BYTES / 8; i++) {
|
|
|
|
if (env->QRegs[regnum].ub[i] != 0) {
|
|
|
|
nonzero_found = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!nonzero_found) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
qemu_fprintf(f, " q%d = ( ", regnum);
|
|
|
|
qemu_fprintf(f, "0x%02x",
|
|
|
|
env->QRegs[regnum].ub[MAX_VEC_SIZE_BYTES / 8 - 1]);
|
|
|
|
for (int i = MAX_VEC_SIZE_BYTES / 8 - 2; i >= 0; i--) {
|
|
|
|
qemu_fprintf(f, ", 0x%02x", env->QRegs[regnum].ub[i]);
|
|
|
|
}
|
|
|
|
qemu_fprintf(f, " )\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
void hexagon_debug_qreg(CPUHexagonState *env, int regnum)
|
|
|
|
{
|
|
|
|
print_qreg(stdout, env, regnum, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void hexagon_dump(CPUHexagonState *env, FILE *f, int flags)
|
2021-02-08 08:45:54 +03:00
|
|
|
{
|
2021-04-09 04:07:32 +03:00
|
|
|
HexagonCPU *cpu = env_archcpu(env);
|
2021-02-08 08:45:54 +03:00
|
|
|
|
|
|
|
if (cpu->lldb_compat) {
|
|
|
|
/*
|
|
|
|
* When comparing with LLDB, it doesn't step through single-cycle
|
|
|
|
* hardware loops the same way. So, we just skip them here
|
|
|
|
*/
|
|
|
|
if (env->gpr[HEX_REG_PC] == env->last_pc_dumped) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
env->last_pc_dumped = env->gpr[HEX_REG_PC];
|
|
|
|
}
|
|
|
|
|
|
|
|
qemu_fprintf(f, "General Purpose Registers = {\n");
|
|
|
|
for (int i = 0; i < 32; i++) {
|
|
|
|
print_reg(f, env, i);
|
|
|
|
}
|
|
|
|
print_reg(f, env, HEX_REG_SA0);
|
|
|
|
print_reg(f, env, HEX_REG_LC0);
|
|
|
|
print_reg(f, env, HEX_REG_SA1);
|
|
|
|
print_reg(f, env, HEX_REG_LC1);
|
|
|
|
print_reg(f, env, HEX_REG_M0);
|
|
|
|
print_reg(f, env, HEX_REG_M1);
|
|
|
|
print_reg(f, env, HEX_REG_USR);
|
2022-12-29 12:20:06 +03:00
|
|
|
print_reg(f, env, HEX_REG_P3_0_ALIASED);
|
2021-02-08 08:45:54 +03:00
|
|
|
print_reg(f, env, HEX_REG_GP);
|
|
|
|
print_reg(f, env, HEX_REG_UGP);
|
|
|
|
print_reg(f, env, HEX_REG_PC);
|
|
|
|
#ifdef CONFIG_USER_ONLY
|
|
|
|
/*
|
|
|
|
* Not modelled in user mode, print junk to minimize the diff's
|
|
|
|
* with LLDB output
|
|
|
|
*/
|
|
|
|
qemu_fprintf(f, " cause = 0x000000db\n");
|
|
|
|
qemu_fprintf(f, " badva = 0x00000000\n");
|
|
|
|
qemu_fprintf(f, " cs0 = 0x00000000\n");
|
|
|
|
qemu_fprintf(f, " cs1 = 0x00000000\n");
|
|
|
|
#else
|
|
|
|
print_reg(f, env, HEX_REG_CAUSE);
|
|
|
|
print_reg(f, env, HEX_REG_BADVA);
|
|
|
|
print_reg(f, env, HEX_REG_CS0);
|
|
|
|
print_reg(f, env, HEX_REG_CS1);
|
|
|
|
#endif
|
|
|
|
qemu_fprintf(f, "}\n");
|
2021-03-17 19:48:57 +03:00
|
|
|
|
|
|
|
if (flags & CPU_DUMP_FPU) {
|
|
|
|
qemu_fprintf(f, "Vector Registers = {\n");
|
|
|
|
for (int i = 0; i < NUM_VREGS; i++) {
|
|
|
|
print_vreg(f, env, i, true);
|
|
|
|
}
|
|
|
|
for (int i = 0; i < NUM_QREGS; i++) {
|
|
|
|
print_qreg(f, env, i, true);
|
|
|
|
}
|
|
|
|
qemu_fprintf(f, "}\n");
|
|
|
|
}
|
2021-02-08 08:45:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void hexagon_dump_state(CPUState *cs, FILE *f, int flags)
|
|
|
|
{
|
2024-01-29 19:44:53 +03:00
|
|
|
hexagon_dump(cpu_env(cs), f, flags);
|
2021-02-08 08:45:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void hexagon_debug(CPUHexagonState *env)
|
|
|
|
{
|
2021-03-17 19:48:57 +03:00
|
|
|
hexagon_dump(env, stdout, CPU_DUMP_FPU);
|
2021-02-08 08:45:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void hexagon_cpu_set_pc(CPUState *cs, vaddr value)
|
|
|
|
{
|
2024-01-29 19:44:53 +03:00
|
|
|
cpu_env(cs)->gpr[HEX_REG_PC] = value;
|
2021-02-08 08:45:54 +03:00
|
|
|
}
|
|
|
|
|
2022-09-30 20:31:21 +03:00
|
|
|
static vaddr hexagon_cpu_get_pc(CPUState *cs)
|
|
|
|
{
|
2024-01-29 19:44:53 +03:00
|
|
|
return cpu_env(cs)->gpr[HEX_REG_PC];
|
2022-09-30 20:31:21 +03:00
|
|
|
}
|
|
|
|
|
2021-02-08 08:45:54 +03:00
|
|
|
static void hexagon_cpu_synchronize_from_tb(CPUState *cs,
|
|
|
|
const TranslationBlock *tb)
|
|
|
|
{
|
2024-01-10 20:09:56 +03:00
|
|
|
tcg_debug_assert(!tcg_cflags_has(cs, CF_PCREL));
|
2024-01-29 19:44:53 +03:00
|
|
|
cpu_env(cs)->gpr[HEX_REG_PC] = tb->pc;
|
2021-02-08 08:45:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool hexagon_cpu_has_work(CPUState *cs)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2022-10-24 13:10:03 +03:00
|
|
|
static void hexagon_restore_state_to_opc(CPUState *cs,
|
|
|
|
const TranslationBlock *tb,
|
|
|
|
const uint64_t *data)
|
2021-02-08 08:45:54 +03:00
|
|
|
{
|
2024-01-29 19:44:53 +03:00
|
|
|
cpu_env(cs)->gpr[HEX_REG_PC] = data[0];
|
2021-02-08 08:45:54 +03:00
|
|
|
}
|
|
|
|
|
2024-04-12 19:08:07 +03:00
|
|
|
static void hexagon_cpu_reset_hold(Object *obj, ResetType type)
|
2021-02-08 08:45:54 +03:00
|
|
|
{
|
2022-11-24 14:50:08 +03:00
|
|
|
CPUState *cs = CPU(obj);
|
2024-01-29 19:44:48 +03:00
|
|
|
HexagonCPUClass *mcc = HEXAGON_CPU_GET_CLASS(obj);
|
2024-01-29 19:44:53 +03:00
|
|
|
CPUHexagonState *env = cpu_env(cs);
|
2021-02-08 08:45:54 +03:00
|
|
|
|
2022-11-24 14:50:08 +03:00
|
|
|
if (mcc->parent_phases.hold) {
|
2024-04-12 19:08:07 +03:00
|
|
|
mcc->parent_phases.hold(obj, type);
|
2022-11-24 14:50:08 +03:00
|
|
|
}
|
2021-04-09 04:07:38 +03:00
|
|
|
|
|
|
|
set_default_nan_mode(1, &env->fp_status);
|
|
|
|
set_float_detect_tininess(float_tininess_before_rounding, &env->fp_status);
|
2021-02-08 08:45:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void hexagon_cpu_disas_set_info(CPUState *s, disassemble_info *info)
|
|
|
|
{
|
|
|
|
info->print_insn = print_insn_hexagon;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void hexagon_cpu_realize(DeviceState *dev, Error **errp)
|
|
|
|
{
|
|
|
|
CPUState *cs = CPU(dev);
|
|
|
|
HexagonCPUClass *mcc = HEXAGON_CPU_GET_CLASS(dev);
|
|
|
|
Error *local_err = NULL;
|
|
|
|
|
|
|
|
cpu_exec_realizefn(cs, &local_err);
|
|
|
|
if (local_err != NULL) {
|
|
|
|
error_propagate(errp, local_err);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-05-04 18:37:35 +03:00
|
|
|
gdb_register_coprocessor(cs, hexagon_hvx_gdb_read_register,
|
|
|
|
hexagon_hvx_gdb_write_register,
|
2024-02-27 17:43:14 +03:00
|
|
|
gdb_find_static_feature("hexagon-hvx.xml"), 0);
|
2023-05-04 18:37:35 +03:00
|
|
|
|
2021-02-08 08:45:54 +03:00
|
|
|
qemu_init_vcpu(cs);
|
|
|
|
cpu_reset(cs);
|
|
|
|
|
|
|
|
mcc->parent_realize(dev, errp);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void hexagon_cpu_init(Object *obj)
|
|
|
|
{
|
|
|
|
qdev_property_add_static(DEVICE(obj), &hexagon_lldb_compat_property);
|
|
|
|
qdev_property_add_static(DEVICE(obj), &hexagon_lldb_stack_adjust_property);
|
Hexagon (target/hexagon) Short-circuit packet register writes
In certain cases, we can avoid the overhead of writing to hex_new_value
and write directly to hex_gpr. We add need_commit field to DisasContext
indicating if the end-of-packet commit is needed. If it is not needed,
get_result_gpr() and get_result_gpr_pair() can return hex_gpr.
We pass the ctx->need_commit to helpers when needed.
Finally, we can early-exit from gen_reg_writes during packet commit.
There are a few instructions whose semantics write to the result before
reading all the inputs. Therefore, the idef-parser generated code is
incompatible with short-circuit. We tell idef-parser to skip them.
For debugging purposes, we add a cpu property to turn off short-circuit.
When the short-circuit property is false, we skip the analysis and force
the end-of-packet commit.
Here's a simple example of the TCG generated for
0x004000b4: 0x7800c020 { R0 = #0x1 }
BEFORE:
---- 004000b4
movi_i32 new_r0,$0x1
mov_i32 r0,new_r0
AFTER:
---- 004000b4
movi_i32 r0,$0x1
This patch reintroduces a use of check_for_attrib, so we remove the
G_GNUC_UNUSED added earlier in this series.
Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Brian Cain <bcain@quicinc.com>
Message-Id: <20230427230012.3800327-12-tsimpson@quicinc.com>
2023-04-28 02:00:02 +03:00
|
|
|
qdev_property_add_static(DEVICE(obj), &hexagon_short_circuit_property);
|
2021-02-08 08:45:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#include "hw/core/tcg-cpu-ops.h"
|
|
|
|
|
2024-01-28 05:46:44 +03:00
|
|
|
static const TCGCPUOps hexagon_tcg_ops = {
|
2021-02-08 08:45:54 +03:00
|
|
|
.initialize = hexagon_translate_init,
|
|
|
|
.synchronize_from_tb = hexagon_cpu_synchronize_from_tb,
|
2022-10-24 13:10:03 +03:00
|
|
|
.restore_state_to_opc = hexagon_restore_state_to_opc,
|
2021-02-08 08:45:54 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
static void hexagon_cpu_class_init(ObjectClass *c, void *data)
|
|
|
|
{
|
|
|
|
HexagonCPUClass *mcc = HEXAGON_CPU_CLASS(c);
|
|
|
|
CPUClass *cc = CPU_CLASS(c);
|
|
|
|
DeviceClass *dc = DEVICE_CLASS(c);
|
2022-11-24 14:50:08 +03:00
|
|
|
ResettableClass *rc = RESETTABLE_CLASS(c);
|
2021-02-08 08:45:54 +03:00
|
|
|
|
|
|
|
device_class_set_parent_realize(dc, hexagon_cpu_realize,
|
|
|
|
&mcc->parent_realize);
|
|
|
|
|
2022-11-24 14:50:08 +03:00
|
|
|
resettable_class_set_parent_phases(rc, NULL, hexagon_cpu_reset_hold, NULL,
|
|
|
|
&mcc->parent_phases);
|
2021-02-08 08:45:54 +03:00
|
|
|
|
|
|
|
cc->class_by_name = hexagon_cpu_class_by_name;
|
|
|
|
cc->has_work = hexagon_cpu_has_work;
|
|
|
|
cc->dump_state = hexagon_dump_state;
|
|
|
|
cc->set_pc = hexagon_cpu_set_pc;
|
2022-09-30 20:31:21 +03:00
|
|
|
cc->get_pc = hexagon_cpu_get_pc;
|
2021-02-08 08:45:54 +03:00
|
|
|
cc->gdb_read_register = hexagon_gdb_read_register;
|
|
|
|
cc->gdb_write_register = hexagon_gdb_write_register;
|
|
|
|
cc->gdb_stop_before_watchpoint = true;
|
2023-05-04 18:37:33 +03:00
|
|
|
cc->gdb_core_xml_file = "hexagon-core.xml";
|
2021-02-08 08:45:54 +03:00
|
|
|
cc->disas_set_info = hexagon_cpu_disas_set_info;
|
|
|
|
cc->tcg_ops = &hexagon_tcg_ops;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define DEFINE_CPU(type_name, initfn) \
|
|
|
|
{ \
|
|
|
|
.name = type_name, \
|
|
|
|
.parent = TYPE_HEXAGON_CPU, \
|
|
|
|
.instance_init = initfn \
|
|
|
|
}
|
|
|
|
|
|
|
|
static const TypeInfo hexagon_cpu_type_infos[] = {
|
|
|
|
{
|
|
|
|
.name = TYPE_HEXAGON_CPU,
|
|
|
|
.parent = TYPE_CPU,
|
|
|
|
.instance_size = sizeof(HexagonCPU),
|
2023-09-14 01:06:21 +03:00
|
|
|
.instance_align = __alignof(HexagonCPU),
|
2021-02-08 08:45:54 +03:00
|
|
|
.instance_init = hexagon_cpu_init,
|
|
|
|
.abstract = true,
|
|
|
|
.class_size = sizeof(HexagonCPUClass),
|
|
|
|
.class_init = hexagon_cpu_class_init,
|
|
|
|
},
|
|
|
|
DEFINE_CPU(TYPE_HEXAGON_CPU_V67, hexagon_v67_cpu_init),
|
2023-04-28 01:40:49 +03:00
|
|
|
DEFINE_CPU(TYPE_HEXAGON_CPU_V68, hexagon_v68_cpu_init),
|
|
|
|
DEFINE_CPU(TYPE_HEXAGON_CPU_V69, hexagon_v69_cpu_init),
|
|
|
|
DEFINE_CPU(TYPE_HEXAGON_CPU_V71, hexagon_v71_cpu_init),
|
|
|
|
DEFINE_CPU(TYPE_HEXAGON_CPU_V73, hexagon_v73_cpu_init),
|
2021-02-08 08:45:54 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
DEFINE_TYPES(hexagon_cpu_type_infos)
|