Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Omer Khan authored and Omer Khan committed Oct 31, 2020
1 parent 1ee1727 commit 20606e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions pa3/simulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pa3/simulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 20606e8

Please sign in to comment.