Commits

David Lin  committed 65139f6

...

  • Participants
  • Parent commits e3f3daf

Comments (0)

Files changed (7)

File project2/code/CPU.v

   // Stage IF
   
   ProgramCounter PC (
-    .clock_i(clock_i), .reset_i(reset_i), .run_i(pc_run && !MEM_stall),
+    .clock_i(clock_i), .reset_i(reset_i), .run_i(pc_run & !MEM_stall),
     .pc_i(pc_next),
     .pc_o()
   );
   );
   
   // 
-  wire IF_Buf_write = ID_Hazard.IF_ID_Write_o && !MEM_stall;
+  wire IF_Buf_write = ID_Hazard.IF_ID_Write_o & !MEM_stall;
   wire IF_Buf_clear = pc_flush;
   
   // Instruction Buffer
     .p1_MemRead_i(M_memread),
     .p1_MemWrite_i(M_memwrite),
     .p1_data_o(M_memdata_o),
-    .p1_stall_o(MEM_stall)
+    .p1_stall_o()
   );
   
+  assign MEM_stall = 0; //dcache.p1_stall_o;
+  
 `else
   
   DataMemory_dbg DMem (

File project2/code/Data_Memory.v

File contents unchanged.

File project2/code/Defs.v

 `define ALUCTRL_OR     3'b011
 `define ALUCTRL_MUL    3'b100
 
-//`define USE_CACHE
+`define USE_CACHE 1
 

File project2/code/TestBench.v

 		CPU.dcache.dcache_tag_sram.memory[i] = 24'b0;
 		CPU.dcache.dcache_data_sram.memory[i] = 256'b0;
 	end
+`else
 `endif
 	
 	// initialize Register File

File project2/code/dcache_data_sram.v

File contents unchanged.

File project2/code/dcache_tag_sram.v

File contents unchanged.

File project2/code/dcache_top.v

File contents unchanged.