diff options
author | Alex AUVOLAT <alex.auvolat@ens.fr> | 2014-01-03 19:05:10 +0100 |
---|---|---|
committer | Alex AUVOLAT <alex.auvolat@ens.fr> | 2014-01-03 19:05:10 +0100 |
commit | 1ff268ab13dd299c4cdc1e379df5397bd6a394e3 (patch) | |
tree | 014db93062f26cdfe2d2639fd833afd554e94a66 /monitor/mon.h | |
parent | c46fe12e47c405fbb03f0c93121402d873bc470e (diff) | |
download | SystDigit-Projet-1ff268ab13dd299c4cdc1e379df5397bd6a394e3.tar.gz SystDigit-Projet-1ff268ab13dd299c4cdc1e379df5397bd6a394e3.zip |
Added simulator monitor tool.
Diffstat (limited to 'monitor/mon.h')
-rw-r--r-- | monitor/mon.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/monitor/mon.h b/monitor/mon.h new file mode 100644 index 0000000..e08f01c --- /dev/null +++ b/monitor/mon.h @@ -0,0 +1,54 @@ +#ifndef DEF_MON_H +#define DEF_MON_H + +#include <time.h> +#include <stdio.h> +#include <curses.h> + +typedef unsigned long long int t_value; + +typedef struct { + char name[32]; + char v_bin[32]; + t_value v_int; +} t_output; + +typedef struct { + char name[32]; + int size; + char value[32]; +} t_input; + +typedef enum { + MS_FINISH, + MS_RUN, + MS_AUTO +} t_status; + +typedef struct { + FILE *to_sim, *from_sim; + + int n_inputs, n_outputs; + t_input *inputs; + t_output *outputs; + + int step; + + t_status status; + + time_t clk; +} t_mon; + +void disp_init(); +void disp_display(t_mon *mon); +void disp_finish(); + +void handle_kbd(t_mon *mon); + +int mon_read_prologue(t_mon *mon); // nonzero on error +void mon_step(t_mon *mon); +void mon_loop(t_mon *mon); + +void mon_handle_command(t_mon *mon, char *c); + +#endif |