bug on SLLI
This commit is contained in:
		
							parent
							
								
									0cd34f9f3b
								
							
						
					
					
						commit
						6726b59c3c
					
				|  | @ -360,6 +360,10 @@ public: | |||
|     m_instr.range(19,12) = aux.range(19,12); | ||||
|   } | ||||
| 
 | ||||
|   inline int32_t get_shamt() { | ||||
|     return m_instr.range(25, 20); | ||||
|   } | ||||
| 
 | ||||
|   inline int32_t get_csr() { | ||||
|     int32_t aux = 0; | ||||
| 
 | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ | |||
| #define WARL_M_EXTENSION (1 << 12) | ||||
| #define WARL_C_EXTENSION (1 << 2) | ||||
| #define WARL_I_BASE (1 << 8) | ||||
| #define WARL_MXL (1 << 29) | ||||
| #define WARL_MXL (1 << 30) | ||||
| 
 | ||||
| 
 | ||||
| #define CSR_MSTATUS (0x300) | ||||
|  |  | |||
|  | @ -542,10 +542,11 @@ void Execute::SLLI(Instruction &inst) { | |||
| 
 | ||||
|   rd = inst.get_rd(); | ||||
|   rs1 = inst.get_rs1(); | ||||
|   rs2 = inst.get_rs2(); | ||||
|   rs2 = inst.get_shamt(); | ||||
| 
 | ||||
|   if (rs2 >= 0x20) { | ||||
|     // raise an exception, but how?
 | ||||
|     cout << "ILEGAL INSTRUCTION, shamt[5] != 0" << endl; | ||||
|   } | ||||
| 
 | ||||
|   shift = rs2 & 0x1F; | ||||
|  | @ -555,7 +556,7 @@ void Execute::SLLI(Instruction &inst) { | |||
| 
 | ||||
|   log->SC_log(Log::INFO) << "SLLI: x" | ||||
|           << rs1 << " << " << shift << " -> x" | ||||
|           << rd  << endl; | ||||
|           << rd << "(0x" << hex << calc << ")" << endl; | ||||
| } | ||||
| 
 | ||||
| void Execute::SRLI(Instruction &inst) { | ||||
|  |  | |||
|  | @ -94,6 +94,6 @@ void Registers::setCSR(int csr, uint32_t value) { | |||
| } | ||||
| 
 | ||||
| void Registers::initCSR() { | ||||
|   CSR[0x301] = WARL_MXL | WARL_M_EXTENSION | WARL_C_EXTENSION | WARL_I_BASE; | ||||
|   CSR[CSR_MISA] = WARL_MXL | WARL_M_EXTENSION | WARL_C_EXTENSION | WARL_I_BASE; | ||||
| 
 | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue