Hi all,
I am using m5 to implement a DataFlow-like architecture. 
I am having a weird Segmentation Fault when I insert an instruction in a
wire. I can send a bunch of instructions before this one with no problem,
and after a little bit I get a Segmentation Fault.
This is part of the code that I am using, and the function that generates
the error (RefCounted::decref()).

In my design I store a bunch of instructions (usually a Basic Block) in a
wire and move them to the next pipeline stage. I advance the Queue when the
next stage receives and stores the instructions in its own local buffer, is
there anything else I need to do?

Thanks!
-Andrea


Code that causes Segmentation Fault (fetch_impl.hh):

    //tg_units[index_tg_unit]->getFetchQueue()->insts[toDecode->size++] =
instruction;
    //toDecode->insts[toDecode->size++] = instruction;
    typename TimeBuffer<FetchStruct>::wire toTGUnitDecode =
tg_units[index_tg_unit]->getOutputWire();
    toTGUnitDecode->insts[toTGUnitDecode->size++] = instruction; // <- This
function breaks



-----------------------------------------------------------
Output:

...
FullO3CPU: Ticking main, FullO3CPU.
 301000: system.cpu.fetch: Running stage.
 301000: system.cpu.fetch: Attempting to fetch from [tid:0]
 301000: system.cpu.fetch: [tid:0]: Adding instructions to queue to decode.
 301000: system.cpu.fetch: [tid:0]: Instruction PC 0x409a73 (0) created
[sn:95].
 301000: system.cpu.fetch: [tid:0]: Instruction is:   ADD_R_I : limm   t1,
0x8
 301000: system.cpu.fetch: [tid:0]: Instruction PC 0x409a73 (1) created
[sn:96].
 301000: system.cpu.fetch: [tid:0]: Instruction is:   ADD_R_I : add   rdi,
rdi, t1
Segmentation fault

-----------------------------------------------------------

Function that breaks:

28 RefCounted::decref() refcnt.hh:51 0x000000000040a8cc 

Code:

void decref() { if (--count <= 0) delete this; }
_______________________________________________
m5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/m5-users

Reply via email to