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

example_gpio_intr not working on verilator #382

Open
JuanSapriza opened this issue Sep 14, 2023 · 4 comments
Open

example_gpio_intr not working on verilator #382

JuanSapriza opened this issue Sep 14, 2023 · 4 comments

Comments

@JuanSapriza
Copy link
Contributor

In #363 we added a second interrupt in the example_gpio_intr application to test that the array of handlers inside the gpio hal was working.
At that time, that was working.

Note that both interrupts are exactly the same but with different handlers.

Symptoms

  • Run make run-app-verilator PROJECT=example_gpio_intr
  • Open the terminal to see the output (e.g. screen /dev/pts/x, replacing x for the screen reported in the terminal)
  • The output should be
Write 1 to GPIO 30 and wait for interrupt...
handler 1
Write 1 to GPIO 30 and wait for interrupt...  
  • The triggering of the second interrupt is not seen. We expect to see
handler 2
Success

at the end, but this never happens.

Things I have tried

  • Changing the uint8_t gpio_intr_flag to volatile. → No change (but this change should be kept)
  • Shortening the PRINTFs at the beginning of each sequence →The second PRINTF is not printed.
  • Not triggering the second interrupt, but instead changing the flag → The program finishes successfully.
    while(gpio_intr_flag == 0) {
        CSR_CLEAR_BITS(CSR_REG_MSTATUS, 0x8);
        gpio_intr_flag = 1;  // <---------------
        CSR_SET_BITS(CSR_REG_MSTATUS, 0x8);
    }
@JuanSapriza
Copy link
Contributor Author

I can tackle this. Maybe just not right now.

@davideschiavone
Copy link
Member

could this be related to #385 ?

@JuanSapriza
Copy link
Contributor Author

I doubt, but i could take a second look then.

@davideschiavone
Copy link
Member

doesnt work on questasim either as far as I can tell

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