Hi all,
this is the first time I write here, so apologize me in advance if this
question is not the kind of questions you ask here :) Besides, I'm not an
expert on the internal workings of GEM5, so I want to ask you guys:
if I open the generated file build/ARM/arch/arm/generated/exec-ns.cc.inc
and then go to the function MicroNeonLoad64,the data type union MemUnion is
defined:
const int MaxNumBytes = 16;
union MemUnion {
uint8_t bytes[MaxNumBytes];
uint32_t floatRegBits[MaxNumBytes / 4];
};
Some lines below that, we declare memUnion of type MemUnion, and initialize
only the first 8 bytes by calling readMem (accSize is 8)
MemUnion memUnion;
uint8_t *dataPtr = memUnion.bytes;
if (fault == NoFault) {
fault = xc->readMem(EA, dataPtr, accSize, memAccessFlags);
just below that line we declare VReg x and use memUnion.floatRegBits[2] and
memUnion.floatRegBits[3] to initialize x.hi.
VReg x = {0, 0};
x.lo = (((XReg) memUnion.floatRegBits[1]) << 32) |
(XReg) memUnion.floatRegBits[0];
x.hi = (((XReg) memUnion.floatRegBits[3]) << 32) |
(XReg) memUnion.floatRegBits[2];
However, presumably, memUnion.floatRegBits[2] and memUnion.floatRegBits[3]
have not been initialized by readMem, therefore, x.hi gets random data.
The checker is complaining about this. If I add the following line just
after declaring memUnion, the problem seems to be solved.
memset(&memUnion, 0x0, sizeof(MemUnion));
Any suggestion?
Thanks,
Regards,
Alvaro.
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev