File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -1351,28 +1351,28 @@ namespace riscv_tlm {
1351
1351
std::cout << " Simulation time " << sc_core::sc_time_stamp () << " \n " ;
1352
1352
this ->perf ->dump ();
1353
1353
1354
- this ->RaiseException (Exception_cause::CALL_FROM_M_MODE , this ->m_instr );
1354
+ this ->RaiseException (Exception_cause::BREAK , this ->m_instr );
1355
1355
1356
1356
return false ;
1357
1357
}
1358
1358
1359
1359
bool Exec_CSRRW () const {
1360
1360
unsigned int rd, rs1;
1361
1361
int csr;
1362
- unsigned_T aux;
1362
+ unsigned_T aux, aux2 ;
1363
1363
1364
1364
rd = this ->get_rd ();
1365
1365
rs1 = this ->get_rs1 ();
1366
1366
csr = get_csr ();
1367
1367
1368
- /* These operations must be atomical */
1368
+ aux = this ->regs ->getCSR (csr);
1369
+ aux2 = this ->regs ->getValue (rs1);
1370
+
1369
1371
if (rd != 0 ) {
1370
- aux = this ->regs ->getCSR (csr);
1371
1372
this ->regs ->setValue (rd, aux);
1372
1373
}
1373
1374
1374
- aux = this ->regs ->getValue (rs1);
1375
- this ->regs ->setCSR (csr, aux);
1375
+ this ->regs ->setCSR (csr, aux2);
1376
1376
1377
1377
this ->logger ->debug (" {} ns. PC: 0x{:x}. CSRRW: CSR #{:d} -> x{:d}(0x{:x})" ,
1378
1378
sc_core::sc_time_stamp ().value (),
Original file line number Diff line number Diff line change @@ -1289,7 +1289,7 @@ namespace riscv_tlm {
1289
1289
1290
1290
this ->RaiseException (Exception_cause::BREAK, this ->m_instr );
1291
1291
1292
- return true ;
1292
+ return false ;
1293
1293
}
1294
1294
1295
1295
bool exec_instruction (Instruction &inst, bool *breakpoint, op_C_Codes code) {
@@ -1388,6 +1388,7 @@ namespace riscv_tlm {
1388
1388
Exec_C_EBREAK ();
1389
1389
std::cout << " C_EBREAK" << std::endl;
1390
1390
*breakpoint = true ;
1391
+ PC_not_affected = false ;
1391
1392
break ;
1392
1393
case OP_C_LD:
1393
1394
Exec_C_LD ();
You can’t perform that action at this time.
0 commit comments