URL
https://opencores.org/ocsvn/or1k_old/or1k_old/trunk
Subversion Repositories or1k_old
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 604 to Rev 605
- ↔ Reverse comparison
Rev 604 → Rev 605
/trunk/or1ksim/cpu/or32/execute.c
343,8 → 343,6
set_mem32(op[op_no], value, breakpoint); |
} else if (op[op_no + MAX_OPERANDS] & OPTYPE_REG) { |
set_reg32(op[op_no], value); |
/* TODO: OV incorrect */ |
value & 0x80000000 ? setsprbits (SPR_SR, SPR_SR_OV, 1) : setsprbits (SPR_SR, SPR_SR_OV, 0); |
} else { |
fprintf (stderr, "Invalid operand type.\n"); |
exit (1); |
386,6 → 384,13
} |
} |
|
/* Sets a new SPR_SR_OV value, based on next register value */ |
static inline unsigned long set_ov_flag (unsigned long value) |
{ |
value & 0x80000000 ? setsprbits (SPR_SR, SPR_SR_OV, 1) : setsprbits (SPR_SR, SPR_SR_OV, 0); |
return value; |
} |
|
/* Modified by CZ 26/05/01 for new mode execution */ |
/* Fetch returns nonzero if instruction should NOT be executed. */ |
static inline int fetch() |
652,6 → 657,7
IFF (config.cpu.dependstats) cur->func_unit = it_arith; |
temp1 = (signed long)eval_operand32(2, &breakpoint)+(signed long)eval_operand32(1, &breakpoint); |
set_operand32(0, temp1, &breakpoint); |
set_ov_flag (temp1); |
|
temp4 = temp1; |
if (temp4 == temp1) |
715,19 → 721,19
} |
void l_and() { |
IFF (config.cpu.dependstats) cur->func_unit = it_arith; |
set_operand32(0, eval_operand32(1, &breakpoint) & (unsigned)eval_operand32(2, &breakpoint), &breakpoint); |
set_operand32(0, set_ov_flag (eval_operand32(1, &breakpoint) & (unsigned)eval_operand32(2, &breakpoint)), &breakpoint); |
} |
void l_or() { |
IFF (config.cpu.dependstats) cur->func_unit = it_arith; |
set_operand32(0, eval_operand32(1, &breakpoint) | (unsigned)eval_operand32(2, &breakpoint), &breakpoint); |
set_operand32(0, set_ov_flag (eval_operand32(1, &breakpoint) | (unsigned)eval_operand32(2, &breakpoint)), &breakpoint); |
} |
void l_xor() { |
IFF (config.cpu.dependstats) cur->func_unit = it_arith; |
set_operand32(0, eval_operand32(1, &breakpoint) ^ (signed)eval_operand32(2, &breakpoint), &breakpoint); |
set_operand32(0, set_ov_flag (eval_operand32(1, &breakpoint) ^ (signed)eval_operand32(2, &breakpoint)), &breakpoint); |
} |
void l_sub() { |
IFF (config.cpu.dependstats) cur->func_unit = it_arith; |
set_operand32(0, (signed long)eval_operand32(1, &breakpoint) - (signed long)eval_operand32(2, &breakpoint), &breakpoint); |
set_operand32(0, set_ov_flag ((signed long)eval_operand32(1, &breakpoint) - (signed long)eval_operand32(2, &breakpoint)), &breakpoint); |
} |
/*int mcount = 0;*/ |
void l_mul() { |
734,7 → 740,7
signed long temp3, temp2, temp1; |
|
IFF (config.cpu.dependstats) cur->func_unit = it_arith; |
set_operand32(0, (signed long)eval_operand32(1, &breakpoint) * (signed long)eval_operand32(2, &breakpoint), &breakpoint); |
set_operand32(0, set_ov_flag ((signed long)eval_operand32(1, &breakpoint) * (signed long)eval_operand32(2, &breakpoint)), &breakpoint); |
/*if (!(mcount++ & 1023)) { |
printf ("[%i]\n",mcount); |
}*/ |
751,7 → 757,7
except_handle(EXCEPT_ILLEGAL, iqueue[0].insn_addr); |
return; |
} |
set_operand32(0, temp1, &breakpoint); |
set_operand32(0, set_ov_flag (temp1), &breakpoint); |
} |
void l_divu() { |
unsigned long temp3, temp2, temp1; |
761,7 → 767,7
temp2 = eval_operand32(1, &breakpoint); |
temp1 = temp2 / temp3; |
/* cycles += 16; */ |
set_operand32(0, temp1, &breakpoint); |
set_operand32(0, set_ov_flag (temp1), &breakpoint); |
} |
void l_sll() { |
int sign = 1; |
769,7 → 775,7
if ((signed)eval_operand32(1, &breakpoint) < 0) |
sign = -1; |
/* cycles += 2; */ |
set_operand32(0, eval_operand32(1, &breakpoint) << eval_operand32(2, &breakpoint), &breakpoint); |
set_operand32(0, set_ov_flag (eval_operand32(1, &breakpoint) << eval_operand32(2, &breakpoint)), &breakpoint); |
} |
void l_sra() { |
unsigned long sign = 0; |
778,12 → 784,12
if ((signed)eval_operand32(1, &breakpoint) < 0) |
sign = -1; |
/* cycles += 2; */ |
set_operand32(0, (signed)eval_operand32(1, &breakpoint) >> eval_operand32(2, &breakpoint), &breakpoint); |
set_operand32(0, set_ov_flag ((signed)eval_operand32(1, &breakpoint) >> eval_operand32(2, &breakpoint)), &breakpoint); |
} |
void l_srl() { |
IFF (config.cpu.dependstats) cur->func_unit = it_shift; |
/* cycles += 2; */ |
set_operand32(0, eval_operand32(1, &breakpoint) >> eval_operand32(2, &breakpoint), &breakpoint); |
set_operand32(0, set_ov_flag (eval_operand32(1, &breakpoint) >> eval_operand32(2, &breakpoint)), &breakpoint); |
} |
void l_bf() { |
if (config.bpb.enabled) { |
/trunk/or1ksim/toplevel.c
51,7 → 51,7
#include "coff.h" |
|
/* CVS revision number. */ |
const char rcsrev[] = "$Revision: 1.70 $"; |
const char rcsrev[] = "$Revision: 1.71 $"; |
|
/* Continuos run versus single step tracing switch. */ |
int cont_run; |
650,8 → 650,10
if(config.debug.gdb_enabled) { |
BlockJTAG(); |
HandleServerSocket(false); |
} else |
fprintf (stderr, "WARNING: CPU stalled and gdb connection not enabled."); |
} else { |
fprintf (stderr, "WARNING: CPU stalled and gdb connection not enabled."); |
cont_run = 0; |
} |
continue; |
} |
} |