StreamFMAKernel.maxj 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package fpga;
  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. {
  8. private static final DFEType type = dfeInt(32);
  9. protected StreamFMAKernel(KernelParameters parameters)
  10. {
  11. super(parameters);
  12. DFEVar inAT1 = io.input("inAT1", type);
  13. DFEVar inBT1 = io.input("inBT1", type);
  14. DFEVar oDataT1;
  15. DFEVar inAT2 = io.input("inAT2", type);
  16. DFEVar inBT2 = io.input("inBT2", type);
  17. DFEVar oDataT2;
  18. DFEVar inAT3 = io.input("inAT3", type);
  19. DFEVar inBT3 = io.input("inBT3", type);
  20. DFEVar oDataT3;
  21. oDataT1 = inAT1+inBT1;
  22. oDataT2 = inAT2*inBT2;
  23. oDataT3 = inAT3+inBT3;
  24. io.output("oDataT1", oDataT1, type);
  25. io.output("oDataT2", oDataT2, type);
  26. io.output("oDataT3", oDataT3, type);
  27. }
  28. }