2 * Simulator of microcontrollers (sim.src/memcl.h)
4 * Copyright (C) 1999,99 Drotos Daniel, Talker Bt.
6 * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
10 /* This file is part of microcontroller simulator: ucsim.
12 UCSIM is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 UCSIM is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with UCSIM; see the file COPYING. If not, write to the Free
24 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
28 #ifndef SIM_MEMCL_HEADER
29 #define SIM_MEMCL_HEADER
39 /* Memory location handled specially by a hw element */
41 class cl_memloc: public cl_base
48 cl_memloc(t_addr addr);
51 virtual ulong read(class cl_mem *mem);
52 virtual void write(class cl_mem *mem, t_addr addr, t_mem *val);
55 class cl_memloc_coll: public cl_sorted_list
60 virtual void *key_of(void *item);
61 virtual int compare(void *key1, void *key2);
63 class cl_memloc *get_loc(t_addr address);
69 class cl_mem: public cl_guiobj
74 char *addr_format, *data_format;
82 class cl_memloc_coll *read_locs, *write_locs;
86 cl_mem(enum mem_class atype, char *aclass_name, t_addr asize, int awidth);
88 virtual int init(void);
89 virtual char *id_string(void);
91 virtual t_mem read(t_addr addr);
92 virtual t_mem get(t_addr addr);
93 virtual void write(t_addr addr, t_mem *val);
94 virtual void set(t_addr addr, t_mem val);
95 virtual void set_bit1(t_addr addr, t_mem bits);
96 virtual void set_bit0(t_addr addr, t_mem bits);
97 virtual t_mem add(t_addr addr, long what);
98 virtual t_addr dump(t_addr start, t_addr stop, int bpl,
99 class cl_console *con);
100 virtual t_addr dump(class cl_console *con);
101 virtual bool search_next(bool case_sensitive,
102 t_mem *array, int len, t_addr *addr);
107 class cl_bitmap: public cl_base
113 cl_bitmap(t_addr asize);
115 virtual void set(t_addr pos);
116 virtual void clear(t_addr pos);
117 virtual bool get(t_addr pos);
118 virtual bool empty(void);
121 class cl_rom: public cl_mem
124 class cl_bitmap *bp_map;
125 class cl_bitmap *inst_map;
127 cl_rom(t_addr asize, int awidth);