Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
.
  • Loading branch information
cag-uconn committed Oct 7, 2023
1 parent b5cb1e8 commit e4a8168
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pa2/src/sim_core.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit e4a8168

Please sign in to comment.