Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/35155 )

Change subject: mem: When loading an image directly in memory, use the right CL size.
......................................................................

mem: When loading an image directly in memory, use the right CL size.

Some code was added fairly recently which would load a memory image
into a memory directly in order to make it easier to set up ROMs.
Unfortunately, that code accidentally used the image size instead of
the cache line size when setting up the port proxy which would actually
write the data. This happens to work when the image size is a power of
two since that's all the proxy checks for, but there's no guarantee
that every image will be sized that way.

This change instead looks into the system object, retrieves the cache
line size from it, and uses that to set up the port proxy.

Change-Id: I227ac475b855d9516e1feb881769e12ec4e7d598
---
M src/mem/abstract_mem.cc
1 file changed, 2 insertions(+), 1 deletion(-)



diff --git a/src/mem/abstract_mem.cc b/src/mem/abstract_mem.cc
index a708c6c..10aea37 100644
--- a/src/mem/abstract_mem.cc
+++ b/src/mem/abstract_mem.cc
@@ -92,7 +92,8 @@
panic_if(!image_range.isSubset(range), "%s: memory image %s doesn't fit.",
              name(), file);

- PortProxy proxy([this](PacketPtr pkt) { functionalAccess(pkt); }, size());
+    PortProxy proxy([this](PacketPtr pkt) { functionalAccess(pkt); },
+                    system()->cacheLineSize());

     panic_if(!image.write(proxy), "%s: Unable to write image.");
 }

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/35155
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I227ac475b855d9516e1feb881769e12ec4e7d598
Gerrit-Change-Number: 35155
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabebl...@google.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to