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

How to bring printf support in simulation environment ? #2426

Open
1 task done
isaar-ahmad opened this issue Jul 31, 2024 · 4 comments
Open
1 task done

How to bring printf support in simulation environment ? #2426

isaar-ahmad opened this issue Jul 31, 2024 · 4 comments
Labels
notCV32A65X It is not an CV32A65X issue Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system

Comments

@isaar-ahmad
Copy link
Contributor

isaar-ahmad commented Jul 31, 2024

Is there an existing CVA6 bug for this?

  • I have searched the existing bug issues

Bug Description

Hi,
I found that there has been recent discussion (May 2024 - July 2024) regarding printf statement support in CVA6 simulations (see #2103 #2184 #2220 ). It seems that CVA6 simulation environment, in its current form (e.g. with Verilator), doesn't support this.

For example, Dhrystone C files [1] have debug_print statements in them. To a newcomer, this would give an initial impression that these prints should be visible somewhere in the logfiles or console output. However, a closer inspection reveals that the implementation of debug_print() function is empty. In development stage, it is common in bare-metal environments to disable print statements, so that other parts of the test can pass through.

That being said, printf statements are useful in debugging, especially when the target under debug is a CPU itself. (I only speak for myself, based on my experience with RTL verification of ARM CPUs, and some RISC-V CPUs as well).

Please advise on this :

  1. Is there any ongoing (or planned) development for C print statements ? If yes, where can we find details regarding this ?
  2. What parts of the testbench and RTL files will need major changes, if such an update is planned?

Thanks,
Isaar

Code reference :
[1] Dhrystone source files (dhrystone_main.c and dhrystone.c) : Fetched by install-riscv-tests.sh

@isaar-ahmad isaar-ahmad added the Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system label Jul 31, 2024
@JeanRochCoulon
Copy link
Contributor

Indeed this feature is highly requested. But as you know it is not supported. The solution would be to support pk which provides the print feature. If someone is ready to work on it, we can provide recommendations.

@JeanRochCoulon JeanRochCoulon added the notCV32A65X It is not an CV32A65X issue label Jul 31, 2024
@isaar-ahmad
Copy link
Contributor Author

isaar-ahmad commented Aug 7, 2024

Yes, please share a plan (or an outline) for the required functionality. That would be helpful in assessing whether someone (e.g. myself) can take up the task.

@JeanRochCoulon
Copy link
Contributor

@valentinThomazic the floor is yours to explain how to proceed ;-)

@valentinThomazic
Copy link
Contributor

Hey sorry for the delay, the riscv proxy kernel used to be supported in this repo (I can give some directions if needed).
For it to be supported again, we would need it to be cleanly integrated to the flow.
It should be possible to activate it with an env variable or a parameter for instance.
The difficulty would come from the complexity of the cva6.py script, the verif/sim/Makefile and ./Makefile, we really don't want to add more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notCV32A65X It is not an CV32A65X issue Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system
Projects
None yet
Development

No branches or pull requests

3 participants