Skip to content

gdb无法显示mtvt寄存器 #12

@z-t-l

Description

@z-t-l

我使用smartl machine, 芯片为e902,发现eclipse无法显示mtvt寄存器。原因是gdb stub中的初始化晚于clic的初始化,导致gdb在build register时,调用下面的clic时返回RISCV_EXCP_ILLEGAL_INST,所以寄存器没有加载进来。

RISCVException clic(CPURISCVState env, int csrno)
{
#if 1 /
lijch debug /
/
判断CPU是否为e902的实现 */
bool is_e902_cpu = false;
CPUState *cs = env_cpu(env);
Object *obj = OBJECT(cs);
const char *cpu_type = object_get_typename(obj);

/* 检查CPU类型名称是否包含'e902' */
if (cpu_type && strstr(cpu_type, "e902")) {
    is_e902_cpu = true;
}
return (true == is_e902_cpu) ? RISCV_EXCP_NONE :
                                        RISCV_EXCP_ILLEGAL_INST;
#else
return (env->clic || env->clint_clic) ? RISCV_EXCP_NONE :
                                        RISCV_EXCP_ILLEGAL_INST;
#endif

}

另外,你们的xt_clic在e902上有没有测过,可有实例,我现在总中断开了,ip也pending了,mtvt也设了,mtvec也是0x11。发现不进mtvt中断。有没有思路。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions