X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=sim%2Fucsim%2Fsim.src%2Fuccl.h;h=54f4f605f5ca79f9b01eac905e90b41123bddf05;hb=34d14506fd0c12ee5434fec0f9dec27753e1aab5;hp=dada96ec233ca2820c570a5d344e19dc41eb3b1a;hpb=5156ec0bb15ef639c2aa78f616a05e3ab0435813;p=fw%2Fsdcc diff --git a/sim/ucsim/sim.src/uccl.h b/sim/ucsim/sim.src/uccl.h index dada96ec..54f4f605 100644 --- a/sim/ucsim/sim.src/uccl.h +++ b/sim/ucsim/sim.src/uccl.h @@ -41,9 +41,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA /* Counter to count clock ticks */ -#define TICK_RUN 0x01 -#define TICK_INISR 0x02 -#define TICK_IDLE 0x03 +#define TICK_RUN 0x01 +#define TICK_INISR 0x02 +#define TICK_IDLE 0x03 class cl_ticker: public cl_base { @@ -53,12 +53,12 @@ public: int dir; //char *name; - cl_ticker(int adir, int in_isr, char *aname); + cl_ticker(int adir, int in_isr, const char *aname); virtual ~cl_ticker(void); virtual int tick(int nr); virtual double get_rtime(double xtal); - virtual void dump(int nr, double xtal, class cl_console *con); + virtual void dump(int nr, double xtal, class cl_console_base *con); }; @@ -77,40 +77,40 @@ public: class cl_uc: public cl_base { public: - int type; // CPU family - int technology; // CMOS, HMOS - int state; // GO, IDLE, PD + int type; // CPU family + int technology; // CMOS, HMOS + int state; // GO, IDLE, PD //class cl_list *options; class cl_xtal_option *xtal_option; - t_addr PC, instPC; // Program Counter - bool inst_exec; // Instruction is executed - class cl_ticker *ticks; // Nr of XTAL clocks - class cl_ticker *isr_ticks; // Time in ISRs - class cl_ticker *idle_ticks; // Time in idle mode - class cl_list *counters; // User definable timers (tickers) - int inst_ticks; // ticks of an instruction - double xtal; // Clock speed - - int brk_counter; // Number of breakpoints - class brk_coll *fbrk; // Collection of FETCH break-points - class brk_coll *ebrk; // Collection of EVENT breakpoints + t_addr PC, instPC; // Program Counter + bool inst_exec; // Instruction is executed + class cl_ticker *ticks; // Nr of XTAL clocks + class cl_ticker *isr_ticks; // Time in ISRs + class cl_ticker *idle_ticks; // Time in idle mode + class cl_list *counters; // User definable timers (tickers) + int inst_ticks; // ticks of an instruction + double xtal; // Clock speed + + int brk_counter; // Number of breakpoints + class brk_coll *fbrk; // Collection of FETCH break-points + class brk_coll *ebrk; // Collection of EVENT breakpoints class cl_sim *sim; //class cl_list *mems; class cl_hws *hws; - class cl_list *memchips; // v3 + class cl_list *memchips; // v3 class cl_address_space_list *address_spaces; - class cl_address_space *rom; // Required for almost every uc + class cl_address_space *rom; // Required for almost every uc //class cl_list *address_decoders; - class cl_irqs *it_sources; // Sources of interrupts - class cl_list *it_levels; // Follow interrupt services - class cl_list *stack_ops; // Track stack operations + class cl_irqs *it_sources; // Sources of interrupts + class cl_list *it_levels; // Follow interrupt services + class cl_list *stack_ops; // Track stack operations - class cl_list *errors; // Errors of instruction execution - class cl_list *events; // Events happened during inst exec + class cl_list *errors; // Errors of instruction execution + class cl_list *events; // Events happened during inst exec t_addr sp_max; t_addr sp_avg; @@ -119,7 +119,7 @@ public: cl_uc(class cl_sim *asim); virtual ~cl_uc(void); virtual int init(void); - virtual char *id_string(void); + virtual const char *id_string(void); virtual void reset(void); // making objects @@ -131,12 +131,12 @@ public: virtual void build_cmdset(class cl_cmdset *cmdset); // manipulating memories - virtual t_mem read_mem(char *id, t_addr addr); - virtual t_mem get_mem(char *id, t_addr addr); - virtual void write_mem(char *id, t_addr addr, t_mem val); - virtual void set_mem(char *id, t_addr addr, t_mem val); - virtual class cl_address_space *address_space(char *id); - virtual class cl_memory *memory(char *id); + virtual t_mem read_mem(const char *id, t_addr addr); + virtual t_mem get_mem(const char *id, t_addr addr); + virtual void write_mem(const char *id, t_addr addr, t_mem val); + virtual void set_mem(const char *id, t_addr addr, t_mem val); + virtual class cl_address_space *address_space(const char *id); + virtual class cl_memory *memory(const char *id); // file handling virtual long read_hex_file(const char *nam); @@ -192,35 +192,35 @@ public: virtual void remove_all_breaks(void); virtual int make_new_brknr(void); virtual class cl_ev_brk *mk_ebrk(enum brk_perm perm, - class cl_address_space *mem, - char op, t_addr addr, int hit); + class cl_address_space *mem, + char op, t_addr addr, int hit); virtual void check_events(void); // disassembling and symbol recognition - virtual char *disass(t_addr addr, char *sep); + virtual char *disass(t_addr addr, const char *sep); virtual struct dis_entry *dis_tbl(void); virtual struct name_entry *sfr_tbl(void); virtual struct name_entry *bit_tbl(void); - virtual void print_disass(t_addr addr, class cl_console *con); - virtual void print_regs(class cl_console *con); + virtual void print_disass(t_addr addr, class cl_console_base *con); + virtual void print_regs(class cl_console_base *con); virtual int inst_length(t_addr addr); virtual int inst_branch(t_addr addr); virtual int longest_inst(void); virtual bool get_name(t_addr addr, struct name_entry tab[], char *buf); virtual bool symbol2address(char *sym, struct name_entry tab[], - t_addr *addr); + t_addr *addr); virtual char *symbolic_bit_name(t_addr bit_address, - class cl_memory *mem, - t_addr mem_addr, - t_mem bit_mask); + class cl_memory *mem, + t_addr mem_addr, + t_mem bit_mask); /* Converting abstract address spaces into real ones */ virtual class cl_address_space *bit2mem(t_addr bitaddr, - t_addr *memaddr, - t_mem *bitmask); + t_addr *memaddr, + t_mem *bitmask); virtual t_addr bit_address(class cl_memory *mem, - t_addr mem_address, - int bit_number) { return(-1); } + t_addr mem_address, + int bit_number) { return(-1); } // messages from app to handle and broadcast virtual bool handle_event(class cl_event &event); @@ -247,17 +247,21 @@ public: class cl_error_unknown_code: public cl_error { -private: - static class cl_error_class *error_unknown_code_class; protected: class cl_uc *uc; public: cl_error_unknown_code(class cl_uc *the_uc); - virtual void print(class cl_commander *c); + virtual void print(class cl_commander_base *c); }; +class cl_uc_error_registry: public cl_error_registry +{ +public: + cl_uc_error_registry(void); +}; #endif + /* End of uccl.h */