/* Author : Rick van der Zwet * S-number : 0433373 * Version : $Id: memory.h 363 2007-12-03 06:07:31Z rick $ * Copyright : FreeBSD Licence * Description : Computation main */ #include #include #include #include #include "memory_std.h" #include "memory_bank.h" #include "memory_dram.h" void usage(char *argv[]) { fprintf(stderr, "%s \n", argv[0]); fprintf(stderr, " = [12345]\n"); exit(EX_USAGE); } int main(int argc, char *argv[]) { if (argc < 2) usage(argv); switch (argv[1][0]) { case '1': memory_std(8); break; case '2': memory_bank(4, 8); break; case '3': memory_bank(8, 8); break; case '4': memory_dram(64, 3, 8); break; case '5': memory_dram(1024, 2, 8); break; default: fprintf(stderr, "Argument invalid: '%s'\n", argv[1]); usage(argv); } exit(EX_OK); }