patchSimulavr: an AVR simulator - Patches: patch #7079, Trace fixes and better memory...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #7079: Trace fixes and better memory access

Submitter:  Petr Hluzin <petrh>
Submitted:  Sun 31 Jan 2010 10:13:47 PM UTC
   
 
Category:  bug fix Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  simulavrxx

Sat 19 Nov 2011 12:11:59 AM UTC, comment #2: 

The patch is almost completely already incorporated in the current code. (Who did that? Me? When? I am weak with git.) I do not recall committing it.

The only remaining thing had been the removal of redundant HWStackSram::mem - which has just been committed: http://git.savannah.gnu.org/cgit/simulavr.git/commit/?id=4a6450910a752898a1bdb080e5f21f26b844fe7b

Petr Hluzin <petrh>
Group Member
Sun 07 Feb 2010 07:20:47 PM UTC, comment #1: 

Submitting version 2 of the patch.

Some incorrect assertions were removed. (It turned out to be legal to access registers and IO by a STD instruction.)

(file #19641)

Petr Hluzin <petrh>
Group Member
Sun 31 Jan 2010 10:13:47 PM UTC, original submission:  

avr_op_ADIW::Trace( ) - did print register and the constant swapped (see ctor)
avr_op_BRBS::Trace( ) - printed bogus value as a destination (BRBS is 2B instruction)
avr_op_BSET::Trace( ) - printed using bogus index (get_reg_bit vs get_sreg_bit in ctor)
avr_op_CALL::Trace( ) - printed uninitialized value as address
avr_op_DEC::Trace( )  - printed bogus second argument
avr_op_LPM_Z::Trace() - did not print the written-to register

(Remaining changes are not user-visible.)

These were found while adjusting the code for different handling of memory access: reading/writing (after this patch) goes through device first. (I have to tinker with it and RWMemoryWithOwnMemory would be ugly.)

pros:

  • nicer ctors
  • easier peeking into simulavr while debugging
  • smaller DecodedInstruction instances (by ~3*4B)
  • reduced cache pressure
  • allows more efficient (cache friendly) storage of data memory (not yet in this patch)
  • less chance for wrong *::Trace() code or wrong X,Y,Z read


cons:

  • uglier *::operator()
  • 1 more hot field in AvrDevice
  • unaligned access to fields in instructions



HWStack::HWStack() has one less argument, all devices have to be trivially adjusted.

Some instructions still have HWSreg* status - we can get rid of that. (I do not need that though.)

The DecodedInstruction ctor still accepts the extra arguments after this patch.
I would remove them but one my diff tool gets confused by that many changes (yours may too).
I can prepare another patch that just removes the extra arguments if you like.


Petr Hluzin <petrh>
Group Member

 

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

Attached Files
file #19641:  memory-access-v2.patch added by petrh (105KiB - text/x-diff)
file #19586:  memory-access.patch added by petrh (105KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tomk (Updated the item)
  • -email is unavailable- added by petrh (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-10-06 tomk Open/ClosedOpen Closed
    2011-11-19 petrh StatusNone Done
    2010-02-07 petrh Attached File- Added memory-access-v2.patch, #19641
    2010-01-31 petrh Attached File- Added memory-access.patch, #19586

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code