diff --git a/.gitignore b/.gitignore index 8a7b0136d824f8609f49564b9fb61c48ec728ab0..4a864ef687a3d0450986ab7500b71ba85fa18034 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,23 @@ -# Do not track local environment settings/solution. -.vscode/ +# Do not track local environment settings. +.env/ +.venv/ .idea/ .vs/ +.vscode/ +env/ +venv/ # Ignore compiled files. *.out .csim_results + + +# Do not track python cache files. +*.pyc + + +# Do not track local environment logs. +*.log +*.log.* diff --git a/main.c b/main.c deleted file mode 100644 index 81b8d73a62b8dc8fe85ad9952b3b8f535886fb68..0000000000000000000000000000000000000000 --- a/main.c +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Date: 02-28-20 - * Class: CS 5541 - * Assignment: Cache Simulator - * Author: Brandon Rodriguez - * Email: bfp5870@wmich.edu - * - * - * Simulates system use of a cache for data storage. - */ - - -// Import headers. -#include <ctype.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - - -// Constant Defines. - - -// Variable Declaration. - - -// Method Declaration. - - -/** - * Program's main. - * Initializes and runs program. - */ -int main(int argc, char* argv[]) { - printf("Starting program.\n"); - - printf("\n\nTerminating program.\n"); -} diff --git a/main.py b/main.py new file mode 100644 index 0000000000000000000000000000000000000000..0f8ff2b58844a2507b6030032cb34337c693e335 --- /dev/null +++ b/main.py @@ -0,0 +1,33 @@ +""" +Date: 02-28-20 +Class: CS 5541 +Assignment: Cache Simulator +Author: Brandon Rodriguez +Email: bfp5870@wmich.edu + + +Simulates system use of a cache for data storage. +Cache Settings Arguments: + * S: Number of sets in cache. + * E: Lines per set. + * B: Block size (number of bits per block). +""" + +# System Imports. + +# User Imports. + + +def main(): + """ + Program main. + """ + pass + + +if __name__ == '__main__': + print('Starting program.') + + main() + + print('Terminating program.') diff --git a/makefile b/makefile deleted file mode 100644 index bd2568aed1d28e23f307dd7dcf88390348d675ee..0000000000000000000000000000000000000000 --- a/makefile +++ /dev/null @@ -1,42 +0,0 @@ - -# Tell makefile to use commands defined here, if file with same name exists. -.PHONY: all compile run valgrind clean -# Set default if none is specified. -default: valgrind clean - - -# Fully build and execute project. -all: compile run clean - - -# Compile program. -compile: - gcc -Wall -Wpedantic -std=c99 *.c - - -# Compile and run program. -run: compile - ./a.out - - -# Compile program and run with valgrind (memory checking). -valgrind: compile - valgrind --leak-check=full ./a.out - - -# Clean up directory. -clean: - @rm -f *.o - @rm -f a.out - - -# Display help output. -help: - @echo "Default: Executes \"valgrind\", then \"clean\"." - @echo "" - @echo "Available Commands:" - @echo " all - Executes \"run\", then \"clean\"." - @echo " compile - Compiles program to \"a.out\"." - @echo " run - Compiles program to \"a.out\". Then run." - @echo " valgrind - Compiles program to \"a.out\". Then run with memory error checking." - @echo " clean - Remove temporary/compiled files from directory." diff --git a/run.sh b/run.sh index 2439b652ccf6172dfd82386f7f66abdd71a02046..cb95844ca92785ac9e40488995cb8e8d616b4a47 100755 --- a/run.sh +++ b/run.sh @@ -59,9 +59,6 @@ function execute_single_file () { echo -e "${color_blue}Found input file \"$file\". Attempting to compile C code.${color_reset}" - # Attempt to compile C code. - make compile - # Run input file on example cache simulator file. echo "" echo -e "${color_blue}Running input file on \"wmucachelab/csim-ref\". Runtime args:${color_reset}" @@ -72,10 +69,7 @@ function execute_single_file () { echo "" echo -e "${color_blue}Running input file on compiled C code. Runtime args:${color_reset}" echo -e "${color_blue} -v -s 4 -E 1 -b 4 -t $file${color_reset}" - ./a.out -v -s 4 -E 1 -b 4 -t $file - - # Clean up directory. - make clean + python3 main.py -v -s 4 -E 1 -b 4 -t $file else echo -e "${color_red}Failed to determine absolute path for input file.${color_reset}"