simulavr  1.1.0
specialmem.h
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  * Copyright (C) 2009 Onno Kortmann
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  *
22  ****************************************************************************
23  *
24  * $Id$
25  */
26 
27 /*@file special memory types which are rarely used
28  are defined here. */
29 #ifndef SPECIALMEM
30 #define SPECIALMEM
31 
32 #include <fstream>
33 #include "rwmem.h"
34 
36 
40 
41  public:
45  const std::string &tracename,
46  const std::string &filename);
47 
48  protected:
49  unsigned char get() const;
50  void set(unsigned char);
51 
52  std::ostream &os;
53  std::ofstream ofs;
54 
55  private:
56  unsigned char value;
57 
58 };
59 
61 
65 
66  public:
70  const std::string &tracename,
71  const std::string &filename);
72 
73  protected:
74  unsigned char get() const;
75  void set(unsigned char);
76 
77  std::istream &is;
78  mutable std::ifstream ifs;
79 
80 };
81 
83 
86 class RWExit: public RWMemoryMember {
87 
88  public:
89  RWExit(TraceValueRegister *registry, const std::string &tracename="");
90 
91  protected:
92  unsigned char get() const;
93  void set(unsigned char);
94 
95 };
96 
98 
99 class RWAbort: public RWMemoryMember {
100 
101  public:
102  RWAbort(TraceValueRegister *registry, const std::string &tracename="");
103 
104  protected:
105  unsigned char get() const;
106  void set(unsigned char);
107 
108 };
109 
110 #endif
RWWriteToFile(TraceValueRegister *registry, const std::string &tracename, const std::string &filename)
Definition: specialmem.cpp:33
exit() on access memory
Definition: specialmem.h:86
TraceValueRegister * registry
Definition: rwmem.h:106
FIFO read memory.
Definition: specialmem.h:64
FIFO write memory.
Definition: specialmem.h:39
abort() on access memory
Definition: specialmem.h:99
std::istream & is
Definition: specialmem.h:77
Build a register for TraceValue&#39;s.
Definition: traceval.h:442
Member of any memory area in an AVR device.
Definition: rwmem.h:42
std::ifstream ifs
Definition: specialmem.h:78
const std::string tracename
Definition: rwmem.h:107
std::ofstream ofs
Definition: specialmem.h:53
unsigned char value
Definition: specialmem.h:56
std::ostream & os
Definition: specialmem.h:52