sst-elements
sst-elements copied to clipboard
segmentation fault in using memHierarchy.ScratchCPU, Scratchpad, and standardInterface
The following config file leads to a segfault. A few questions:
- What am I doing wrong?
- How to debug such issues?
- I am trying to implement one host with multiple banks of scratchpad memory. Will I be able to do that with this method?
import sst
# from mhlib import componentlist
cpu = sst.Component("core", "memHierarchy.ScratchCPU")
cpu_params = {
¦ "scratchSize" : 1024, # 1K scratch
¦ "maxAddr" : 4096, # 4K mem
¦ "scratchLineSize" : 64,
¦ "memLineSize" : 64,
¦ "clock" : "1GHz",
¦ "maxOutstandingRequests" : 16,
¦ "maxRequestsPerCycle" : 2,
¦ "reqsToIssue" : 500,
¦ "verbose" : 1
¦ }
cpu.addParams(cpu_params)
iface = cpu.setSubComponent("memory", "memHierarchy.standardInterface")
scratchpad = sst.Component("scratch", "memHierarchy.Scratchpad")
scratchpad_params = {
¦ "debug" : 0,
¦ "debug_level" : 10,
¦ "clock" : "2GHz",
¦ "size" : "1KiB",
¦ "scratch_line_size" : 64,
¦ "memory_line_size" : 64,
¦ "backing" : "none",
¦ }
scratchpad.addParams(scratchpad_params)
# Enable statistics
# # sst.setStatisticLoadLevel(7)
# # sst.setStatisticOutput("sst.statOutputConsole")
# # for a in componentlist:
# # sst.enableAllStatisticsForComponentType(a)
link = sst.Link("component_link")
link.connect(
¦ (iface, "port", "1000ps"),
¦ (scratchpad, "cpu", "1000ps")
¦ )
@prateek22sri Are you still encountering this segfault? Can you add the location of the segfault you see?
The primary difference between memH's scratchpad & memory is that scratchpad allows copying data in and out ("put", "get") from memory. This config doesn't have a memory, it's possible that is the cause of the segfault but I'm not certain without seeing the error. If you don't want a memory in the system, one option would be to use a CPU connected to a memory to model the scratchpad instead.