Skip to content

Commit

Permalink
Added missing INSTR_R4 option in 'switch (S->riscv->P.EX.format)' in …
Browse files Browse the repository at this point in the history
…riscvstep function.
  • Loading branch information
btsouts committed Jan 13, 2020
1 parent 36779f2 commit 0c85a24
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions sim/pipeline-riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,16 +537,6 @@ riscvstep(Engine *E, State *S, int drain_pipeline)

switch (S->riscv->P.EX.format)
{
case INSTR_N:
{
(*(S->riscv->P.EX.fptr))(E, S); /* riscv_nop?? */
S->dyncnt++;

S->riscv->instruction_distribution[S->riscv->P.EX.op]++;

break;
}

case INSTR_R:
{
uint32_t tmp = (uint32_t) S->riscv->P.EX.instr;
Expand Down Expand Up @@ -649,6 +639,25 @@ riscvstep(Engine *E, State *S, int drain_pipeline)
break;
}

case INSTR_R4:
{
instr_r4 *tmp;

tmp = (instr_r4 *)&S->riscv->P.EX.instr;
(*(S->riscv->P.EX.fptr))(E, S, tmp->rs1, tmp->rs2, tmp->rs3, tmp->rm, tmp->rd);
break;
}

case INSTR_N:
{
(*(S->riscv->P.EX.fptr))(E, S); /* riscv_nop?? */
S->dyncnt++;

S->riscv->instruction_distribution[S->riscv->P.EX.op]++;

break;
}

default:
{
sfatal(E, S, "Unknown Instruction Type !!");
Expand Down

0 comments on commit 0c85a24

Please sign in to comment.