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

error during the boot (risc-pk/bbl) on F1 (AWS) #5

Open
yswntht opened this issue Jul 3, 2019 · 3 comments
Open

error during the boot (risc-pk/bbl) on F1 (AWS) #5

yswntht opened this issue Jul 3, 2019 · 3 comments

Comments

@yswntht
Copy link

yswntht commented Jul 3, 2019

Hi @sizhuo-zhang,

I see the following error when I boot F1 with (riscv-pk/bbl and rom_core_1). Have you experienced this before?

ubuntu@ip-192-168-0-207:~/riscy-OOO/procs/build/RV64G_OOO.core_1.core_SMALL.cach
e_LARGE.weak.l1_cache_lru.check_deadlock/awsf1/bin$ ./ubuntu.exe --core-num $N --mem-size 2048 --ignore-user-stucks 1000000 --rom rom_core_$N --elf bbl
subprocess pid 8767 completed status=0 0
[initPortalHardwareOnce:284] fd 6 len 0
[checkSignature:176] read status from '/dev/connectal' was only 0 bytes long
checkSignature: driver 'pcieportal.c' signature mismatch 9a4e6520472c69f1577083d9f60b826c 47e961a4b445762e6b6024086a3ff16b
[checkSignature:170] failed to open /dev/portalmem No such file or directory
./ubuntu.exe: symbol lookup error: ./ubuntu.exe: undefined symbol: _Z8load_elfPKcP7memif_tPm

Any pointers would be greatly helpful.
Thanks!

@sizhuo-zhang
Copy link
Contributor

It seems that ubuntu.exe is not linked properly with libfesvr.so. load_elf and memif_t are both defined in riscv-fesvr. Try "ldd ubuntu.exe" to see if any .so is missing.

Besides, have you run build-fesvr.sh successfully on F1 before you do "make exe" on F1? Or is it because libfesvr.so is not in your $LD_LIBRARY_PATH? Sourcing setup.sh should have added it to $LD_LIBRARY_PATH.

@yswntht
Copy link
Author

yswntht commented Jul 4, 2019

I followed the steps. Here is the output on 'ldd ubuntu.exe',

ubuntu@ip-192-168-0-13:~/riscy-OOO/procs/build/RV64G_OOO.core_1.core_SMALL.cache_LARGE.weak.l1_cache_lru.check_deadlock/awsf1/bin$ ldd ubuntu.exe 
	linux-vdso.so.1 =>  (0x00007ffe95dd5000)
	libfesvr.so => /home/ubuntu/riscy-OOO/tools/RV64G/lib/libfesvr.so (0x00007fe1b4eac000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe1b4c8f000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fe1b490d000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fe1b46f7000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe1b432d000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fe1b50d6000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe1b4024000)

on flashing F1, and running 'ubuntu.exe', I see a different error now.

ubuntu@ip-192-168-0-13:~/riscy-OOO/procs/build/RV64G_OOO.core_1.core_SMALL.cache_LARGE.weak.l1_cache_lru.check_deadlock/awsf1/bin$  ./ubuntu.exe --core-num 1 --mem-size 2048 --ignore-user-stucks 1000000 --rom rom_core_1 --elf bbl
subprocess pid 28930 completed status=0 0
[initPortalHardwareOnce:284] fd 6 len 0
[checkSignature:176] read status from '/dev/connectal' was only 0 bytes long
checkSignature: driver 'pcieportal.c' signature mismatch 9a4e6520472c69f1577083d9f60b826c 47e961a4b445762e6b6024086a3ff16b
[checkSignature:170] failed to open /dev/portalmem No such file or directory
ubuntu.exe: ../../riscv-fesvr/fesvr/elfloader.cc:27: std::map<std::__cxx11::basic_string<char>, long unsigned int> load_elf(const char*, memif_t*, reg_t*): Assertion `buf != MAP_FAILED' failed.
Aborted (core dumped)

@sizhuo-zhang
Copy link
Contributor

According to the outputs, things fail when we try to call the load_elf function in riscv-fesvr to parse the boot-rom elf file rom_core_1. The specific failure point is when load_elf function tries to mmap file rom_core_1 (riscv-fesvr/fesvr/elfloader.cc line 26). You can add a line to print out errno to see the cause of the mmap failure, and then decide how to fix the issue.

Also make sure you are following the steps in readme to use all the submodules in this repo (e.g., riscv gcc, pk, etc.) to compile things. The official riscv-tools codebase evolves too fast, and some more up-to-date commits may not work with our setup.

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