Ivan Pizarro has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/13935

Change subject: configs-common: Adding options to configure the TLB hierarchy Signed-off-by: Ivan Pizarro [email protected]
......................................................................

configs-common: Adding options to configure the TLB hierarchy
Signed-off-by: Ivan Pizarro [email protected]

Change-Id: Ib9f8b4e233b8800358a603db06ffd424741fe305
---
A configs/common/CPUTLBConfig.py
M configs/common/Options.py
2 files changed, 105 insertions(+), 0 deletions(-)



diff --git a/configs/common/CPUTLBConfig.py b/configs/common/CPUTLBConfig.py
new file mode 100644
index 0000000..ce7702e
--- /dev/null
+++ b/configs/common/CPUTLBConfig.py
@@ -0,0 +1,89 @@
+#
+# Copyright (c) 2018 Metempsy Technology Consulting
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Author: Ivan Pizarro
+#
+
+import m5
+from m5.objects import *
+
+def config_tlb(options, cpu, bus):
+
+    for stage in [ 1, 2 ]:
+
+        if stage == 1:
+ itb_class, dtb_class, l2tlb_class, l3tlb_class, walker_class = \
+                ArmTLB, ArmTLB, ArmTLB, ArmTLB, ArmTableWalker
+        else:
+ itb_class, dtb_class, l2tlb_class, l3tlb_class, walker_class = \
+                ArmStage2TLB, ArmStage2TLB, ArmStage2TLB, ArmStage2TLB, \
+                ArmStage2TableWalker
+
+        tlb_hierarchy = []
+
+        # Stage 1 TLBs
+        itb = itb_class(size = options.itb_size, \
+                        assoc = options.itb_assoc, \
+                        lat = options.itb_latency)
+        dtb = dtb_class(size = options.dtb_size, \
+                        assoc = options.dtb_assoc, \
+                        lat = options.dtb_latency)
+
+        itb.level = 1
+        dtb.level = 1
+
+        tlb_hierarchy.append([ itb, dtb ])
+
+        l2tlb = None
+
+        if options.l2tlb:
+
+            l2tlb = l2tlb_class(\
+                size = options.l2tlb_size, \
+                assoc = options.l2tlb_assoc, \
+                lat = options.l2tlb_latency, \
+                allow_partial_translations = options.l2tlb_partial)
+
+            l2tlb.level = 2
+
+            # Connect the ports between L1 - L2 TLBs
+            l2tlb.slave = itb.master
+            l2tlb.slave = dtb.master
+
+            tlb_hierarchy.append([ l2tlb ])
+
+            cpu.addTwoLevelTLBHierarchy(stage, itb, dtb, l2tlb)
+        else:
+            cpu.addPrivateSplitL1TLBs(stage, itb, dtb)
+
+        for tlb in tlb_hierarchy[-1]:
+            walker = walker_class(
+                        max_inflight_walks = options.max_outstanding_ptw)
+            tlb.walker = walker
+            walker.slave = tlb.master
+
+    cpu.connectWalkerPorts(bus)
diff --git a/configs/common/Options.py b/configs/common/Options.py
index aed8881..0bfb4be 100644
--- a/configs/common/Options.py
+++ b/configs/common/Options.py
@@ -111,6 +111,22 @@
     parser.add_option("--l3_assoc", type="int", default=16)
     parser.add_option("--cacheline_size", type="int", default=64)

+    # TLB Options
+    parser.add_option("--itb-size", type="string", default="16")
+    parser.add_option("--itb-assoc", type="int", default=1)
+    parser.add_option("--itb-latency", type="int", default=1)
+    parser.add_option("--dtb-size", type="string", default="16")
+    parser.add_option("--dtb-assoc", type="int", default=1)
+    parser.add_option("--dtb-latency", type="int", default=1)
+    parser.add_option("--l2tlb", action="store_true")
+    parser.add_option("--l2tlb-size", type="string", default="512")
+    parser.add_option("--l2tlb-assoc", type="int", default=4)
+    parser.add_option("--l2tlb-latency", type="int", default=4)
+    parser.add_option("--l2tlb-partial", action="store_true")
+
+    # Page walker Options
+    parser.add_option("--max-outstanding-ptw", type="int", default=1)
+
     # Enable Ruby
     parser.add_option("--ruby", action="store_true")


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

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ib9f8b4e233b8800358a603db06ffd424741fe305
Gerrit-Change-Number: 13935
Gerrit-PatchSet: 1
Gerrit-Owner: Ivan Pizarro <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to