Is the instruction doing the writing marked as isSerialAfter or
isSquashAfter? It's quite possible that by the time the code has updated
the value in the thread context the next instruction has already read
it's source?
Ali
On 05.06.2012 14:59, Joel Hestness wrote:
> Hey
guys,
> I'm running into an issue which appears as though pseudo
instructions are
> being reordered and causing their return values to be
incorrect
> (untimely). I've simplified the problem down to running the
following code
> in the simulated system (x86, single-core, O3CPU):
>
>
op_params_t call_params;
> call_params.arg[0] = ptr;
>
call_params.return_value = 0;
> m5_mal(&call_params);
> printf("Return:
%dn", call_params.return_value);
>
> The m5_mal call is just a couple
x86 assembly instructions like the other
> existing magic instructions.
The simulator, when handling this magic
> instruction, updates the
return value by writing into the simulated
> system's memory at the
call_params.return_value address, and I can trace
> that it's writing
the correct value in the correct location.
>
> Looking at an Exec trace
suggests that the tick that the magic
> instruction is being executed is
actually after the instructions
> surrounding it by almost 300
cycles...
>
-----------------------------------------------------------------
>
136195500: system.cpu T0 : 0x40cccf.0 : CALL_NEAR_I : limm t1, 0xc4c :
>
IntAlu : D=0x0000000000000c4c
> 136195500: system.cpu T0 : 0x40cccf.1 :
CALL_NEAR_I : rdip t7,
> %ctrl153, : IntAlu : D=0x000000000040ccd4
>
136195500: system.cpu T0 : 0x40cccf.2 : CALL_NEAR_I : st t7, SS:[rsp +
>
0xfffffffffffffff8] : MemWrite : D=0x000000000040ccd4 A=0x7fffffffebd8
>
136195500: system.cpu T0 : 0x40cccf.3 : CALL_NEAR_I : subi rsp, rsp,
>
0x8 : IntAlu : D=0x00007fffffffebd8
> 136195500: system.cpu T0 :
0x40cccf.4 : CALL_NEAR_I : wrip , t7, t1 :
> IntAlu :
> *136354000:*
global: gem5 faked syscall: malloc(ptr = 6e7070) *<<
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev