Commit 229e98d3 authored by nilsfreyer's avatar nilsfreyer
Browse files

bug fixes

parent 1ebf29ce
......@@ -38,6 +38,7 @@
<pathTest>./src/test/emam</pathTest>
<pathTmpOut>./target/tmp</pathTmpOut>
<generator>VS2017</generator>
<showBuildAndRunOutput>true</showBuildAndRunOutput>
</configuration>
<executions>
......
package TestA;
component Add{
ports
in Z(0:999) num1,
in Z(0:999) num2,
out Z(0:1998) sum;
implementation Math{
sum = num1 + num2;
}
}
\ No newline at end of file
......@@ -2,12 +2,12 @@ package TestA;
component Argmaxs{
ports
in Q(0:1)^{3,10} input,
out Z(0:9)^3 maxs;
in Q(0:1)^10 input1,
in Q(0:1)^10 input2,
in Q(0:1)^10 input3,
out Z(0:999) max;
implementation Math{
for i = 1:3
maxs(i) = argmax(input(i));
end
max = amax(input1) + 10*amax(input2) + 100*amax(input3);
}
}
\ No newline at end of file
......@@ -2,26 +2,30 @@ package TestA;
component Calculator {
ports
in Q(0:1)^{3, 10} in1,
in Q(0:1)^{3,10} in2,
in Q(0:1)^10 in1_1,
in Q(0:1)^10 in1_2,
in Q(0:1)^10 in1_3,
in Q(0:1)^10 in2_1,
in Q(0:1)^10 in2_2,
in Q(0:1)^10 in2_3,
out Z(0:1998) out1;
instance Argmaxs args1;
instance Argmaxs args2;
instance GetNumber gn1;
instance GetNumber gn2;
connect in1 -> args1.input;
connect in2 -> args2.input;
instance Add add;
connect args1.input -> gn1.digits;
connect args2.input -> gn2.digits;
implementation Math{
out1 = gn2.numb + gn1.numb;
}
connect in1_1 -> args1.input1;
connect in1_2 -> args1.input2;
connect in1_3 -> args1.input3;
connect in2_1 -> args2.input1;
connect in2_2 -> args2.input2;
connect in2_3 -> args2.input3;
connect args1.max -> add.num1;
connect args2.max -> add.num2;
connect add.sum -> out1;
}
package TestA;
component GetNumber{
ports
in Z(0:9)^3 digits,
out Z(0:999) numb;
implementation Math{
tmp1 = digits(1);
tmp2 = 10 * digits(2);
tmp3 = 100 * digits(3);
numb = tmp1 + tmp2 + tmp3;
}
}
\ No newline at end of file
package TestA;
stream AddStream for Add {
num1: 1;
num2: 2;
sum: 3;
}
\ No newline at end of file
package TestA;
stream ArgmaxStream for Argmaxs {
input: [1 , 1 , 1 ; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0] tick [0 , 0 , 0 ; 1 , 1 , 1; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0];
maxs: [0 , 0 , 0] tick [1 , 1 , 1];
input1: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0];
input2: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0];
input3: [0, 1, 0, 0, 0, 0, 0, 0, 0, 0];
max: 100;
}
\ No newline at end of file
package TestA;
stream CalculatorStream for Calculator {
in1: [1 , 1 , 1 ; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0] tick [0 , 0 , 0 ; 1 , 1 , 1; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0];
in2: [0 , 0 , 0 ; 0 , 0 , 0; 1 , 1 , 1; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0] tick [0 , 0 , 0 ; 1 , 1 , 1; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0; 0 , 0 , 0];
out1: 111 tick 333;
in1_1: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0];
in1_2: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0];
in1_3: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0];
in2_1: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0];
in2_2: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0];
in2_3: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0];
ou1: 0;
}
\ No newline at end of file
package TestA;
stream GetNumberStream for GetNumber {
digits: [0,1,2] tick [1,2,3];
numb: 12 tick 123;
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment