simulavr  1.1.0
avrdevice.cpp
Go to the documentation of this file.
1 /*
2  ****************************************************************************
3  *
4  * simulavr - A simulator for the Atmel AVR family of microcontrollers.
5  * Copyright (C) 2001, 2002, 2003 Klaus Rudolph
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  ****************************************************************************
22  *
23  * $Id$
24  */
25 
26 #include <limits>
27 #include <assert.h>
28 
29 using namespace std;
30 
31 #include "avrdevice.h"
32 #include "traceval.h"
33 #include "helper.h"
34 #include "irqsystem.h" //GetNewPc
35 #include "systemclock.h"
36 #include "avrerror.h"
37 #include "avrmalloc.h"
38 #include "avrreadelf.h"
39 #include "flash.h"
40 #include "hwsreg.h"
41 #include "hwstack.h"
42 
43 const unsigned int AvrDevice::registerSpaceSize = 32;
44 const unsigned int AvrDevice::totalIoSpace = 0x10000;
45 
47  if(find(hwResetList.begin(), hwResetList.end(), hw) == hwResetList.end())
48  hwResetList.push_back(hw);
49 }
50 
52  if(find(hwCycleList.begin(), hwCycleList.end(), hw) == hwCycleList.end())
53  hwCycleList.push_back(hw);
54 }
55 
57  vector<Hardware*>::iterator element;
58  element=find(hwCycleList.begin(), hwCycleList.end(), hw);
59  if(element != hwCycleList.end())
60  hwCycleList.erase(element);
61 }
62 
63 void AvrDevice::Load(const char* fname) {
64  actualFilename = fname;
65  ELFLoad(this);
66 }
67 
69  clockFreq = nanosec;
70 }
71 
73  return clockFreq;
74 }
75 
76 Pin *AvrDevice::GetPin(const char *name) {
77  Pin *ret = allPins[name];
78  if(!ret)
79  avr_error("unknown Pin requested! -> %s is not available", name);
80  return ret;
81 }
82 
84  if (dumpManager) {
85  // unregister device on DumpManager
86  dumpManager->unregisterAvrDevice(this);
87  }
88 
89  // delete invalid RW memory cells on shadow store + shadow store self
90  unsigned size = totalIoSpace - registerSpaceSize - iRamSize - eRamSize;
91  for(unsigned idx = 0; idx < size; idx++)
92  delete invalidRW[idx];
93  delete [] invalidRW;
94 
95  // delete Ram cells and registers
96  for(unsigned idx = 0; idx < registerSpaceSize; idx++)
97  delete rw[idx];
98  size = registerSpaceSize + ioSpaceSize + iRamSize + eRamSize;
99  for(unsigned idx = (registerSpaceSize + ioSpaceSize); idx < size; idx++)
100  delete rw[idx];
101 
102  // delete rw and other allocated objects
103  delete Flash;
104  delete statusRegister;
105  delete status;
106  delete [] rw;
107  delete data;
108  delete fuses;
109  delete lockbits;
110 }
111 
115 class TwiceTV : public TraceValue {
116 public:
117  TwiceTV(const std::string &_name, TraceValue *_ref)
118  : TraceValue(_ref->bits()+1, _name), ref(_ref) {}
119 
120  virtual void cycle() {
121  change(ref->value()*2);
122  set_written();
123  }
124 private:
125  TraceValue *ref; // Reference value that will be doubled
126 };
127 
128 
129 AvrDevice::AvrDevice(unsigned int _ioSpaceSize,
130  unsigned int IRamSize,
131  unsigned int ERamSize,
132  unsigned int flashSize,
133  unsigned int pcSize):
135  ioSpaceSize(_ioSpaceSize),
136  iRamSize(IRamSize),
137  eRamSize(ERamSize),
138  devSignature(numeric_limits<unsigned int>::max()),
139  PC_size(pcSize),
140  rampz(nullptr),
141  eind(nullptr),
142  abortOnInvalidAccess(false),
143  coreTraceGroup(this),
144  deferIrq(false),
145  newIrqPc(0xffffffff),
146  v_supply(5.0), // assume 5V supply voltage
147  v_bandgap(1.1), // assume a bandgap ref unit with 1.1V
148  flagIWInstructions(true),
149  flagJMPInstructions(true),
150  flagIJMPInstructions(true),
151  flagEIJMPInstructions(false),
152  flagLPMInstructions(true),
153  flagELPMInstructions(false),
154  flagMULInstructions(true),
155  flagMOVWInstruction(true),
156  flagTiny10(false),
157  flagTiny1x(false),
158  flagXMega(false),
159  wado(nullptr)
160 {
164 
165  //TraceValue* pc_tracer=trace_direct(&coreTraceGroup, "PC", &cPC);
166  //coreTraceGroup.RegisterTraceValue(new TwiceTV(coreTraceGroup.GetTraceValuePrefix()+"PCb", pc_tracer));
167  trace_on = 0;
168 
169  fuses = new AvrFuses;
170  lockbits = new AvrLockBits;
171  data = new Data; //only the symbol container
172 
173  // memory space for all RW-Memory addresses + shadow store for invalid cells
174  unsigned invalidSize = totalIoSpace - registerSpaceSize - IRamSize - ERamSize;
175  rw = new RWMemoryMember* [totalIoSpace];
176  invalidRW = new RWMemoryMember* [invalidSize];
177 
178  // get data address mask, where significant bits are set
179  {
180  unsigned temp = registerSpaceSize + IRamSize + ERamSize + ioSpaceSize;
181  dataAddressMask = 0;
182  while(temp > 0) {
183  dataAddressMask <<= 1;
184  dataAddressMask += 1;
185  temp >>= 1;
186  }
187  }
188 
189  // the status register is generic to all devices
190  status = new HWSreg();
191  if(status == nullptr)
192  avr_error("Not enough memory for HWSreg in AvrDevice::AvrDevice");
194  if(statusRegister == nullptr)
195  avr_error("Not enough memory for RWSreg in AvrDevice::AvrDevice");
196 
197  // placeholder for SPM register
198  spmRegister = nullptr;
199 
200  // create the flash area with specified size
201  Flash = new AvrFlash(this, flashSize);
202  if(Flash == nullptr)
203  avr_error("Not enough memory for Flash in AvrDevice::AvrDevice");
204 
205  // create all registers
206  unsigned currentOffset = 0;
207  unsigned invalidRWOffset = 0;
208 
209  for(unsigned ii = 0; ii < registerSpaceSize; ii++) {
210  rw[currentOffset] = new RAM(&coreTraceGroup, "r", ii, registerSpaceSize);
211  if(rw[currentOffset] == nullptr)
212  avr_error("Not enough memory for registers in AvrDevice::AvrDevice");
213  currentOffset++;
214  }
215 
216  /* Create invalid registers in I/O space which will fail on access (to
217  make simulavr more robust!) In all well implemented devices, these
218  should be overwritten by the particular device type. But accessing such
219  a register will at least notify the user that there is an unimplemented
220  feature or reserved register. */
221  for(unsigned ii = 0; ii < ioSpaceSize; ii++) {
222  invalidRW[invalidRWOffset] = new InvalidMem(this, currentOffset);
223  if(invalidRW[invalidRWOffset] == nullptr)
224  avr_error("Not enough memory for io space in AvrDevice::AvrDevice");
225  rw[currentOffset] = invalidRW[invalidRWOffset];
226  currentOffset++;
227  invalidRWOffset++;
228  }
229 
230  // create the internal ram handlers
231  for(unsigned ii = 0; ii < IRamSize; ii++ ) {
232  rw[currentOffset] = new RAM(&coreTraceGroup, "IRAM", ii, IRamSize);
233  if(rw[currentOffset] == nullptr)
234  avr_error("Not enough memory for IRAM in AvrDevice::AvrDevice");
235  currentOffset++;
236  }
237 
238  // create the external ram handlers, TODO: make the configuration from
239  // mcucr available here
240  for(unsigned ii = 0; ii < ERamSize; ii++ ) {
241  rw[currentOffset] = new RAM(&coreTraceGroup, "ERAM", ii, ERamSize);
242  if(rw[currentOffset] == nullptr)
243  avr_error("Not enough memory for io space in AvrDevice::AvrDevice");
244  currentOffset++;
245  }
246 
247  assert(currentOffset<=totalIoSpace);
248  // fill the rest of the address space with error handlers
249  for(; currentOffset < totalIoSpace; currentOffset++, invalidRWOffset++) {
250  invalidRW[invalidRWOffset] = new InvalidMem(this, currentOffset);
251  if(invalidRW[invalidRWOffset] == nullptr)
252  avr_error("Not enough memory for fill address space in AvrDevice::AvrDevice");
253  rw[currentOffset] = invalidRW[invalidRWOffset];
254  }
255 }
256 
257 // do a single core step, (0)->a real hardware step, (1) until the uC finish the opcode!
258 int AvrDevice::Step(bool &untilCoreStepFinished, SystemClockOffset *nextStepIn_ns) {
259  if(cpuCycles <= 0)
260  cPC=PC;
261 
262  if(trace_on == 1) {
263  traceOut << actualFilename << " ";
264  traceOut << HexShort(cPC << 1) << dec << ": ";
265 
266  string sym(Flash->GetSymbolAtAddress(cPC));
267  traceOut << sym << " ";
268  for(int len = sym.length(); len < 30;len++)
269  traceOut << " " ;
270  }
271 
272  bool hwWait = false;
273  for(unsigned i = 0; i < hwCycleList.size(); i++) {
274  Hardware * p = hwCycleList[i];
275  if(p->CpuCycle() > 0)
276  hwWait = true;
277  }
278 
279  if(hwWait) {
280  if(trace_on)
281  traceOut << "CPU-Hold by IO-Hardware ";
282  } else if(cpuCycles <= 0) {
283 
284  //check for enabled breakpoints here
285  if(BP.end() != find(BP.begin(), BP.end(), PC)) {
286  if(trace_on)
287  traceOut << "Breakpoint found at 0x" << hex << PC << dec << endl;
288  if(nextStepIn_ns != nullptr)
289  *nextStepIn_ns = clockFreq;
290  untilCoreStepFinished = !(cpuCycles > 0);
291  dumpManager->cycle();
292  return BREAK_POINT;
293  }
294 
295  if(EP.end() != find(EP.begin(), EP.end(), PC)) {
296  avr_message("Simulation finished!");
298  dumpManager->cycle();
299  return 0;
300  }
301 
302  if(deferIrq) {
303  /* Every IRQ is delayed of one cycle. Normally this happens (see datasheet)
304  * only after a SEI instruction or after a RETI. But because of
305  * "pipelining" (first cycle is fetch instruction, second is processing)
306  * it's never possible to raise an interrupt with a instruction from
307  * inside the controller immediately after fetching (and processing here
308  * in simulavr) this instruction. Only a external source or peripherals
309  * could do that. Hold this in mind, if you try to measure processing time!
310  */
311  deferIrq = false;
312 
313  /* Attention: If now the I flag was cleaned, do not enter to the irq, CLI
314  * will stop execution of irq handling immediatly
315  */
316 
317  /* TODO: The handling of IRQ was correct in older versions!
318  * Please refactor the Step method to get it simpler and faster.
319  * Checking multiple times on I flag and pending IRQs looks very ugly here!
320  */
321  if ( status->I == 1 )
322  {
324 
325  if ( newIrqPc != 0xffffffff )
326  {
327  if(trace_on)
328  traceOut << "IRQ DETECTED: VectorAddr: " << newIrqPc ;
329 
330  irqSystem->IrqHandlerStarted(actualIrqVector); //what vector we raise?
333  stack->PushAddr(PC);
334  cpuCycles = 4; //push needs 4 cycles! (on external RAM +2, this is handled from HWExtRam!)
335  status->I = 0; //irq started so remove I-Flag from SREG
336  PC = newIrqPc - 1; //we add a few lines later 1 so we sub here 1 :-)
337  }
338  }
339 
340  }
341 
342  if( (!deferIrq ) && (status->I == 1) ) {
343  if ( irqSystem->IsIrqPending() )
344  {
345  deferIrq = true; // do always one instruction before entering irq vect
346  }
347  }
348 
349  if(cpuCycles <= 0) {
350  if((unsigned int)(PC << 1) >= (unsigned int)Flash->GetSize() ) {
351  ostringstream os;
352  os << actualFilename << " Simulation runs out of Flash Space at " << hex << (PC << 1);
353  string s = os.str();
354  if(trace_on)
355  traceOut << s << endl;
356  avr_error("%s", s.c_str());
357  }
358 
360  if(trace_on) {
361  cpuCycles = de->Trace();
362  } else {
363  cpuCycles = (*de)();
364  }
365  // report changes on status
367  }
368 
369  PC++;
370  cpuCycles--;
371  } else { //cpuCycles>0
372  if(trace_on == 1)
373  traceOut << "CPU-waitstate";
374  cpuCycles--;
375  }
376 
377  if(nextStepIn_ns != nullptr)
378  *nextStepIn_ns = clockFreq;
379 
380  if(trace_on == 1) {
381  traceOut << endl;
383  }
384 
385  untilCoreStepFinished = !((cpuCycles > 0) || hwWait);
386  dumpManager->cycle();
387  return (cpuCycles < 0) ? cpuCycles : 0;
388 }
389 
391  cPC = PC = fuses->GetResetAddr();
392 
393  vector<Hardware *>::iterator ii;
394  for(ii= hwResetList.begin(); ii != hwResetList.end(); ii++)
395  (*ii)->Reset();
396 
397  *status = 0;
398 
399  // init the old static vars from Step()
400  cpuCycles = 0;
401 }
402 
404  BP.erase(BP.begin(), BP.end());
405 }
406 
407 void AvrDevice::SetDeviceNameAndSignature(const std::string &name, unsigned int signature) {
408  devName = name;
409  devSignature = signature;
410 }
411 
412 void AvrDevice::ReplaceIoRegister(unsigned int offset, RWMemoryMember *newMember) {
413  if (offset >= ioSpaceSize + registerSpaceSize)
414  avr_error("Could not replace register in non existing IoRegisterSpace");
415  rw[offset] = newMember;
416 }
417 
418 bool AvrDevice::ReplaceMemRegister(unsigned int offset, RWMemoryMember *newMember) {
419  if(offset < totalIoSpace) {
420  rw[offset] = newMember;
421  return true;
422  }
423  return false;
424 }
425 
427  if(offset < totalIoSpace)
428  return rw[offset];
429  return nullptr;
430 }
431 
432 void AvrDevice::RegisterTerminationSymbol(const char *symbol) {
433  unsigned int epa = Flash->GetAddressAtSymbol(symbol);
434  EP.push_back(epa);
435 }
436 
438 {
439  const int COUNT = sizeof DebugRecentJumps / sizeof DebugRecentJumps[0];
442  int next = (DebugRecentJumpsIndex + 1) % COUNT;
443  DebugRecentJumps[next] = -1;
444 }
445 
446 unsigned char AvrDevice::GetRWMem(unsigned addr) {
447  if(addr >= GetMemTotalSize())
448  return 0;
449  return *(rw[addr]);
450 }
451 
452 bool AvrDevice::SetRWMem(unsigned addr, unsigned char val) {
453  if(addr >= GetMemTotalSize())
454  return false;
455  *(rw[addr]) = val;
456  return true;
457 }
458 
459 unsigned char AvrDevice::GetCoreReg(unsigned addr) {
460  assert(addr < registerSpaceSize);
461  return *(rw[addr]);
462 }
463 
464 bool AvrDevice::SetCoreReg(unsigned addr, unsigned char val) {
465  assert(addr < registerSpaceSize);
466  *(rw[addr]) = val;
467  return true;
468 }
469 
470 unsigned char AvrDevice::GetIOReg(unsigned addr) {
471  assert(addr < ioSpaceSize); // callers do use 0x00 base, not 0x20
472  return *(rw[addr + registerSpaceSize]);
473 }
474 
475 bool AvrDevice::SetIOReg(unsigned addr, unsigned char val) {
476  assert(addr < ioSpaceSize); // callers do use 0x00 base, not 0x20
477  *(rw[addr + registerSpaceSize]) = val;
478  return true;
479 }
480 
481 bool AvrDevice::SetIORegBit(unsigned addr, unsigned bitaddr) {
482  assert(addr < 0x20); // only first 32 IO registers are bit-settable
483  (rw[addr + registerSpaceSize])->set_bit( bitaddr );
484  return true;
485 }
486 
487 bool AvrDevice::ClearIORegBit( unsigned addr, unsigned bitaddr ) {
488  assert(addr < 0x20); // only first 32 IO registers are bit-settable
489  (rw[addr + registerSpaceSize])->clear_bit( bitaddr );
490  return true;
491 }
492 
493 unsigned AvrDevice::GetRegX(void) {
494  // R27:R26
495  return (*(rw[27]) << 8) + *(rw[26]);
496 }
497 
498 unsigned AvrDevice::GetRegY(void) {
499  // R29:R28
500  return (*(rw[29]) << 8) + *(rw[28]);
501 }
502 
503 unsigned AvrDevice::GetRegZ(void) {
504  // R31:R30
505  return (*(rw[31]) << 8) + *(rw[30]);
506 }
507 
508 // EOF
AvrFlash * Flash
Definition: avrdevice.h:98
SystemClockOffset clockFreq
Period of a tick (1/F_OSC) in [ns].
Definition: avrdevice.h:82
DumpManager * dumpManager
Definition: avrdevice.h:139
void ELFLoad(const AvrDevice *core)
Definition: avrreadelf.cpp:38
std::string GetSymbolAtAddress(unsigned int add)
Definition: memory.cpp:67
One byte in any AVR RAM.
Definition: rwmem.h:202
void AddToCycleList(Hardware *hw)
Definition: avrdevice.cpp:51
const unsigned int ioSpaceSize
Definition: avrdevice.h:70
AvrFuses * fuses
Definition: avrdevice.h:100
void RegisterTerminationSymbol(const char *symbol)
Definition: avrdevice.cpp:432
unsigned GetRegZ(void)
Get value of Z register (16bit)
Definition: avrdevice.cpp:503
SystemConsoleHandler sysConHandler
The SystemConsoleHandler instance for common usage.
Definition: avrerror.cpp:234
RWMemoryMember * GetMemRegisterInstance(unsigned int offset)
Definition: avrdevice.cpp:426
Pin class, handles input and output to external parts.
Definition: pin.h:98
TwiceTV(const std::string &_name, TraceValue *_ref)
Definition: avrdevice.cpp:117
HWIrqSystem * irqSystem
Definition: avrdevice.h:104
std::vector< Hardware * > hwResetList
Definition: avrdevice.h:136
void SetReturnPoint(unsigned long stackPointer, Funktor *listener)
Subscribes a Listener for a return address.
Definition: hwstack.cpp:66
AvrDevice(unsigned int ioSpaceSize, unsigned int IRamSize, unsigned int ERamSize, unsigned int flashSize, unsigned int pcSize=2)
Definition: avrdevice.cpp:129
unsigned int dataAddressMask
which bits in address are significant
Definition: avrdevice.h:97
#define avr_message(...)
Definition: avrerror.h:132
bool ReplaceMemRegister(unsigned int offset, RWMemoryMember *)
Definition: avrdevice.cpp:418
void registerAvrDevice(AvrDevice *dev)
Add a device to devicelist.
Definition: traceval.cpp:594
Holds AVR flash content and symbol informations.
Definition: flash.h:38
bool SetIORegBit(unsigned addr, unsigned bitaddr)
Set a bit value to lower IO register (without offset of 0x20!)
Definition: avrdevice.cpp:481
std::string actualFilename
Definition: avrdevice.h:84
virtual ~AvrDevice()
Definition: avrdevice.cpp:83
#define traceOut
Definition: avrerror.h:121
STL namespace.
bool SetRWMem(unsigned addr, unsigned char val)
Set a value to RW memory cell.
Definition: avrdevice.cpp:452
bool ClearIORegBit(unsigned addr, unsigned bitaddr)
Clear a bit value to lower IO register (without offset of 0x20!)
Definition: avrdevice.cpp:487
void DeleteAllBreakpoints(void)
Clear all breakpoints in device.
Definition: avrdevice.cpp:403
Memory on which access should be avoided! :-)
Definition: rwmem.h:221
void Reset()
Definition: avrdevice.cpp:390
Definition: hwsreg.h:52
#define avr_error(...)
Definition: avrerror.h:135
Definition: hwsreg.h:65
SystemClockOffset GetClockFreq()
Definition: avrdevice.cpp:72
unsigned char GetRWMem(unsigned addr)
Get a value of RW memory cell.
Definition: avrdevice.cpp:446
virtual unsigned int CpuCycle(void)
Definition: hardware.h:46
HWSreg * status
the status register itself
Definition: avrdevice.h:132
int cpuCycles
Count of cycles before next instruction is executed (i.e. countdown)
Definition: avrdevice.h:87
Build a register for TraceValue&#39;s.
Definition: traceval.h:442
bool SetIOReg(unsigned addr, unsigned char val)
Set a value to IO register (without offset of 0x20!)
Definition: avrdevice.cpp:475
Breakpoints BP
Definition: avrdevice.h:91
DecodedInstruction * GetInstruction(unsigned int pc)
Definition: flash.cpp:80
void trigger_change(void)
reflect a change, which comes from CPU core
Definition: hwsreg.h:70
TraceValueCoreRegister coreTraceGroup
Definition: avrdevice.h:108
virtual void cycle()
Called at least once for each cycle if this trace value is activated.
Definition: avrdevice.cpp:120
static SystemClock & Instance()
Returns the central SystemClock instance for the application.
void SetDeviceNameAndSignature(const std::string &name, unsigned int signature)
Set device signature and name.
Definition: avrdevice.cpp:407
static const unsigned int registerSpaceSize
Definition: avrdevice.h:72
unsigned int cPC
When mupti-cycle instruction is "processed" this holds its address, PC holds the next instruction...
Definition: avrdevice.h:95
RWMemoryMember ** invalidRW
hold invalid RW memory cells created by device
Definition: avrdevice.h:69
virtual void PushAddr(unsigned long addr)=0
Pushs a address to stack.
void IrqHandlerStarted(unsigned int vector_index)
Definition: irqsystem.cpp:273
unsigned GetRegX(void)
Get value of X register (16bit)
Definition: avrdevice.cpp:493
Member of any memory area in an AVR device.
Definition: rwmem.h:42
Base class of core instruction.
Definition: decoder.h:39
bool IsIrqPending()
Definition: irqsystem.cpp:212
unsigned int GetResetAddr(void)
Get reset address.
Definition: flashprog.cpp:303
unsigned int GetSize()
Definition: memory.h:85
Data * data
a hack for symbol look-up
Definition: avrdevice.h:103
bool I
Definition: hwsreg.h:37
long long SystemClockOffset
std::vector< Hardware * > hwCycleList
Definition: avrdevice.h:137
Pin * GetPin(const char *name)
Definition: avrdevice.cpp:76
unsigned int GetNewPc(unsigned int &vector_index)
returns a new PC pointer if interrupt occurred, -1 otherwise.
Definition: irqsystem.cpp:216
void Stop()
Stop Run/Endless or Step asynchronously.
std::string devName
hold the device name, which this core simulate
Definition: avrdevice.h:76
Support for fuse bits.
Definition: flashprog.h:100
unsigned char GetIOReg(unsigned addr)
Get a value from IO register (without offset of 0x20!)
Definition: avrdevice.cpp:470
int DebugRecentJumps[20]
Addresses of last few &#39;call&#39; and &#39;jump&#39; executed. For debugging.
Definition: avrdevice.h:126
unsigned int GetAddressAtSymbol(const std::string &s)
Definition: memory.cpp:35
unsigned GetRegY(void)
Get value of Y register (16bit)
Definition: avrdevice.cpp:498
unsigned int GetMemTotalSize(void)
Get configured total memory space size.
Definition: avrdevice.h:188
unsigned int actualIrqVector
Definition: avrdevice.h:111
RWMemoryMember ** rw
The whole memory: R0-R31, IO, Internal RAM.
Definition: avrdevice.h:129
void SetClockFreq(SystemClockOffset f)
Definition: avrdevice.cpp:68
unsigned char GetCoreReg(unsigned addr)
Get a value from core register.
Definition: avrdevice.cpp:459
bool deferIrq
Almost always false.
Definition: avrdevice.h:109
void RemoveFromCycleList(Hardware *hw)
Removes from the cycle list, if possible.
Definition: avrdevice.cpp:56
void TraceNextLine(void)
Ends a trace line, performs reopen new filestream, if necessary.
Definition: avrerror.cpp:121
bool SetCoreReg(unsigned addr, unsigned char val)
Set a value to core register.
Definition: avrdevice.cpp:464
int trace_on
Definition: avrdevice.h:90
unsigned long GetStackPointer() const
Returns current stack pointer value.
Definition: hwstack.h:116
unsigned int devSignature
hold the device signature for this core
Definition: avrdevice.h:75
void Load(const char *n)
Load flash, eeprom, signature, fuses from elf file, wrapper for LoadBFD or LoadSimpleELF.
Definition: avrdevice.cpp:63
HWStack * stack
Definition: avrdevice.h:131
RWSreg * statusRegister
the memory interface for status
Definition: avrdevice.h:133
Hold data memory block and symbol informations.
Definition: memory.h:95
void ReplaceIoRegister(unsigned int offset, RWMemoryMember *)
Definition: avrdevice.cpp:412
static DumpManager * Instance(void)
Singleton class access.
Definition: traceval.cpp:567
unsigned int PC
Definition: avrdevice.h:93
int Step(bool &untilCoreStepFinished, SystemClockOffset *nextStepIn_ns=0)
Definition: avrdevice.cpp:258
FlashProgramming * spmRegister
Definition: avrdevice.h:99
static const unsigned int totalIoSpace
Definition: avrdevice.h:71
void cycle()
Definition: traceval.cpp:686
void IrqHandlerFinished(unsigned int vector_index)
Definition: irqsystem.cpp:285
AvrLockBits * lockbits
Definition: avrdevice.h:101
Support for lock bits.
Definition: flashprog.h:138
void AddToResetList(Hardware *hw)
Definition: avrdevice.cpp:46
unsigned int newIrqPc
Definition: avrdevice.h:110
int DebugRecentJumpsIndex
Index to address of the most recent jump.
Definition: avrdevice.h:127
Exitpoints EP
Definition: avrdevice.h:92
TraceValue * ref
Definition: avrdevice.cpp:125
#define BREAK_POINT
Definition: avrdevice.h:43
void DebugOnJump()
When a call/jump/cond-jump instruction was executed. For debugging.
Definition: avrdevice.cpp:437