bugSimulavr: an AVR simulator - Bugs: bug #40594, Store simulation parameters inside...


bug #40594: Store simulation parameters inside the ELF file

Submitted by:  Markus Hitter <hitterm>
Submitted on:  Fri 15 Nov 2013 10:12:16 PM UTC  
Category: SimulationSeverity: 3 - Normal
Item Group: NoneStatus: Wont Fix
Privacy: PublicAssigned to: Thomas K. <tomk>
Open/Closed: ClosedComponent Version: simulavr

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

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


(Jump to the original submission Jump to the original submission)

Fri 10 Oct 2014 09:27:01 AM UTC, comment #8:

Having this Wont Fix unfortunately forces me to keep our SimulAVR fork at Github: https://github.com/Traumflug/simulavr . That's disappointing.

Markus Hitter <hitterm>
Sat 04 Oct 2014 04:52:17 PM UTC, comment #7:


as discussed in mailing list, wouldn't implemented.

Thomas K. <tomk>
Project AdministratorIn charge of this item.
Sat 14 Jun 2014 01:46:30 PM UTC, comment #6:

As the libbfd/libiberty version is bitrotten already. I've just rebased my fork on Github:


It appears to work fine.

Markus Hitter <hitterm>
Fri 22 Nov 2013 11:18:13 AM UTC, comment #5:

All my stuff is now on Github for ease of integration and ease of testing. See https://github.com/Traumflug/simulavr SIMINFO stuff works there right out of the box.

Markus Hitter <hitterm>
Sat 16 Nov 2013 11:19:09 PM UTC, comment #4:

A bunch of additional patches. -d and -F command line parameters are redundant now with a prepared AVR firmware.

Next step on the plan is to introduce similar storage for USART connections, then for VCD output.

The idea of this whole story is to make running the simulator independent from additional TCL or Python scripting. Simply define the connections in your firmware and run the thing. One whole language less to make a headache about and at compile time one knows best how things are to be connected.

(file #29636, file #29637, file #29638)

Markus Hitter <hitterm>
Sat 16 Nov 2013 04:13:23 PM UTC, comment #3:

As a first implementation of storing device information inside the ELF file bringing into action, please find a patch attached, which detects and uses the device name. It's the SIMINFO_DEVICE() macro.

(file #29633)

Markus Hitter <hitterm>
Fri 15 Nov 2013 11:07:29 PM UTC, comment #2:

Ach. Found the first bug already, the choosen address in the ELF file was low enough to conflict with program data. Please find the fix attached.

(file #29628)

Markus Hitter <hitterm>
Fri 15 Nov 2013 10:15:31 PM UTC, comment #1:

BTW., fixed also src/avrerror.h to throw fewer warnings along the way. This accidently slipped into the same commit.

Markus Hitter <hitterm>
Fri 15 Nov 2013 10:12:16 PM UTC, original submission:

I found it a bit cumbersone to remember for each run of a simulation for which device the binary was compiled for. Obviously, storing these parameters right at compilation time makes running simulations easier.

I found simavr to have a nice concept: store these parameters in custom sections of the ELF file. This way they're available to the simulator and get ignored when uploaded to real hardware. On how to use it, see the comments in src/simulavr_info.h (new file). It's really simple, at compilation time we know best for which device we compile, after all.

For now this is a proof of concept. Storing parameters works fine, reading them back, too, but instead of being used, they're simple written to the console. For now the parameters are device type and cpu frequency, but the concept can be extended easily to all other command line parameters. As soon as the values are actually applied, the -d and -F command line parameters become obsolete (but should override the stored info if given anyways for those who know what they're doing).

The proof is applied to the simple_serial example.

Please find the patch attached and enjoy!

Markus Hitter <hitterm>


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

Attach File(s):


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by tomk (Posted a comment)
  • -unavailable- added by hitterm (Submitted the item)

    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 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 04 Oct 2014 04:52:17 PM UTCtomkStatusNone=>Wont Fix
      Assigned toNone=>tomk
    Sat 16 Nov 2013 11:19:09 PM UTChittermAttached File-=>Added 0004-ELF-simulation-info-storage-bring-SIMINFO_CPUFREQUEN.patch, #29636
      Attached File-=>Added 0005-ELF-simulation-info-storage-introduce-a-length-varia.patch, #29637
      Attached File-=>Added 0006-ELF-simulation-info-storage-fix-another-wrong-warnin.patch, #29638
    Sat 16 Nov 2013 04:13:23 PM UTChittermAttached File-=>Added 0003-ELF-simulation-info-storage-bring-SIMINFO_DEVICE-int.patch, #29633
    Fri 15 Nov 2013 11:07:29 PM UTChittermAttached File-=>Added 0002-ELF-simulation-info-storage-don-t-conflict-with-prog.patch, #29628
    Fri 15 Nov 2013 10:12:16 PM UTChittermAttached File-=>Added 0001-Allow-to-store-simulation-parameters-inside-the-ELF-.patch, #29627

    Back to the top

    Powered by Savane 3.1-cleanup