[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Simulavr-devel] Run a devices twice
From: |
zug |
Subject: |
[Simulavr-devel] Run a devices twice |
Date: |
Fri, 9 Jun 2017 10:12:00 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 |
Hi everyone,
thanks for providing simulavr with a Python interface, I would like to use the
simulator to evaluate automatically AVR code of my students. Hence, I have a
number of elf files and it was my intention to run a script loading one by one
and execute some tests. But I failed to reset the simulator and the virtual
controller ...
To condense my problem I prepared the following code snippet that should run and
rerun an elf file. For reseting the simulation I added a method
def ResetSystem(self):
self.__sc.ResetClock()
in ex_utils.py. When I excute the script
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
import ex_utils
mcu = "atmega32"
sim = ex_utils.SimulavrAdapter()
sim.dmanSingleDeviceApplication()
# Test 1
print "First Run"
dev = sim.loadDevice(mcu, "blinking_LED.elf")
sim.doRun(10000) # Execute an exemplary simulation
sim.ResetSystem() # Reset the simulation system
# Test 2
print "Second Run"
dev = sim.loadDevice(mcu, "blinking_LED.elf")
sim.doRun(10000) # Execute an examplary simulation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I got
â–¶ python evaluationFailure.py
First Run
Second Run
FATAL: file traceval.cpp: line 567: Can't create device name twice, because it's
a single device application
What's happened? The syncMembers vector should be empty? Why do we have a
conflict here?
Thanks for your help
Sebastian
--
-------------------------------------------------------------
Junior-Prof. Dr.-Ing. Sebastian Zug
Dept. Embedded Smart Systems (ESS)
Institute for Intelligent Cooperating Systems (IKS)
Otto-von-Guericke-University of Magdeburg
Universitätsplatz 2
39106 Magdeburg
Germany
mail: address@hidden
Tel.: +49 - 391 - 67 - 52632
Fax: +49 - 391 - 67 - 11161
- [Simulavr-devel] Run a devices twice,
zug <=