[ucsim] Update email and file info, fix stm8 flash controller
[sdcc.git] / sdcc / sim / ucsim / src / core / sim.src / vcdcl.h
blobcbd3a7c75a6713e519fbb2a462fc37da7cef8891
1 /*
2 * Simulator of microcontrollers (vcdcl.h)
4 * Copyright (C) 2017 Drotos Daniel
5 *
6 * To contact author send email to dr.dkdb@gmail.com
8 */
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
25 02111-1307, USA. */
26 /*@1@*/
28 #ifndef VCDCL_HEADER
29 #define VCDCL_HEADER
31 #include "hwcl.h"
34 class cl_vcd_var;
36 class cl_vcd: public cl_hw
38 private:
39 char var_id;
40 char *filename;
41 FILE *fd;
42 class cl_vcd_var *vars;
43 double starttime, timescale, event, pausetime;
44 int state;
45 bool started, paused, dobreak;
46 chars modul;
47 char word[64];
49 public:
50 cl_vcd(class cl_uc *auc, int aid, chars aid_string);
51 int init(void);
53 inline bool is_running(void) const { return started && !paused; }
55 inline char get_next_var_id(void) { return var_id++; }
57 virtual bool set_cmd(class cl_cmdline *cmdline, class cl_console_base *con);
58 virtual void set_help(class cl_console_base *con);
60 virtual int tick(int cycles);
62 virtual void report(class cl_vcd_var *var, t_mem v);
63 virtual void print_info(class cl_console_base *con);
65 private:
66 inline void reset_next_var_id(void) { var_id = 33; }
67 void add_var(class cl_console_base *con, class cl_memory_cell *cell, int bitnr_low, int bitnr_high)
69 add_var(con, 0, cell, bitnr_low, bitnr_high);
71 void add_var(class cl_console_base *con, char id, class cl_memory_cell *cell, int bitnr_low, int bitnr_high);
72 void add_var(class cl_console_base *con, class cl_memory *m, t_addr a, int bitnr_low, int bitnr_high);
73 void del_var(class cl_console_base *con, class cl_memory_cell *cell, int bitnr_low, int bitnr_high);
74 void del_var(class cl_console_base *con, class cl_memory *m, t_addr a, int bitnr_low, int bitnr_high);
76 FILE *open_vcd(class cl_console_base *con);
77 void close_vcd(void);
79 bool read_word(unsigned int i);
80 void clear_vars(void);
81 bool parse_header(cl_console_base *con);
85 #endif
87 /* End of sim.src/vcdcl.h */