|
From: | panic |
Subject: | [Simulavr-devel] [Bug] VCD trace of PINx register not updated when driven from other port/device |
Date: | Sun, 11 Jun 2017 17:00:00 +0000 |
Hi *, The PINx register is not correctly updated in the (VCD) traceer, when a pin is driven *by a different portpin or even another device* (multicore simulation). It is correctly traced, when the source is a portpin of the same HWPort. In the attached example, PB1 is periodically toggled and it is connected to PD2, thus the PIND register should change. Compile and run the example like so: > avr-gcc -g -mmcu=atmega644 -std=gnu11 -O2 -Wall -Wextra -Werror -o main.elf > main.c > ./run_simulator.py The attached patch fixes this issue by adding an additional member to Pin, that points to the IOReg<HWPort> owning that Pin. This allows to report-back/update the tracer when the pin changes. (much like pinOfPort does) Patch, minimum working example, and screenshots attached. Cheers, panic
0001-fix-trace-of-PINx-register-when-driven-from-another-.patch
Description: Text Data
fail.png
Description: PNG image
fail.vcd
Description: application/vnd.gtkwave-vcd
main.c
Description: Text Data
pass.png
Description: PNG image
pass.vcd
Description: application/vnd.gtkwave-vcd
run_simulavr.py
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |