2 * Simulator of microcontrollers (vcdcl.h)
4 * Copyright (C) 2017 Drotos Daniel
6 * To contact author send email to dr.dkdb@gmail.com
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
36 class cl_vcd
: public cl_hw
42 class cl_vcd_var
*vars
;
43 double starttime
, timescale
, event
, pausetime
;
45 bool started
, paused
, dobreak
;
50 cl_vcd(class cl_uc
*auc
, int aid
, chars aid_string
);
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
);
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
);
79 bool read_word(unsigned int i
);
80 void clear_vars(void);
81 bool parse_header(cl_console_base
*con
);
87 /* End of sim.src/vcdcl.h */