simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Simulavr-devel] [Bug] VCD trace of PINx register not updated when drive


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

Attachment: 0001-fix-trace-of-PINx-register-when-driven-from-another-.patch
Description: Text Data

Attachment: fail.png
Description: PNG image

Attachment: fail.vcd
Description: application/vnd.gtkwave-vcd

Attachment: main.c
Description: Text Data

Attachment: pass.png
Description: PNG image

Attachment: pass.vcd
Description: application/vnd.gtkwave-vcd

Attachment: run_simulavr.py
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]