2 * Simulator of microcontrollers (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
37 /* Memory location handled specially by a hw element */
39 class cl_memloc: public cl_base
49 virtual ulong read(class cl_mem *mem);
50 virtual void write(class cl_mem *mem, long addr, ulong *val);
53 class cl_memloc_coll: public cl_sorted_list
58 virtual void *key_of(void *item);
59 virtual int compare(void *key1, void *key2);
61 class cl_memloc *get_loc(long address);
67 class cl_mem: public cl_base
78 class cl_memloc_coll *read_locs, *write_locs;
82 cl_mem(enum mem_class atype, t_addr asize, int awidth);
84 virtual int init(void);
85 virtual char *id_string(void);
87 virtual ulong read(t_addr addr);
88 virtual ulong get(t_addr addr);
89 virtual void write(t_addr addr, t_mem *val);
90 virtual void set(t_addr addr, t_mem val);
91 virtual void set_bit1(t_addr addr, t_mem bits);
92 virtual void set_bit0(t_addr addr, t_mem bits);
93 virtual void dump(t_addr start, t_addr stop, int bpl, class cl_console *con);
98 class cl_bitmap: public cl_base
104 cl_bitmap(long asize);
106 virtual void set(long pos);
107 virtual void clear(long pos);
108 virtual bool get(long pos);
109 virtual bool empty(void);
112 class cl_rom: public cl_mem
115 class cl_bitmap *bp_map;
116 class cl_bitmap *inst_map;
118 cl_rom(long asize, int awidth);