target-mips: Add 5KEc and 5KEf MIPS64r2 processors

Add the 5KEc and 5KEf processors from MIPS Technologies that are the
original implementation of the MIPS64r2 ISA.

Silicon for these processors has never been taped out and no soft cores
were released even. They do exist though, a CP0.PRId value has been
assigned and experimental RTLs produced at the time the MIPS64r2 ISA has
been finalized. The settings introduced here faithfully reproduce that
hardware.

As far the implementation goes these processors are the same as the 5Kc
and the 5Kf CPUs respectively, except implementing the MIPS64r2 rather
than the original MIPS64 instruction set. There must have been some
updates to the CP0 architecture as mandated by the ISA, such as the
addition of the EBase register, although I am not sure about the exact
details, no documentation has ever been produced for these processors.
The remaining parts of the microarchitecture, in particular the
pipeline, stayed unchanged. Or to put it another way, the difference
between a 5K and a 5KE CPU corresponds to one between a 4K and a 4KE
CPU, except for the 64-bit rather than 32-bit ISA.

Backports commit 36b86e0dc2be93fc538fe7e11e0fda1a198f0135 from qemu
This commit is contained in:
Maciej W. Rozycki 2018-02-11 15:39:46 -05:00 committed by Lioncash
parent 2c091e5fb8
commit 5eea73c534
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7
2 changed files with 67 additions and 1 deletions

View File

@ -19255,7 +19255,7 @@ gen_intermediate_code_internal(MIPSCPU *cpu, TranslationBlock *tb,
tcg_ctx->gen_opc_instr_start[lj] = 1;
tcg_ctx->gen_opc_icount[lj] = num_insns;
}
tcg_gen_insn_start(tcg_ctx, ctx->pc);
tcg_gen_insn_start(tcg_ctx, ctx.pc);
num_insns++;
//if (num_insns == max_insns && (tb->cflags & CF_LAST_IO)) {

View File

@ -706,6 +706,72 @@ static const mips_def_t mips_defs[] =
CPU_MIPS64R6,
MMU_TYPE_R4000,
},
{
"5KEc",
0x00018900,
MIPS_CONFIG0 | (0x1 << CP0C0_AR) | (0x2 << CP0C0_AT) |
(MMU_TYPE_R4000 << CP0C0_MT),
MIPS_CONFIG1 | (31 << CP0C1_MMU) |
(1 << CP0C1_IS) | (4 << CP0C1_IL) | (1 << CP0C1_IA) |
(1 << CP0C1_DS) | (4 << CP0C1_DL) | (1 << CP0C1_DA) |
(1 << CP0C1_PC) | (1 << CP0C1_WR) | (1 << CP0C1_EP),
MIPS_CONFIG2,
MIPS_CONFIG3,
0,
0,
0,
0,
0,
0,
0,
4,
32,
2,
0x32F8FFFF,
0,
0,
0,
0,
42,
36,
0,0, 0,0, 0,0, 0,0, 0,0, 0,0,
CPU_MIPS64R2,
MMU_TYPE_R4000,
},
{
"5KEf",
0x00018900,
MIPS_CONFIG0 | (0x1 << CP0C0_AR) | (0x2 << CP0C0_AT) |
(MMU_TYPE_R4000 << CP0C0_MT),
MIPS_CONFIG1 | (1 << CP0C1_FP) | (31 << CP0C1_MMU) |
(1 << CP0C1_IS) | (4 << CP0C1_IL) | (1 << CP0C1_IA) |
(1 << CP0C1_DS) | (4 << CP0C1_DL) | (1 << CP0C1_DA) |
(1 << CP0C1_PC) | (1 << CP0C1_WR) | (1 << CP0C1_EP),
MIPS_CONFIG2,
MIPS_CONFIG3,
0,
0,
0,
0,
0,
0,
0,
4,
32,
2,
0x36F8FFFF,
0,
0,
(1 << FCR0_F64) | (1 << FCR0_L) | (1 << FCR0_W) |
(1 << FCR0_D) | (1 << FCR0_S) |
(0x89 << FCR0_PRID) | (0x0 << FCR0_REV),
0,
42,
36,
0,0, 0,0, 0,0, 0,0, 0,0, 0,0,
CPU_MIPS64R2,
MMU_TYPE_R4000,
},
{
"Loongson-2E",
0x6302,