Jump to content

dpk

Members
  • Posts

    2
  • Joined

  • Last visited

dpk's Achievements

Newbie

Newbie (1/4)

0

Reputation

  1. Hello, I am writing a simple program with templates and function pointer in Vitis 2019.2 to run on the Microblaze. I instantiated a Microblaze and BRAM in the hardware. The program is compiling without any errors but result is not stored on the memory. I ran the same program on my local desktop and it is running as expected. Can someone please help me on how to debug this issue? I have posted the program below. Thanks for your time and consideration. #include "xil_io.h" #include "xparameters.h" #include <functional> int AddFunc(int a, int b, int c){ int ans = a + b + c; return ans; } template <typename T, typename... ArgTypes> class FuncExec{ const std::function<T(ArgTypes...)> f_; T value; public: FuncExec(const std::function<T(ArgTypes...)> f) : f_(f) {} void FuncInput(ArgTypes... args){ value = f_(args...); Xil_Out64(XPAR_AXI_BRAM_CTRL_1_S_AXI_BASEADDR + sizeof(double) + sizeof(double), value); } }; int main() { FuncExec <int, int, int, int> func1(AddFunc); func1.FuncInput(3, 3, 3); return 0; }
×
×
  • Create New...