Skip to content

Commit

Permalink
Merge pull request #156 from btsouts/issue-155
Browse files Browse the repository at this point in the history
Added missing INSTR_R4 option in 'switch (S->riscv->P.EX.format)' in …
  • Loading branch information
phillipstanleymarbell authored Jan 13, 2020
2 parents 36779f2 + 0c85a24 commit 96084a0
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 96084a0

Please sign in to comment.