From 20606e83c4053250672a6cc8755ebb2750495eee Mon Sep 17 00:00:00 2001 From: Omer Khan Date: Fri, 30 Oct 2020 20:43:33 -0400 Subject: [PATCH] . --- pa3/simulator.c | 9 +++++++-- pa3/simulator.h | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pa3/simulator.c b/pa3/simulator.c index 9b4856d..a47fca4 100644 --- a/pa3/simulator.c +++ b/pa3/simulator.c @@ -13,7 +13,7 @@ int pipe_trace = 1; int forwarding_enabled = 1; int cache_enabled = 1; int cycles_to_access_dmem = 10; -int cycles_to_exe = 1; +int cycles_to_exe = 5; static FILE *fptr_pt; @@ -142,6 +142,11 @@ void process_instructions() { // add code here to hold fetch, decode, execute and memory stages! + } + else if (exe_busy == 1) { + + // add code here to hold fetch, decode, and execute stages! + } else { pc = pc_n; @@ -152,7 +157,7 @@ void process_instructions() { } cycle++; - + fflush(fptr_pt); }//while pc loop printf("\n TOTAL %d INSTRUCTIONS EXECUTED IN %d CYCLES", instruction_counter, cycle); } //process_instruction diff --git a/pa3/simulator.h b/pa3/simulator.h index 743aeaa..40a3cf9 100644 --- a/pa3/simulator.h +++ b/pa3/simulator.h @@ -64,7 +64,7 @@ int dmem_cycles = 0; int exe_busy = 0; int exe_cycles = 1; -#define NUM_LINES 16 // 1024 bytes (cache size) / 64 bytes (block size) +#define NUM_LINES 32 // 1024 bytes (cache size) / 64 bytes (block size) typedef struct { int valid;