bugSimulavr: an AVR simulator - Bugs: bug #51222, VCD trace of PINx register not...

 
 

bug #51222: VCD trace of PINx register not updated

Submitted by:  None
Submitted on:  Sun 11 Jun 2017 04:29:16 PM UTC  
 
Category: SimulationSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Originator Email: -unavailable-Open/Closed: Open
Component Version: simulavrxx

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 11 Jun 2017 04:29:16 PM UTC, original submission:

The PINx (e.g. PINB, PIND, ...) register holds the input state of the port pins. This is independent of the DDRx settings.
The register itself is simulated/updated, but not so the VCD trace.

See the attached example that toggles PB1. Compile with

> avr-gcc -g -mmcu=atmega644 -std=gnu11 -O2 -Wall -Wextra -Werror -o pinx-not-traced.elf pinx-not-traced.c


and run simulavr like so

> simulavr --device atmega644 --file pinx-not-traced.elf --terminate exit -c vcd:tracein.txt:pinx-not-traced.vcd


For convenience, I've attached GTKWave screenshots with the bug ("fail") and with the fix ("pass"). (Other pins being read as '1' is fine because they are floating/output stage is in tristate, which is converted to '1' after the simulated/implied Schmitt-trigger)

The fix is a one line change updating the tracer of the PINx register, see the attached patch file.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #40906:  tracein.txt added by None (40B - text/plain)
file #40898:  pinx-not-traced.c added by None (151B - text/x-csrc)
file #40899:  pinx-not-traced_fail.png added by None (6KiB - image/png)
file #40900:  pinx-not-traced_pass.png added by None (6KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 5 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sun 11 Jun 2017 07:09:33 PM UTCNoneAttached File-=>Added tracein.txt, #40906
Sun 11 Jun 2017 04:29:16 PM UTCNoneAttached File-=>Added 0001-update-PINx-tracer-on-portpin-update.patch, #40897
  Attached File-=>Added pinx-not-traced.c, #40898
  Attached File-=>Added pinx-not-traced_fail.png, #40899
  Attached File-=>Added pinx-not-traced_pass.png, #40900

Back to the top


Powered by Savane 3.1-cleanup1