Slow simulator

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was wondering if there is any way to speed up the AVR Studio simulator. I am running a simulation of an ATmega48 15 minute timer using timer 1. It has been running for 13 hours and is up to 7.5 minutes. That means it will take over 26 hours to simulate 15 minutes. The clock is set to 7.1 Mhz in the simulator options. The code was compiled with GCC with optimization set to Os.

Am I missing something in how this should work? MPLAB will run the same simulation in a little over 30 minutes for the PIC processors.

I am running a dual core 2.2 Ghz AMD processor with 1 Gig of ram so the PC is not slow.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have also been wondering how to increase the speed of the simulation.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The simulator is not made to simulate several minutes of real runtime. It is usually only used to simulate a few ms. There are probably ways to speed up simulation, because other simulators that are made to simulate a hole old computer (Amiga, C64) are much faster. But this meens writing a hole new simulator. As far as I know the is at least one other simulator, running under Linux.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm having the same problem. I can't believe your patients dude! I've been searching old forum topics to find the answer, but nothing. If you figure it out please post here. I'll be watching. Likewise I.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Got it. Check out this old post:
I read the other post. I realize it is a simulator and I can test it on the Dragon once I get the hardware built. I am writing the code before prototyping the hardware.

However, what I said in the original post is that MPLAB will run the same simulation in about 30 minutes. There is a huge difference between 30 minutes and 20-some-odd hours. Now to be fair, I have never ran that type of simulation using a C compiled program in MPLAB. Everything I did with the PICs in MPLAB was with assembler. I guess I could put together a short AVR assembler program and try the simulation.

Also, back in the mid 90s, the same simulation in MPLAB would have taken over 20 hours. However, somewhere around 2004 they fixed the simulator so that it runs extremely fast. I would think Atmel could do the same thing with Studio.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I guess I could put together a short AVR assembler program and try the simulation.

The simulator is simulating AVR machine language.

Any difference in simulating speed between code written in assembler and in C should be an indicator of the respective effectiveness of the assembler programmer and the C programmer+compiler.

As for the heart of the matter: It might well be possible for the Atmel folks to write a simulator that runs faster, but I suspect that many 'freaks would rather wish for a simulator that had some of the bugs removed (eg. not simulating timers correctly).

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

1+ MIPS cycle accurate simulation of an AVR should be no problem for any modern desktop machine. I'm not quite sure what is with AVR's simulator. I'll benchmark simulavrxx tomorrow and post the results.

Math is cool.
jevinskie.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

FYI, after looking at the Simulator v2 DLLs, it looks like Atmel is using ARC (formerly Tenison) VTOC, a RTL to C++ compiler. Pretty interesting. :)

http://www.arc.com/software/simu...

Math is cool.
jevinskie.com