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

execute work-ver/Variane_testharness $RISCV/riscv64-unknown-elf/bin/pk hello.elf #1222

Closed
1 task done
Shuangxie0708 opened this issue May 4, 2023 · 11 comments
Closed
1 task done
Assignees
Labels
Type:Item-of-task This issue is an item of a larger task.

Comments

@Shuangxie0708
Copy link

Is there an existing CVA6 bug for this?

  • I have searched the existing bug issues

Bug Description

When I running User-Space Applications..I execute work-ver/Variane_testharness $RISCV/riscv64-unknown-elf/bin/pk hello.elf There is below error that failed.
But I run work-ver/Variane_testharness rv64um-v-divuw, it is successful.
Could you help me solve this problem that why I failed when running user-space applications. Thanks!

root@samsung-Precision-5820-Tower-X-Series:/home/samsung/riscv/cva6# work-ver/Variane_testharness $RISCV/riscv64-unknown-elf/bin/pk hello.elf
This emulator compiled with JTAG Remote Bitbang client. To enable, use +jtag_rbb_enable=1.
Listening on port 38919
*** [rvf_tracer] WARNING: No valid address of 'tohost' (tohost == 0x00000000000000), termination possible only by timeout or Ctrl-C!

bbl loader

/home/samsung/riscv/install_riscv/riscv64-unknown-elf/bin/pk *** FAILED *** (tohost = 2147483647) after 2000012 cycles

CPU time used: 256327.08 ms
Wall clock time passed: 256427.19 ms
root@samsung-Precision-5820-Tower-X-Series:/home/samsung/riscv/cva6#

@Shuangxie0708 Shuangxie0708 added the Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system label May 4, 2023
@JeanRochCoulon
Copy link
Contributor

@Shuangxie0708 uses pk, @eyssartk as you are the closest person I know to the issue, I assigned it to you. Do not hesitate to forward the "hot potato" if you think somebody else could help. The objective is to find the right person to give feedback !

@retina007
Copy link

I try to booting Linux-64 CV64A6 using Verilator or Questa simulator. is this the command to use?(work-ver/Variane_testharness $RISCV/riscv64-unknown-elf/bin/pk hello.elf)

@Shuangxie0708
Copy link
Author

yes, you need use the command (work-ver/Variane_testharness $RISCV/riscv64-unknown-elf/bin/pk hello.elf)

@rishikakushwah16
Copy link

rishikakushwah16 commented Jun 12, 2023

Hey @Shuangxie0708 , I am having the same issue, is there any solution for the problem?

work-ver/Variane_testharness $RISCV/riscv64-unknown-elf/bin/pk hello.elf
This emulator compiled with JTAG Remote Bitbang client. To enable, use +jtag_rbb_enable=1.
Listening on port 40083
*** [rvf_tracer] WARNING: No valid address of 'tohost' (tohost == 0x00000000000000), termination possible only by timeout or Ctrl-C!

bbl loader
/home/rkushwah/riscv-tools/riscv64-unknown-elf/bin/pk *** FAILED *** (tohost = 2147483647) after 2000012 cycles
CPU time used: 471939.98 ms
Wall clock time passed: 471956.68 ms.

If I remove the print statement from the hello.c file, it simulates successfully. I am not sure why it is not working with the print statement. Also it simulates with spike, so I am assuming that the proxy kernel environment is set correctly.

@yulong-lan
Copy link

I am wondering where this "FAILED" message comes from, which I have also got.

Because when you pass another command -v hello.vcd in between to dump a vcd file, as below:
work-ver/Variane_testharness -v hello.vcd $RISCV/riscv64-unknown-elf/bin/pk hello.elf

It does generate a non-empty hello.vcd file, and open it you will see all the signals, which indicates that the programme has been actually running.

Beware though! Notwithstanding a very tiny "hello" programme, the size of vcd file ends up more than 15 GB, I had to terminate the simulation halfway since it was completely running up my disk space.

@allensted
Copy link

allensted commented Oct 14, 2023

try to use puts() instread of printf(), that works for me.

i guess the env or the core or maybe the pk can not support printf() well.

int main() {
//printf("Hello CVA6!\n");
puts("Hello CVA6!\n");
return 0;
}

wpf@ubuntu:~/Desktop/cva6$ riscv64-unknown-elf-gcc hello.c -o hello.elf
wpf@ubuntu:~/Desktop/cva6$ work-ver/Variane_testharness $RISCV/riscv64-unknown-elf/bin/pk hello.elf
This emulator compiled with JTAG Remote Bitbang client. To enable, use +jtag_rbb_enable=1.
Listening on port 40007
*** [rvf_tracer] WARNING: No valid address of 'tohost' (tohost == 0x00000000000000), termination possible only by timeout or Ctrl-C!

bbl loader
Hello CVA6!\n
/opt/riscv/riscv64-unknown-elf/bin/pk *** SUCCESS *** (tohost = 0) after 1469420 cycles
CPU time used: 44124.90 ms
Wall clock time passed: 44530.56 ms
wpf@ubuntu:~/Desktop/cva6$ 

@JeanRochCoulon JeanRochCoulon added Type:Item-of-task This issue is an item of a larger task. and removed Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system labels Oct 24, 2023
@JeanRochCoulon
Copy link
Contributor

Related to #1539

@tjt7a
Copy link

tjt7a commented Oct 30, 2023

I run into the same problem; I think the issue is that the simulator won't simulate beyond 2000012 cycles, even after I set the max_cycles parameter in the makefile:
max_cycles ?= 100000000

@JeanRochCoulon
Copy link
Contributor

Indeed, there is a RTL timeout implemented in rvfi_tracer.sv in SIM_FINISH variable.

@valentinThomazic
Copy link
Contributor

@0ena, did you manage to solve your issue ? If you did, could you close it ?
This may help you use the proxy kernel otherwise : #1358 (comment)
Please note that the support for the pk has been dropped and simulation should be ran using cva6.py

@JeanRochCoulon
Copy link
Contributor

As the discussion seems to be over, I will close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type:Item-of-task This issue is an item of a larger task.
Projects
None yet
Development

No branches or pull requests

9 participants