StreamFMAKernel.maxj 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package perfmodels;
  2. import com.maxeler.maxcompiler.v2.kernelcompiler.Kernel;
  3. import com.maxeler.maxcompiler.v2.kernelcompiler.KernelParameters;
  4. import com.maxeler.maxcompiler.v2.kernelcompiler.types.base.DFEType;
  5. import com.maxeler.maxcompiler.v2.kernelcompiler.types.base.DFEVar;
  6. class StreamFMAKernel extends Kernel {
  7. private static final DFEType type = dfeInt(32);
  8. protected StreamFMAKernel(KernelParameters parameters) {
  9. super(parameters);
  10. DFEVar inAT1 = io.input("inAT1", type);
  11. DFEVar inBT1 = io.input("inBT1", type);
  12. DFEVar oDataT1;
  13. DFEVar inAT2 = io.input("inAT2", type);
  14. DFEVar inBT2 = io.input("inBT2", type);
  15. DFEVar oDataT2;
  16. DFEVar inAT3 = io.input("inAT3", type);
  17. DFEVar inBT3 = io.input("inBT3", type);
  18. DFEVar oDataT3;
  19. oDataT1 = inAT1+inBT1;
  20. oDataT2 = inAT2*inBT2;
  21. oDataT3 = inAT3+inBT3;
  22. io.output("oDataT1", oDataT1, type);
  23. io.output("oDataT2", oDataT2, type);
  24. io.output("oDataT3", oDataT3, type);
  25. }
  26. }