ext: Make gem5-SST Memory Size configurable from script

The memory interface param was hardcoded to 8GiB therefore
not matching any python changes in the memory size

Change-Id: I180f57f662886010a38a9b7ebbdbb73e0ae48276
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53625
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
diff --git a/ext/sst/sst_responder_subcomponent.cc b/ext/sst/sst_responder_subcomponent.cc
index 4c895ac..366f99a 100644
--- a/ext/sst/sst_responder_subcomponent.cc
+++ b/ext/sst/sst_responder_subcomponent.cc
@@ -40,6 +40,7 @@
 {
     sstResponder = new SSTResponder(this);
     gem5SimObjectName = params.find<std::string>("response_receiver_name", "");
+    memSize = params.find<std::string>("mem_size", "8GiB");
     if (gem5SimObjectName == "")
         assert(false && "The response_receiver_name must be specified");
 }
@@ -58,7 +59,7 @@
     SST::Params interface_params;
     // This is how you tell the interface the name of the port it should use
     interface_params.insert("port", "port");
-    interface_params.insert("mem_size", "8GiB");
+    interface_params.insert("mem_size", memSize.c_str());
     // Loads a “memHierarchy.memInterface” into index 0 of the “memory” slot
     // SHARE_PORTS means the interface can use our port as if it were its own
     // INSERT_STATS means the interface will inherit our statistic
diff --git a/ext/sst/sst_responder_subcomponent.hh b/ext/sst/sst_responder_subcomponent.hh
index a897deb..51bc4f9 100644
--- a/ext/sst/sst_responder_subcomponent.hh
+++ b/ext/sst/sst_responder_subcomponent.hh
@@ -67,6 +67,7 @@
     std::vector<SST::Interfaces::SimpleMem::Request*> initRequests;
 
     std::string gem5SimObjectName;
+    std::string memSize;
 
   public:
     SSTResponderSubComponent(SST::ComponentId_t id, SST::Params& params);