Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VP FPGA Compile Error:aarch64_toplevel.cpp:(.text+0x1932): undefined reference to `SimpleCPU::set_pci_bar_handle(int)' #60

Open
Hassan313 opened this issue May 15, 2020 · 7 comments

Comments

@Hassan313
Copy link

I have tried sub steps of step 3 of the below link to install the VP on the FPGA on the AWS:

http://nvdla.org/vp_fpga.html

The version of the hardware is nv_small.

When I run the make command for installing the VP on the FPGA, I am getting the below error:

[centos@ip-172-31-64-62 vp]$ make
[ 4%] Built target tlm2c
[ 4%] No force-build step for 'qbox'
[ 5%] Performing build step for 'qbox'
[ 7%] Performing install step for 'qbox'
[ 7%] Completed 'qbox'
[ 11%] Built target qbox
[ 70%] Built target greenreg
[ 71%] Built target greenscript
[ 72%] Built target log
[ 75%] Built target simplecpu
[ 80%] Built target cosim_sc_wrapper
Scanning dependencies of target nvdla
[ 80%] Building CXX object models/nvdla.build/CMakeFiles/nvdla.dir/src/nvdla_top.cpp.o
Linking CXX shared library libnvdla.so
[ 84%] Built target nvdla
[ 88%] Built target fpga_sc_wrapper
Linking CXX executable aarch64_toplevel
CMakeFiles/aarch64_toplevel.dir/src/aarch64_toplevel.cpp.o: In function sc_main': aarch64_toplevel.cpp:(.text+0x1932): undefined reference to SimpleCPU::set_pci_bar_handle(int)'
collect2: error: ld returned 1 exit status
make[2]: *** [aarch64_toplevel] Error 1
make[1]: *** [CMakeFiles/aarch64_toplevel.dir/all] Error 2
make: *** [all] Error 2

Can anyone help me with this issue?

Thank you very much,

@taog2018
Copy link

Hello, it looks like cmake do not add option "-DAWS_FPGA_PRESENT=1"
So, you can just add "-DAWS_FPGA_PRESENT=1" in vp/models/cpu.build/CMakeFiles/simplecpu.dir/flags.make
CXX_DEFINES = -Dsimplecpu_EXPORTS -DAWS_FPGA_PRESENT=1
Then, make again, it works from my local side.

@Hassan313
Copy link
Author

Hassan313 commented May 18, 2020

Dear @taog2018 ,

Thank you very much. I will try it today and let you know if it works on my side too.

Again, I really appreciate your help and support.

Best Regards
Hassan

@Hassan313
Copy link
Author

Dear @taog2018 ,

I have this issue with sudo modprobe edma-drv which is giving me the below error:

#61

Do you know why I am getting this error?

Thank you very much.

@Hassan313
Copy link
Author

Dear @taog2018 ,

I did as you said, however I am getting new error as below:

image

[ 88%] Performing install step for 'qbox'
[ 88%] Completed 'qbox'
[ 88%] Built target qbox
[ 90%] Building CXX object CMakeFiles/aarch64_toplevel.dir/src/aarch64_toplevel.cpp.o
Linking CXX executable aarch64_toplevel
[ 90%] Built target aarch64_toplevel
[ 91%] Generating ../gsp_scPYTHON_wrap.cxx
[ 91%] Built target gsp_scPYTHON_wrap
Scanning dependencies of target _gsp_sc
[ 91%] Building CXX object libs/greenlib/greenscript/lib/CMakeFiles/_gsp_sc.dir//src/gsp_sc.cpp.o
[ 92%] Building CXX object libs/greenlib/greenscript/lib/CMakeFiles/_gsp_sc.dir/
/gsp_scPYTHON_wrap.cxx.o
Linking CXX shared library _gsp_sc.so
[ 94%] Built target _gsp_sc
[ 95%] Building C object libs/tlm2c.build/lib/tests/CMakeFiles/test_socket.dir/test_socket.c.o
[ 95%] Building C object libs/tlm2c.build/lib/tests/CMakeFiles/test_socket.dir/initiator.c.o
[ 97%] Building C object libs/tlm2c.build/lib/tests/CMakeFiles/test_socket.dir/target.c.o
Linking C executable test_socket
[ 97%] Built target test_socket
[ 97%] Building CXX object models/cpu.build/test/CMakeFiles/SimpleCPU_testbench.dir/SimpleCPU_testbench.cpp.o
Linking CXX executable SimpleCPU_testbench
../libsimplecpu.so: undefined reference to fpga_pci_peek8' ../libsimplecpu.so: undefined reference to fpga_pci_poke'
../libsimplecpu.so: undefined reference to fpga_pci_peek' ../libsimplecpu.so: undefined reference to fpga_pci_poke8'
collect2: error: ld returned 1 exit status
make[2]: *** [models/cpu.build/test/SimpleCPU_testbench] Error 1
make[1]: *** [models/cpu.build/test/CMakeFiles/SimpleCPU_testbench.dir/all] Error 2

make: *** [all] Error 2

Can you kindly help me with this issue?

@taog2018
Copy link

ubuntu@ip-172-31-49-14:~/nvdla/vp/models/cpu.build$ nm libsimplecpu.so | grep fpga_pci_poke
U fpga_pci_poke
U fpga_pci_poke8
Hello, I can get this symbol in my local libsimplecpu.so.
'fpga_pci_poke', such kind of function is defined in aws-fpga sdk, please make sure you have already installed aws-fpga sdk.

@Hassan313
Copy link
Author

Dear @taog2018 ,

Thank you so much for your response.

I ran the same command as you, and here is the results:

[centos@ip-172-31-68-107 cpu.build]$ nm libsimplecpu.so | grep fpga_pci_poke
U fpga_pci_poke
U fpga_pci_poke8
[centos@ip-172-31-68-107 cpu.build]$ nm libsimplecpu.so | grep fpga_pci_peek
U fpga_pci_peek
U fpga_pci_peek8
[centos@ip-172-31-68-107 cpu.build]$

It seems that I have the symbols too. Can you kindly advise, what else might have problem?

Thank you very much.

Best Regards
Hassan

@taog2018
Copy link

Sorry for my mistake. The "U" means this symbol is defined in other library. I suspected that there were something wrong with your AWS SDK.
U fpga_pci_poke
U fpga_pci_poke8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants