diff --git a/src/main/dig/generic/barrelShifter/Test.dig b/src/main/dig/generic/barrelShifter/Test.dig
index 9e9c29f7f..cec54c916 100644
--- a/src/main/dig/generic/barrelShifter/Test.dig
+++ b/src/main/dig/generic/barrelShifter/Test.dig
@@ -371,12 +371,100 @@ end loop
+
+ Out
+
+
+ Label
+ D^64
+
+
+ Bits
+ 64
+
+
+ intFormat
+ bin
+
+
+
+
+
+ In
+
+
+ Label
+ D^64_in
+
+
+ Bits
+ 64
+
+
+ intFormat
+ bin
+
+
+ InDefault
+
+
+
+
+
+
+ In
+
+
+ Label
+ sh^64
+
+
+ Bits
+ 6
+
+
+
+
+
+ barrelShifter.dig
+
+
+ Label
+ 64 bit, left
+
+
+ generic
+ dataBits := 64;
+direction := "left";
+
+
+
+
+
+ Testcase
+
+
+ Label
+ 64 bit, left
+
+
+ Testdata
+
+ D^64_in sh^64 D^64
+loop(n,64)
+ 1 (n) (1<<n)
+end loop
+
+loop(n,64)
+ 7 (n) (7<<n)
+end loop
+
+
+
+
+
-
-
-
-
@@ -386,13 +474,37 @@ end loop
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -401,26 +513,18 @@ end loop
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/dig/generic/barrelShifter/barrelShifter.dig b/src/main/dig/generic/barrelShifter/barrelShifter.dig
index 8f26a207d..510601e58 100644
--- a/src/main/dig/generic/barrelShifter/barrelShifter.dig
+++ b/src/main/dig/generic/barrelShifter/barrelShifter.dig
@@ -30,9 +30,7 @@
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
@@ -54,9 +52,7 @@
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
@@ -74,9 +70,7 @@
generic
- if (isPresent(args)) {
- this.Bits=bitsNeededFor(args.dataBits-1);
-}
+ this.Bits=bitsNeededFor(args.dataBits-1);
diff --git a/src/main/dig/generic/barrelShifter/shift-fixed-arith-right-inc.dig b/src/main/dig/generic/barrelShifter/shift-fixed-arith-right-inc.dig
index 73e80f1b8..aa65cf86c 100644
--- a/src/main/dig/generic/barrelShifter/shift-fixed-arith-right-inc.dig
+++ b/src/main/dig/generic/barrelShifter/shift-fixed-arith-right-inc.dig
@@ -35,9 +35,7 @@
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
@@ -55,9 +53,7 @@
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
diff --git a/src/main/dig/generic/barrelShifter/shift-fixed-left-inc.dig b/src/main/dig/generic/barrelShifter/shift-fixed-left-inc.dig
index 4539fdd39..edff6777c 100644
--- a/src/main/dig/generic/barrelShifter/shift-fixed-left-inc.dig
+++ b/src/main/dig/generic/barrelShifter/shift-fixed-left-inc.dig
@@ -35,9 +35,7 @@
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
@@ -55,9 +53,7 @@
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
diff --git a/src/main/dig/generic/barrelShifter/shift-fixed-right-inc.dig b/src/main/dig/generic/barrelShifter/shift-fixed-right-inc.dig
index 7d7a63232..ed307c078 100644
--- a/src/main/dig/generic/barrelShifter/shift-fixed-right-inc.dig
+++ b/src/main/dig/generic/barrelShifter/shift-fixed-right-inc.dig
@@ -35,9 +35,7 @@
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
@@ -55,9 +53,7 @@
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
diff --git a/src/main/dig/generic/barrelShifter/shift-inc.dig b/src/main/dig/generic/barrelShifter/shift-inc.dig
index 11263a654..393b19585 100644
--- a/src/main/dig/generic/barrelShifter/shift-inc.dig
+++ b/src/main/dig/generic/barrelShifter/shift-inc.dig
@@ -42,9 +42,7 @@
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
@@ -66,9 +64,7 @@
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
@@ -86,9 +82,7 @@
generic
- if (isPresent(args)) {
- this.Bits=int(args.shiftBits);
-}
+ this.Bits=int(args.shiftBits);
diff --git a/src/test/resources/dig/test/vhdl/barrelShifter/TestLeft32.dig b/src/test/resources/dig/test/vhdl/barrelShifter/TestLeft32.dig
index c98c4c43c..e148cf7ce 100644
--- a/src/test/resources/dig/test/vhdl/barrelShifter/TestLeft32.dig
+++ b/src/test/resources/dig/test/vhdl/barrelShifter/TestLeft32.dig
@@ -67,7 +67,7 @@
generic
dataBits := 32;
-dir := "left";
+direction := "left";
diff --git a/src/test/resources/dig/test/vhdl/barrelShifter/TestLeft8.dig b/src/test/resources/dig/test/vhdl/barrelShifter/TestLeft8.dig
index 4c1045fd2..713136700 100644
--- a/src/test/resources/dig/test/vhdl/barrelShifter/TestLeft8.dig
+++ b/src/test/resources/dig/test/vhdl/barrelShifter/TestLeft8.dig
@@ -67,7 +67,7 @@
generic
dataBits := 8;
-dir := "left";
+direction := "left";
diff --git a/src/test/resources/dig/test/vhdl/barrelShifter/TestRight8.dig b/src/test/resources/dig/test/vhdl/barrelShifter/TestRight8.dig
index e28480ab9..f640d78c4 100644
--- a/src/test/resources/dig/test/vhdl/barrelShifter/TestRight8.dig
+++ b/src/test/resources/dig/test/vhdl/barrelShifter/TestRight8.dig
@@ -67,7 +67,7 @@
generic
dataBits := 8;
-dir := "right";
+direction := "right";
diff --git a/src/test/resources/dig/test/vhdl/barrelShifter/TestRightArith16.dig b/src/test/resources/dig/test/vhdl/barrelShifter/TestRightArith16.dig
index 8fff8154f..76d5c78ac 100644
--- a/src/test/resources/dig/test/vhdl/barrelShifter/TestRightArith16.dig
+++ b/src/test/resources/dig/test/vhdl/barrelShifter/TestRightArith16.dig
@@ -67,7 +67,7 @@
generic
dataBits := 16;
-dir := "arith";
+direction := "arith";
diff --git a/src/test/resources/dig/test/vhdl/barrelShifter/barrelShifter.dig b/src/test/resources/dig/test/vhdl/barrelShifter/barrelShifter.dig
index 5f7d26772..510601e58 100644
--- a/src/test/resources/dig/test/vhdl/barrelShifter/barrelShifter.dig
+++ b/src/test/resources/dig/test/vhdl/barrelShifter/barrelShifter.dig
@@ -30,9 +30,7 @@
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
@@ -54,9 +52,7 @@
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
@@ -74,9 +70,7 @@
generic
- if (isPresent(args)) {
- this.Bits=bitsNeededFor(args.dataBits-1);
-}
+ this.Bits=bitsNeededFor(args.dataBits-1);
@@ -86,13 +80,28 @@
generic
- dataBits:=16;
-shiftBits:=int(4);
-dir:="left";
-if (isPresent(args)) {
- dir=args.dir;
- dataBits=args.dataBits;
- shiftBits=bitsNeededFor(args.dataBits-1);
+ if (isPresent(args)) {
+
+ if (args.direction="right") {
+ export circuit:="shift-fixed-right-inc.dig";
+ } else {
+ if (args.direction="arith") {
+ export circuit:="shift-fixed-arith-right-inc.dig";
+ } else {
+ if (args.direction="left") {
+ export circuit:="shift-fixed-left-inc.dig";
+ } else {
+ panic("only \"left\", \"right\" or \"arith\" is allowed as direction, not \""+args.dir+"\"!");
+ }
+ }
+ }
+
+ export shiftBits:=bitsNeededFor(args.dataBits-1);
+} else {
+ // used if circuit is started as the main circuit
+ export circuit:="shift-fixed-left-inc.dig";
+ export dataBits:=16;
+ export shiftBits:=int(4);
}
diff --git a/src/test/resources/dig/test/vhdl/barrelShifter/shift-fixed-arith-right-inc.dig b/src/test/resources/dig/test/vhdl/barrelShifter/shift-fixed-arith-right-inc.dig
index 73e80f1b8..aa65cf86c 100644
--- a/src/test/resources/dig/test/vhdl/barrelShifter/shift-fixed-arith-right-inc.dig
+++ b/src/test/resources/dig/test/vhdl/barrelShifter/shift-fixed-arith-right-inc.dig
@@ -35,9 +35,7 @@
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
@@ -55,9 +53,7 @@
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
diff --git a/src/test/resources/dig/test/vhdl/barrelShifter/shift-fixed-left-inc.dig b/src/test/resources/dig/test/vhdl/barrelShifter/shift-fixed-left-inc.dig
index 4539fdd39..edff6777c 100644
--- a/src/test/resources/dig/test/vhdl/barrelShifter/shift-fixed-left-inc.dig
+++ b/src/test/resources/dig/test/vhdl/barrelShifter/shift-fixed-left-inc.dig
@@ -35,9 +35,7 @@
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
@@ -55,9 +53,7 @@
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
diff --git a/src/test/resources/dig/test/vhdl/barrelShifter/shift-fixed-right-inc.dig b/src/test/resources/dig/test/vhdl/barrelShifter/shift-fixed-right-inc.dig
index 7d7a63232..ed307c078 100644
--- a/src/test/resources/dig/test/vhdl/barrelShifter/shift-fixed-right-inc.dig
+++ b/src/test/resources/dig/test/vhdl/barrelShifter/shift-fixed-right-inc.dig
@@ -35,9 +35,7 @@
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
@@ -55,9 +53,7 @@
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
diff --git a/src/test/resources/dig/test/vhdl/barrelShifter/shift-inc.dig b/src/test/resources/dig/test/vhdl/barrelShifter/shift-inc.dig
index 6b5d45a4f..393b19585 100644
--- a/src/test/resources/dig/test/vhdl/barrelShifter/shift-inc.dig
+++ b/src/test/resources/dig/test/vhdl/barrelShifter/shift-inc.dig
@@ -13,22 +13,13 @@
generic
- dataBits:=16;
-shift:=8;
-if (isPresent(args)) {
- dataBits = args.dataBits;
- shift = 1<<(args.shiftBits-1);
- if (args.dir="right") {
- setCircuit("shift-fixed-right-inc.dig");
- } else {
- if (args.dir="arith") {
- setCircuit("shift-fixed-arith-right-inc.dig");
- } else {
- if (args.dir!="left") {
- panic("only \"left\", \"right\" or \"arith\" is allowed as direction, not \""+args.dir+"\"!");
- }
- }
- }
+ if (isPresent(args)) {
+ export shift := 1<<(args.shiftBits-1);
+ setCircuit(args.circuit);
+} else {
+ // used if circuit is started as the main circuit
+ export dataBits:=16;
+ export shift:=8;
}
@@ -51,9 +42,7 @@ if (isPresent(args)) {
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
@@ -75,9 +64,7 @@ if (isPresent(args)) {
generic
- if (isPresent(args)) {
- this.Bits=int(args.dataBits);
-}
+ this.Bits=int(args.dataBits);
@@ -95,9 +82,7 @@ if (isPresent(args)) {
generic
- if (isPresent(args)) {
- this.Bits=int(args.shiftBits);
-}
+ this.Bits=int(args.shiftBits);
@@ -107,31 +92,18 @@ if (isPresent(args)) {
generic
- dataBits:=16;
-shiftBits:=3;
-dir:="left";
-if (isPresent(args)) {
- dataBits = args.dataBits;
- shiftBits = args.shiftBits-1;
- dir=args.dir;
- if (args.shiftBits=2) {
-
- export shift := 1;
- if (args.dir="right") {
- setCircuit("shift-fixed-right-inc.dig");
+ if (isPresent(args)) {
+ if (args.shiftBits=2) {
+ export shift := 1;
+ setCircuit(args.circuit);
} else {
- if (args.dir="arith") {
- setCircuit("shift-fixed-arith-right-inc.dig");
- } else {
- if (args.dir!="left") {
- panic("only \"left\", \"right\" or \"arith\" is allowed as direction, not \""+args.dir+"\"!");
- }
- setCircuit("shift-fixed-left-inc.dig");
- }
+ export shiftBits := args.shiftBits-1;
}
-
-
- }
+} else {
+ // used if circuit is started as the main circuit
+ export dataBits:=16;
+ export shiftBits:=3;
+ export circuit:="shift-fixed-left-inc.dig";
}