#include <stdlib.h>
#include <stdio.h>
#include "cachelab.h"
void print_usage()
{
printf("Usage:\n");
exit(0);
}
int parse_int_arg(char* arg)
int i = atoi(arg);
if (i != 0)
return i;
else
exit(-1);
int main(int argc, char* argv[])
int set_bits = 0, lines = 0, block_bits = 0, verbose = 0;
char* filename;
int ii;
for (ii = 0; ii < argc; ii++)
switch (argv[ii][1])
case 'h':
//print_usage();
break;
case 'v':
verbose = 1;
case 's':
set_bits = parse_int_arg(argv[ii+1]);
case 'E':
lines = parse_int_arg(argv[ii+1]);
case 'b':
block_bits = parse_int_arg(argv[ii+1]);
case 't':
filename = argv[ii+1];
printf("Arguments: %d, %d, %d, %d, %s\n", set_bits, lines, block_bits, verbose, filename);
if(!set_bits|| !lines || !block_bits || !filename)
print_usage();
printSummary(0, 0, 0);
return 0;