2 * Simulator of microcontrollers (errorcl.h)
4 * Copyright (C) 2001,01 Drotos Daniel, Talker Bt.
6 * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
11 This file is part of microcontroller simulator: ucsim.
13 UCSIM is free software; you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation; either version 2 of the License, or
16 (at your option) any later version.
18 UCSIM is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with UCSIM; see the file COPYING. If not, write to the Free
25 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
30 #ifndef ERRORCL_HEADER
31 #define ERRORCL_HEADER
37 extern struct id_element error_on_off_names[];
45 const int err_stop= (err_unknown|err_error);
47 #define ERROR_CLASS_DECL(NAME) \
48 extern class cl_error_class error_##NAME##_class;\
51 #define ERROR_CLASS_DEF_PARENT(TYPE,NAME,CLASS_NAME,PARENT) \
52 class cl_error_class error_##NAME##_class(TYPE, CLASS_NAME, &(PARENT))
54 #define ERROR_CLASS_DEF_PARENT_ON(TYPE,NAME,CLASS_NAME,PARENT,ON) \
55 class cl_error_class error_##NAME##_class(TYPE, CLASS_NAME, &(PARENT), ON)
58 extern class cl_list *registered_errors;
60 class cl_error_class: public cl_base
67 cl_error_class(enum error_type typ, char *aname);
68 cl_error_class(enum error_type typ, char *aname,
69 enum error_on_off be_on);
70 cl_error_class(enum error_type typ, char *aname,
71 class cl_error_class *parent);
72 cl_error_class(enum error_type typ, char *aname,
73 class cl_error_class *parent,
74 enum error_on_off be_on);
76 enum error_on_off get_on(void) { return(on); }
77 void set_on(enum error_on_off val);
79 enum error_type get_type(void);
80 char *get_type_name(void);
81 //char *get_name(void);
84 extern class cl_error_class error_class_base;
87 class cl_commander; //forward
89 class cl_error: public cl_base
92 class cl_error_class *classification;
94 bool inst; // Occured during instruction execution
95 t_addr PC; // Address of the instruction
98 virtual ~cl_error(void);
99 virtual int init(void);
102 virtual enum error_type get_type(void);
103 virtual enum error_on_off get_on(void);
104 virtual bool is_on(void);
105 virtual class cl_error_class *get_class(void) { return(classification); }
107 virtual void print(class cl_commander *c);
108 virtual char *get_type_name();
114 /* End of sim.src/errorcl.h */