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

the result of the example case (komodo_test.rv) is wrong #1

Open
onezibo opened this issue Mar 3, 2021 · 1 comment
Open

the result of the example case (komodo_test.rv) is wrong #1

onezibo opened this issue Mar 3, 2021 · 1 comment
Assignees

Comments

@onezibo
Copy link

onezibo commented Mar 3, 2021

Hello,I generate the updated bbl by running the run_linux.sh script in docker ldelshad/phmon:

  • update the /home/PHMon/code/run_linux.sh script:
    cp $VARANUS/build/komodo_test.rv $VARANUS/linux_root/root/home
  • update the /home/PHMon/code/riscv-linux/fs/exec.c(1810):
    if (!current->monitor_init & ((strcmp(current->comm, "komodo_test.rv") == 0) || (strcmp(current->comm, "cat") == 0) || (strcmp(current->comm, "hello.rv") == 0) || (strcmp(current->comm, "vuln1") == 0) || (strcmp(current->comm, "vuln3") == 0) || (strcmp(current->comm, "ndisasm") == 0 || strcmp(current->comm, "mcf.rv") == 0) || strcmp(current->comm, "debug.rv") == 0)) {

Then I run the run_linux.sh script and copy the generated bbl to zedboard:
$ cat rocketchip_wrapper.bit.bin > /dev/xdevcfg
$ ./fesvr-zynq bbl
After riscv-linux starts,I run the komodo_test.rv:
# ./komodo_test.rv

but the result is wrong:

[ 28.610667] komodo_test.rv: t0 = 28.606615000
komodo_sp @ 0x0x727c0
test
[INFO] sp @0x727c0 = 0x0
[INFO] sp @0x727c8 = 0x0
[INFO] sp @0x727d0 = 0x0
[INFO] sp @0x727d8 = 0x0
[INFO] sp @0x727e0 = 0x0
[INFO] sp @0x727e8 = 0x0
[INFO] sp @0x727f0 = 0x0
[INFO] sp @0x727f8 = 0x0
[INFO] sp @0x72800 = 0x0
[INFO] sp @0x72808 = 0x0
[ 28.618511] komodo_test.rv: t1 = 28.614461000

I make a new c program for configuring PHMon, but the result is wrong also,
I think the PHMon is not configured correctly, or running.
How can I fix this problem?

@ldelshad
Copy link
Member

ldelshad commented Mar 7, 2021

Hi @onezibo,

Thanks for brining this problem to my attention. It seems like there is a mismatch between the version of the patches in the docker and the bitstream for the FPGA. I added a new file to the docker image under "/home/PHMon/evaluation/PHMon" folder named "rocket_docker.bit.bin". Can you please try this bitstream for configuring your FPGA and let me know if that solves the problem?

In general, you can configure PHMon in two different ways. 1) You can use a program like komodo_test.c that allocates a memory for PHMon and enables/disables PHMon as part of the same program (PHMon only partially monitors that program). 2) You can allow the OS to allocate the memory and enable the monitoring (the modifications you did in exec.c). So, for running a simple program like komodo_test.c there's no need to modify the kernel.

Hope this helps.

@ldelshad ldelshad self-assigned this Mar 8, 2021
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