mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	add speculative exception for compressed instructions
This commit is contained in:
		
							parent
							
								
									27142f0fef
								
							
						
					
					
						commit
						0befdfacec
					
				@ -130,6 +130,6 @@ add wave /testbench_busybear/InstrWName
 | 
				
			|||||||
#set DefaultRadix hexadecimal
 | 
					#set DefaultRadix hexadecimal
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#-- Run the Simulation 
 | 
					#-- Run the Simulation 
 | 
				
			||||||
run 2220
 | 
					run 2630
 | 
				
			||||||
#run -all
 | 
					#run -all
 | 
				
			||||||
##quit
 | 
					##quit
 | 
				
			||||||
 | 
				
			|||||||
@ -163,15 +163,22 @@ module testbench_busybear();
 | 
				
			|||||||
      scan_file_PC = $fscanf(data_file_PC, "%x\n", InstrF);
 | 
					      scan_file_PC = $fscanf(data_file_PC, "%x\n", InstrF);
 | 
				
			||||||
      // then expected PC value
 | 
					      // then expected PC value
 | 
				
			||||||
      scan_file_PC = $fscanf(data_file_PC, "%x\n", pcExpected);
 | 
					      scan_file_PC = $fscanf(data_file_PC, "%x\n", pcExpected);
 | 
				
			||||||
      if (instrs > 175 || instrs % 10 == 0) begin
 | 
					      if (instrs < 10 || (instrs < 100 && instrs % 10 == 0) ||
 | 
				
			||||||
 | 
					        (instrs < 1000 && instrs % 50 == 0) || instrs > 205) begin
 | 
				
			||||||
        $display("loaded %0d instructions", instrs);
 | 
					        $display("loaded %0d instructions", instrs);
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
      instrs += 1;
 | 
					      instrs += 1;
 | 
				
			||||||
      // are we at a branch/jump?
 | 
					      // are we at a branch/jump?
 | 
				
			||||||
      case (lastInstrF[6:0]) //todo: add C versions of these
 | 
					      casex (lastInstrF[15:0]) 
 | 
				
			||||||
        7'b1101111, //JAL
 | 
					        16'bXXXXXXXXX1101111, // JAL
 | 
				
			||||||
        7'b1100111, //JALR
 | 
					        16'bXXXXXXXXX1100111, // JALR
 | 
				
			||||||
        7'b1100011: //B
 | 
					        16'bXXXXXXXXX1100011, // B
 | 
				
			||||||
 | 
					        16'b101XXXXXXXXXXX01: // C.J
 | 
				
			||||||
 | 
					          speculative = 1;
 | 
				
			||||||
 | 
					        16'b1001000000000010: // C.EBREAK:
 | 
				
			||||||
 | 
					          speculative = 0; // tbh don't really know what should happen here
 | 
				
			||||||
 | 
					        16'b1000XXXXX0000010, // C.JR
 | 
				
			||||||
 | 
					        16'b1001XXXXX0000010: // C.JALR //this is RV64 only so no C.JAL
 | 
				
			||||||
          speculative = 1;
 | 
					          speculative = 1;
 | 
				
			||||||
        default:
 | 
					        default:
 | 
				
			||||||
          speculative = 0;
 | 
					          speculative = 0;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user