From e4a81688639723aacb247735985ed59d81c95a98 Mon Sep 17 00:00:00 2001 From: cag-uconn Date: Sat, 7 Oct 2023 17:11:18 -0400 Subject: [PATCH] . --- pa2/src/sim_core.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pa2/src/sim_core.c b/pa2/src/sim_core.c index 060f35f..5cd4655 100644 --- a/pa2/src/sim_core.c +++ b/pa2/src/sim_core.c @@ -41,10 +41,10 @@ int forwarding_enabled = 0; const struct State nop = {.inst = 0x0000000013}; /* Initialize pipeline state */ -struct State fetch_out = nop, fetch_out_n; -struct State decode_out = nop, decode_out_n; -struct State ex_out = nop, ex_out_n; -struct State mem_out = nop, mem_out_n; +struct State fetch_out, fetch_out_n; +struct State decode_out, decode_out_n; +struct State ex_out, ex_out_n; +struct State mem_out, mem_out_n; /* Count all non-nop instructions */ int instruction_counter = 0; @@ -165,6 +165,12 @@ void initialize(FILE *fp) { exit(1); } + /* Initialize the starting states */ + fetch_out = nop; + decode_out = nop; + ex_out = nop; + mem_out = nop; + /* Zero initialize registers */ memset(registers, 0, sizeof(registers)); printf("Initialized Registers\n");