Commit 1ebf29ce authored by nilsfreyer's avatar nilsfreyer
Browse files

Added and modified all streams/components

parent 811801cc
package TestA;
component Argmaxs{
ports
in Q(0:1)^{3,10} input,
out Z(0:9)^3 maxs;
implementation Math{
for i = 1:3
maxs(i) = argmax(input(i));
end
}
}
\ No newline at end of file
......@@ -2,21 +2,26 @@ package TestA;
component Calculator {
ports
in Q(0:1)^10 input1[3],
in Q(0:1)^10 input2[3],
in Q(0:1)^{3, 10} in1,
in Q(0:1)^{3,10} in2,
out Z(0:1998) out1;
instance Argmaxs args1;
instance Argmaxs args2;
instance GetNumber gn1;
instance GetNumber gn2;
instance Indices args1;
instance Indices args2;
connect input1 -> args1.preds;
connect input2 -> args2.preds;
connect args1.inds -> numbers1;
connect args2.inds -> numbers2;
connect in1 -> args1.input;
connect in2 -> args2.input;
connect args1.input -> gn1.digits;
connect args2.input -> gn2.digits;
implementation Math{
tmp1 = numbers2(1) * 100 + numbers2(1)*100 + numbers1(2) * 10 + numbers2(2) * 10 + numbers1(3) + numbers2(3);
out1 = tmp1;
out1 = gn2.numb + gn1.numb;
}
}
}
package TestA;
stream CalulatorStreamtest for Calculator {
input1:[[0 ; 1 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0] ; [0 ; 1 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0] ; [0 ; 1 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0]];
input2:[[0 ; 1 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0] ; [0 ; 1 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0] ; [0 ; 1 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0]];
out1: 444;
}
\ No newline at end of file
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;
component Indices {
ports
in Q(0:1)^10 preds[3],
out Z(0:9) inds[6];
implementation Math {
for i = 1:6
inds(i) = argmax(preds(i));
end
}
}
\ 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];
}
\ 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;
}
\ 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