From 1ff268ab13dd299c4cdc1e379df5397bd6a394e3 Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Fri, 3 Jan 2014 19:05:10 +0100 Subject: Added simulator monitor tool. --- csim/main.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'csim/main.c') diff --git a/csim/main.c b/csim/main.c index 5689cb4..2a88fbc 100644 --- a/csim/main.c +++ b/csim/main.c @@ -14,18 +14,18 @@ void usage() { - printf ("\nUsage:\n\tcsim [options] \n\n"); - printf("Available options:\n"); - printf("\n -rom \n\tLoad a filename as a ROM file for the machine\n"); - printf("\tA given ROM file is used for all ROM chips with variable name having given prefix\n"); - printf("\n -n \n\tOnly run #steps steps of simulation (0 = infinity)\n"); - printf("\n -in \n\tRead inputs from given file (eg. named pipe). Defaults to STDIN.\n"); - printf("\n -out \n\tWrite outputs to given file (eg. named pipe). Defaults to STDOut.\n"); + fprintf(stderr, "\nUsage:\n\tcsim [options] \n\n"); + fprintf(stderr, "Available options:\n"); + fprintf(stderr, "\n -rom \n\tLoad a filename as a ROM file for the machine\n"); + fprintf(stderr, "\tA given ROM file is used for all ROM chips with variable name having given prefix\n"); + fprintf(stderr, "\n -n \n\tOnly run #steps steps of simulation (0 = infinity)\n"); + fprintf(stderr, "\n -in \n\tRead inputs from given file (eg. named pipe). Defaults to STDIN.\n"); + fprintf(stderr, "\n -out \n\tWrite outputs to given file (eg. named pipe). Defaults to STDOUT.\n"); exit(1); } // Arguments to be parsed -int steps = 12; +int steps = 0; char *filename = NULL; char *infile = NULL; char *outfile = NULL; @@ -88,6 +88,7 @@ int main(int argc, char **argv) { // Run t_machine *machine = init_machine(program); + machine_banner(machine, output); i = 0; while (i < steps || steps == 0) { read_inputs(machine, input); -- cgit v1.2.3