From 375ec3e8653279a066a8fd644d13f9028049c18f Mon Sep 17 00:00:00 2001 From: Daniel Kirschten Date: Wed, 11 Sep 2019 18:46:50 +0200 Subject: [PATCH] Changed BitVectorSplittingAtomicHighLevelStateHandler's part order --- .../net/mograsim/logic/model/am2900/components/dff4.json | 6 +++--- .../mograsim/logic/model/am2900/components/dff4_invwe.json | 6 +++--- .../net/mograsim/logic/model/am2900/components/dlatch4.json | 6 +++--- .../BitVectorSplittingAtomicHighLevelStateHandler.java | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff4.json b/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff4.json index fe18cf1d..99b9a912 100644 --- a/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff4.json +++ b/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff4.json @@ -680,10 +680,10 @@ "id": "bitVectorSplitting", "params": { "vectorPartTargets": [ - "q1", - "q2", + "q4", "q3", - "q4" + "q2", + "q1" ], "vectorPartLengthes": [ 1, diff --git a/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff4_invwe.json b/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff4_invwe.json index 7615dc7c..9a188411 100644 --- a/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff4_invwe.json +++ b/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dff4_invwe.json @@ -689,10 +689,10 @@ "id": "bitVectorSplitting", "params": { "vectorPartTargets": [ - "q1", - "q2", + "q4", "q3", - "q4" + "q2", + "q1" ], "vectorPartLengthes": [ 1, diff --git a/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dlatch4.json b/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dlatch4.json index c85ca3cd..87f53700 100644 --- a/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dlatch4.json +++ b/net.mograsim.logic.model.am2900/components/net/mograsim/logic/model/am2900/components/dlatch4.json @@ -358,10 +358,10 @@ "id": "bitVectorSplitting", "params": { "vectorPartTargets": [ - "q1", - "q2", + "q4", "q3", - "q4" + "q2", + "q1" ], "vectorPartLengthes": [ 1, diff --git a/net.mograsim.logic.model/src/net/mograsim/logic/model/snippets/highlevelstatehandlers/standard/atomic/BitVectorSplittingAtomicHighLevelStateHandler.java b/net.mograsim.logic.model/src/net/mograsim/logic/model/snippets/highlevelstatehandlers/standard/atomic/BitVectorSplittingAtomicHighLevelStateHandler.java index 4b9e2d62..443f8475 100644 --- a/net.mograsim.logic.model/src/net/mograsim/logic/model/snippets/highlevelstatehandlers/standard/atomic/BitVectorSplittingAtomicHighLevelStateHandler.java +++ b/net.mograsim.logic.model/src/net/mograsim/logic/model/snippets/highlevelstatehandlers/standard/atomic/BitVectorSplittingAtomicHighLevelStateHandler.java @@ -92,7 +92,7 @@ public class BitVectorSplittingAtomicHighLevelStateHandler implements AtomicHigh if (vectorPart.length() != vectorPartLengthes.get(partIndex)) throw new IllegalArgumentException( "Incorrect vector part length: " + vectorPart.length() + "; expected " + vectorPartLengthes.get(partIndex)); - result = vectorPart.concat(result); + result = result.concat(vectorPart); } return result; } @@ -103,7 +103,7 @@ public class BitVectorSplittingAtomicHighLevelStateHandler implements AtomicHigh BitVector newStateCasted = (BitVector) newState; if (newStateCasted.length() != length) throw new IllegalArgumentException("Incorrect vector length: " + newStateCasted.length() + "; expected " + length); - for (int partIndex = vectorPartTargets.size() - 1, bitIndex = 0; partIndex >= 0; partIndex--) + for (int partIndex = 0, bitIndex = 0; partIndex < vectorPartTargets.size(); partIndex++) { int vectorPartLength = vectorPartLengthes.get(partIndex); BitVector vectorPart = newStateCasted.subVector(bitIndex, bitIndex + vectorPartLength); -- 2.17.1