X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=sim%2Fucsim%2Fsim.src%2Fhwcl.h;h=70917db6b98061f4ecf177731d754a2ab298721c;hb=a8a7fc8a514bc79114c6d76d6a6aeb885387478c;hp=a67921e02a4e752317b67628b158df5aa4f827f5;hpb=8c8f34ff4281a55d2f535335c02999246e9e12f2;p=fw%2Fsdcc diff --git a/sim/ucsim/sim.src/hwcl.h b/sim/ucsim/sim.src/hwcl.h index a67921e0..70917db6 100644 --- a/sim/ucsim/sim.src/hwcl.h +++ b/sim/ucsim/sim.src/hwcl.h @@ -43,43 +43,49 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA enum what_to_do_on_cell_change { - wtd_none = 0x01, - wtd_write = 0x02, - wtd_restore = 0x04, - wtd_restore_write = 0x08 + wtd_none = 0x01, + wtd_write = 0x02, + wtd_restore = 0x04, + wtd_restore_write = 0x08 }; -#define WTD_WRITE (wtd_write|wtd_restore_write) -#define WTD_RESTORE (wtd_restore|wtd_restore_write) +#define WTD_WRITE (wtd_write|wtd_restore_write) +#define WTD_RESTORE (wtd_restore|wtd_restore_write) class cl_hw; // forward class cl_watched_cell: public cl_base { protected: - class cl_mem *mem; + class cl_address_space *mem; t_addr addr; - class cl_cell *cell; - class cl_cell **store; + class cl_memory_cell *cell; + class cl_memory_cell **store; public: enum what_to_do_on_cell_change wtd; public: - cl_watched_cell(class cl_mem *amem, t_addr aaddr, class cl_cell **astore, - enum what_to_do_on_cell_change awtd); - - virtual void mem_cell_changed(class cl_mem *amem, t_addr aaddr, - class cl_hw *hw); + cl_watched_cell(class cl_address_space *amem, t_addr aaddr, + class cl_memory_cell **astore, + enum what_to_do_on_cell_change awtd); + + virtual void mem_cell_changed(class cl_address_space *amem, t_addr aaddr, + class cl_hw *hw); + virtual void address_space_added(class cl_address_space *amem, + class cl_hw *hw); }; class cl_used_cell: public cl_watched_cell { public: - cl_used_cell(class cl_mem *amem, t_addr aaddr, class cl_cell **astore, - enum what_to_do_on_cell_change awtd): + cl_used_cell(class cl_address_space *amem, t_addr aaddr, + class cl_memory_cell **astore, + enum what_to_do_on_cell_change awtd): cl_watched_cell(amem, aaddr, astore, awtd) {} - /*virtual void mem_cell_changed(class cl_mem *amem, t_addr aaddr, - class cl_hw *hw);*/ + virtual void mem_cell_changed(class cl_address_space *amem, t_addr aaddr, + class cl_hw *hw); + virtual void address_space_added(class cl_address_space *amem, + class cl_hw *hw); }; class cl_hw: public cl_guiobj @@ -94,7 +100,7 @@ protected: class cl_list *partners; class cl_list *watched_cells; public: - cl_hw(class cl_uc *auc, enum hw_cath cath, int aid, char *aid_string); + cl_hw(class cl_uc *auc, enum hw_cath cath, int aid, const char *aid_string); virtual ~cl_hw(void); virtual void new_hw_adding(class cl_hw *new_hw); @@ -102,33 +108,38 @@ public: virtual void added_to_uc(void) {} virtual class cl_hw *make_partner(enum hw_cath cath, int id); - virtual t_mem read(class cl_cell *cell) { return(cell->get()); } - virtual void write(class cl_cell */*cell*/, t_mem */*val*/) {} - - virtual void set_cmd(class cl_cmdline *cmdline, class cl_console *con) {} - virtual class cl_cell *register_cell(class cl_mem *mem, t_addr addr, - class cl_cell **store, - enum what_to_do_on_cell_change awtd); - virtual class cl_cell *use_cell(class cl_mem *mem, t_addr addr, - class cl_cell **store, - enum what_to_do_on_cell_change awtd); - virtual void mem_cell_changed(class cl_mem *mem, t_addr addr); + virtual t_mem read(class cl_memory_cell *cell) { return(cell->get()); } + virtual void write(class cl_memory_cell * /*cell*/, t_mem * /*val*/) {} + + virtual void set_cmd(class cl_cmdline *cmdline, class cl_console_base *con); + virtual class cl_memory_cell *register_cell(class cl_address_space *mem, + t_addr addr, + class cl_memory_cell **store, + enum what_to_do_on_cell_change + awtd); + virtual class cl_memory_cell *use_cell(class cl_address_space *mem, + t_addr addr, + class cl_memory_cell **store, + enum what_to_do_on_cell_change awtd); + virtual void mem_cell_changed(class cl_address_space *mem, t_addr addr); + virtual void address_space_added(class cl_address_space *as); virtual int tick(int cycles); virtual void reset(void) {} - virtual void happen(class cl_hw */*where*/, enum hw_event /*he*/, - void */*params*/) {} + virtual void happen(class cl_hw * /*where*/, enum hw_event /*he*/, + void * /*params*/) {} virtual void inform_partners(enum hw_event he, void *params); - virtual void print_info(class cl_console *con); + virtual void print_info(class cl_console_base *con); }; class cl_hws: public cl_list { public: - cl_hws(void): cl_list(2, 2) {} + cl_hws(void): cl_list(2, 2, "hws") {} virtual t_index add(void *item); - virtual void mem_cell_changed(class cl_mem *mem, t_addr addr); + virtual void mem_cell_changed(class cl_address_space *mem, t_addr addr); + virtual void address_space_added(class cl_address_space *as); };