From 092ef7268062d0f4834f8565f1ab57381d7843bc Mon Sep 17 00:00:00 2001 From: "lasse.a.eggen" <967396+lasseaeggen@users.noreply.github.com> Date: Thu, 14 Oct 2021 13:01:51 +0200 Subject: [PATCH] Fix order of multipleInstructions when NOP padding Make sure that expanded multipleInstructions are in correct order. Example for LI that's expanded to LUI->ADDI. Old behavior: nop, nop, nop, nop, ADDI nop, nop, nop, nop, LUI New behaviour: nop, nop, nop, nop, LUI nop, nop, nop, nop, ADDI --- src/test/scala/RISCV/Parser.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/scala/RISCV/Parser.scala b/src/test/scala/RISCV/Parser.scala index d0cb41c..6cd7494 100644 --- a/src/test/scala/RISCV/Parser.scala +++ b/src/test/scala/RISCV/Parser.scala @@ -228,7 +228,7 @@ object Parser { def addOps (t: List[SourceInfo[Op]]): FoldHelper = { if(testOptions.nopPadded){ copy( - ops = t.flatMap(x => (x :: List.fill(4)(SourceInfo("inserted NOP", NOP).widen[Op]))).reverse ::: ops, + ops = t.flatMap(x => (x :: List.fill(4)(SourceInfo("inserted NOP", NOP).widen[Op])).reverse) ::: ops, addrCount = addrCount + t.size*4*5) } else {