Commit 7f41f2e7 authored by Malte Heithoff's avatar Malte Heithoff
Browse files

Bug with test

parent 7bfc64ed
Pipeline #117631 failed with stages
in 9 minutes and 44 seconds
package de.rwth.pacman.common;
component Min<N1 n=2> {
port
in Q in1[n],
out Q out1;
implementation Math{
Q minVal=in1(1);
for i=1:n
minVal=min(minVal,in1(i));
end
out1=minVal;
}
}
package de.rwth.pacman.common;
component Multiplication<N1 n=2> {
port
in Q in1[n],
out Q out1;
implementation Math{
Q outVal=in1(1);
for i=2:n
outVal=outVal*in1(i);
end
out1=outVal;
}
}
package de.rwth.pacman.common;
component Not {
port
in B in1,
out B out1;
implementation Math{
if in1==0
out1=1;
else
out1=0;
end
}
}
package de.rwth.pacman.common;
component NumberToBool {
ports
in Z in1,
out B out1;
implementation Math {
if in1==0
out1 = 0;
else
out1 = 1;
end
}
}
\ No newline at end of file
package de.rwth.pacman.common;
component Or<N1 n=2> {
port
in B in1[n],
out B out1;
implementation Math{
B outVal=in1(1);
for i=1:n
outVal=or(outVal,in1(i));
end
out1=outVal;
}
}
package de.rwth.pacman.common;
component PickFromMatrix<N1 height = 1, N1 width = 1> {
ports
in Q^{height, width} mat,
in N1 indexY,
in N1 indexX,
out Q out1;
implementation Math {
out1 = mat(indexY, indexX);
}
}
\ No newline at end of file
package de.rwth.pacman.common;
component ProofOfConcept {
}
\ No newline at end of file
package de.rwth.pacman.common;
component Round {
ports
in Q in1,
out Z out1;
implementation Math{
out1 = round(in1);
}
}
\ No newline at end of file
package de.rwth.pacman.common;
/* The Saturation block imposes upper and lower bounds on a signal. When the input signal is within the range specified by the Lower limit and Upper limit parameters, the input signal passes through unchanged. When the input signal is outside these bounds, the signal is clipped to the upper or lower bound.
*/
component Saturation <Q minValue = 0, Q maxValue = 1>{
port
in Q in1,
out Q out1;
implementation Math {
out1 = min(max(in1, minValue), maxValue);
}
}
package de.rwth.pacman.common;
component Smaller {
port
in Q in1,
in Q in2,
out B out1;
implementation Math{
out1=in1<in2;
}
}
package de.rwth.pacman.common;
component SmallerEquals {
port
in Q in1,
in Q in2,
out B out1;
implementation Math{
out1=in1<=in2;
}
}
package de.rwth.pacman.common;
component SplitArray<N1 n = 1> {
ports
in Q^{1, n} in1,
out Q out1[n];
implementation Math {
for i=1:n
out1(i) = in1(1,i);
end
}
}
\ No newline at end of file
package de.rwth.pacman.common;
component SplitArrayBoolean<N1 n = 1> {
ports
in B^{1, n} in1,
out B out1[n];
implementation Math {
for i=1:n
out1(i) = in1(1,i);
end
}
}
\ No newline at end of file
package de.rwth.pacman.common;
component Sqrt {
port
in Q in1,
out Q out1;
implementation Math {
out1 = sqrt(in1);
}
}
\ No newline at end of file
package de.rwth.pacman.common;
component Sum<N1 n=2> {
port
in Q in1[n],
out Q out1;
implementation Math{
Q outVal=in1(1);
for i=2:n
outVal=outVal+in1(i);
end
out1=outVal;
}
}
package de.rwth.pacman.common;
component Switch { // if no generic is given, then default type B is taken
port
in Q in1, //if
in B cond, // condition
in Q in3, //else
out Q out1;
implementation Math{
if cond
out1=in1;
else
out1=in3;
end
}
}
package de.rwth.pacman.common;
component SwitchBoolean { // if no generic is given, then default type B is taken
port
in B in1, //if
in B cond, // condition
in B in3, //else
out Q out1;
implementation Math{
if cond
out1=in1;
else
out1=in3;
end
}
}
package de.rwth.pacman.common;
component ToArray<N1 n = 1> {
ports
in Q in1,
out Q out1[n];
implementation Math {
for i = 1:n
out1(i) = in1;
end
}
}
\ No newline at end of file
package de.rwth.pacman.common;
component TrashBoolean {
ports
in B in1;
}
\ No newline at end of file
package de.rwth.pacman.common;
component TrashNumber {
ports
in Q in1;
}
\ No newline at end of file
Supports Markdown
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