diff options
author | Alex AUVOLAT <alex.auvolat@ens.fr> | 2014-01-09 16:02:56 +0100 |
---|---|---|
committer | Alex AUVOLAT <alex.auvolat@ens.fr> | 2014-01-09 16:02:56 +0100 |
commit | 35e0c0f16f58a7503045de5e047e029dd06983a2 (patch) | |
tree | c2cf5661ae346644cb1c3eee7aeb2eb9edabffc6 /csim | |
parent | f8c7333c7045ee9e4dae38933c29c6db12dd2501 (diff) | |
download | SystDigit-Projet-35e0c0f16f58a7503045de5e047e029dd06983a2.tar.gz SystDigit-Projet-35e0c0f16f58a7503045de5e047e029dd06983a2.zip |
Added FEED/FED signals in protocol.
Diffstat (limited to 'csim')
-rw-r--r-- | csim/sim.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -74,6 +74,13 @@ void read_inputs(t_machine *m, FILE *stream) { t_id var; t_program *p = m->prog; + int magic; + fscanf(stream, " %x", &magic); + if (magic != 0xFEED) { + fprintf(stderr, "(simulator) Protocol error.\n"); + exit(1); + } + if (p->n_inputs == 0) return; // nothing to do for (i = 0; i < p->n_inputs; i++) { @@ -213,6 +220,8 @@ void write_outputs(t_machine *m, FILE *stream) { t_value v, mask; t_program *p = m->prog; + fprintf(stream, "FED\n"); + for (i = 0; i < p->n_outputs; i++) { var = p->outputs[i]; fprintf(stream, "%s\t", p->vars[var].name); |