Skip to content

bugfix: Fix Test VCD Output #547

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

atluft
Copy link

@atluft atluft commented May 5, 2025

Support VCD dumps for IO registers with write handlers (#486), implements changes suggested by @jamesrwaugh

Testing

Running these commands

make
cd simavr
./run_avr ../tests/atmega88_example.axf
gtkwave gtkwave_trace.vcd

Output

image

./run_avr ../tests/atmega88_example.axf 
Loaded 1722 bytes of Flash data at 0
Loaded 114 bytes of Flash data at 0x6ba
Read from eeprom 0xdeadbeef -- should be 0xdeadbeef..
Read from eeprom 0xcafef00d -- should be 0xcafef00d..

@gatk555
Copy link
Collaborator

gatk555 commented May 9, 2025

This looks good in principle, but there are a couple of issues:

If _avr_set_r() is called for a register with a direct write callback set, the following IRQ call will pass the value written by the CPU, not the actual register value. (Important example: interrupt flag registers with write-1-to-clear behaviour.) If the IRQ is called with the final value, there is then no need to modify _call_register_irqs(). Will it still work for the VCD file?

test_atmega168_ioport.tst is failing. The fault may be in the recently-modified test code.

@atluft
Copy link
Author

atluft commented May 11, 2025

@gatk555, thank you for the helpful comments.

Have a look at the changes in 1d323bf , passing all tests and VCD working.
I removed a code comment without understanding, maybe you can advise on the consequences of this approach?

       // The byte to be sent should NOT be written there,
       // the value written could never be read back.
       // avr_core_watch_write(avr, addr, v);

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

Successfully merging this pull request may close these issues.

2 participants