IndexError: map::at

717 views
Skip to first unread message

Alec Roelke

unread,
Dec 12, 2017, 5:46:30 PM12/12/17
to gem5-alad...@googlegroups.com
Hello,

I updated my copy of gem5-Aladdin to the latest version (as of a couple of days ago, anyway), and updated my code to use the DMA interface V3, and when I run it I get this error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/ar4jc/projects/heterogeneous-codesign/gem5-aladdin/src/python/m5/main.py", line 444, in main
    exec filecode in scope
  File "../gem5-aladdin/configs/aladdin/aladdin_se.py", line 355, in <module>
    Simulation.run(options, root, system, FutureClass)
  File "/home/ar4jc/projects/heterogeneous-codesign/gem5-aladdin/configs/common/Simulation.py", line 721, in run
    exit_event = benchCheckpoints(options, maxtick, cptdir)
  File "/home/ar4jc/projects/heterogeneous-codesign/gem5-aladdin/configs/common/Simulation.py", line 279, in benchCheckpoints
    exit_event = m5.simulate(maxtick - m5.curTick())
  File "/home/ar4jc/projects/heterogeneous-codesign/gem5-aladdin/src/python/m5/simulate.py", line 174, in simulate
    return _m5.event.simulate(*args, **kwargs)
IndexError: map::at

This occurs after the scheduling phase of Aladdin, after it tells me how many total connected nodes and total connected edges there are.  What might cause this error?  It looks like it's a C++ error, but there's no indication of what C++ code threw it.

Thanks,
Alec Roelke

Sam Xi

unread,
Dec 12, 2017, 5:58:26 PM12/12/17
to Alec Roelke, gem5-alad...@googlegroups.com
Hey Alec,

This error almost always happens inside aladdin_tlb.cc. It means that something went wrong with address translation in one of the following ways:
  1. it failed to find the name of the array for an address in the trace (or vice versa).
  2. It failed to find simulation address for an address in the trace
I would suggest you check your mapArrayToAccelerator() calls to make sure that everything is consistent. In particular, be careful of the array name field - this has to be the name of the variable as it appears in the top level function.

I had originally hoped that a C++ exception would get caught by the debugger, but it looks like pybind catches instead. I've been meaning to fix this for awhile but just never got around to it.

Sam

--
You received this message because you are subscribed to the Google Groups "gem5-Aladdin users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gem5-aladdin-us...@googlegroups.com.
To post to this group, send email to gem5-alad...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gem5-aladdin-users/CAJcQFtDPqpo28ougoWxV0Qzmm-1Qq-k3DnqgooJDG%2B%3D%3Dq5VthA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
Thanks,

Sam Xi
Harvard University
Computer Science, Ph.D. Candidate

Alec Roelke

unread,
Dec 12, 2017, 6:05:32 PM12/12/17
to Sam Xi, gem5-alad...@googlegroups.com
Currently I have mapped all the arrays that the accelerator uses.  There's only one function, so that's not a problem.  There are several internal variables that that function declares, but they're not arrays; the only arrays that it uses are inputs.  I remember an old problem that I had where the arrays needed to be cache line aligned and be allocated in amounts that are multiples of the cache line size.  I didn't do that yet, but I expected to get a different error.  Is that still the case, and could it cause this exception if it is?

To unsubscribe from this group and stop receiving emails from it, send an email to gem5-aladdin-users+unsub...@googlegroups.com.
To post to this group, send email to gem5-aladdin-users@googlegroups.com.

Sam Xi

unread,
Dec 12, 2017, 6:08:47 PM12/12/17
to Alec Roelke, gem5-alad...@googlegroups.com
When you updated gem5-aladdin, did you also update the tracer? The tracer will now add some additional information to help identify the base address, as well as support for incremental compilation.

If you don't align the arrays at cacheline granularity, and you try to use DMA, you will either get errors in the form of the output being incorrect, or a glibc error (double free, memory corruption, etc).

To unsubscribe from this group and stop receiving emails from it, send an email to gem5-aladdin-us...@googlegroups.com.
To post to this group, send email to gem5-alad...@googlegroups.com.
--
Thanks,

Sam Xi
Harvard University
Computer Science, Ph.D. Candidate

Sam Xi

unread,
Dec 12, 2017, 6:11:15 PM12/12/17
to Alec Roelke, gem5-alad...@googlegroups.com
If that still doesn't help you, I would recommend using the debugger to pinpoint the problem. I'll prepare a few patches to help with this soon.

gdb --args <full gem5 command>
break aladdin_tlb.cc:translateTraceToSimVirtual
run

the indexerror is probably getting raised either in the call to lookupVirtualAddr() or datapath->getBaseAddress().

Alec Roelke

unread,
Dec 13, 2017, 11:43:20 AM12/13/17
to Sam Xi, gem5-alad...@googlegroups.com
It did help, thanks.  It works now.

To unsubscribe from this group and stop receiving emails from it, send an email to gem5-aladdin-users+unsub...@googlegroups.com.
To post to this group, send email to gem5-aladdin-users@googlegroups.com.
--
Thanks,

Sam Xi
Harvard University
Computer Science, Ph.D. Candidate
--
Thanks,

Sam Xi
Harvard University
Computer Science, Ph.D. Candidate
Reply all
Reply to author
Forward
0 new messages