Prefetcher.py (13786:860c780d9f30) Prefetcher.py (13825:90e5b4dfeaff)
1# Copyright (c) 2012, 2014 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 29 unchanged lines hidden (view full) ---

38#
39# Authors: Ron Dreslinski
40# Mitch Hayenga
41
42from m5.SimObject import *
43from m5.params import *
44from m5.proxy import *
45
1# Copyright (c) 2012, 2014 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 29 unchanged lines hidden (view full) ---

38#
39# Authors: Ron Dreslinski
40# Mitch Hayenga
41
42from m5.SimObject import *
43from m5.params import *
44from m5.proxy import *
45
46from m5.objects.BaseCPU import BaseCPU
46from m5.objects.ClockedObject import ClockedObject
47from m5.objects.IndexingPolicies import *
48from m5.objects.ReplacementPolicies import *
49
50class HWPProbeEvent(object):
51 def __init__(self, prefetcher, obj, *listOfNames):
52 self.obj = obj
53 self.prefetcher = prefetcher

--- 385 unchanged lines hidden (view full) ---

439 "Indexing policy of the pattern sequence table")
440 pattern_sequence_table_replacement_policy = Param.BaseReplacementPolicy(
441 LRURP(), "Replacement policy of the pattern sequence table")
442
443 region_miss_order_buffer_entries = Param.Unsigned(131072,
444 "Number of entries of the Region Miss Order Buffer")
445 reconstruction_entries = Param.Unsigned(256,
446 "Number of reconstruction entries")
47from m5.objects.ClockedObject import ClockedObject
48from m5.objects.IndexingPolicies import *
49from m5.objects.ReplacementPolicies import *
50
51class HWPProbeEvent(object):
52 def __init__(self, prefetcher, obj, *listOfNames):
53 self.obj = obj
54 self.prefetcher = prefetcher

--- 385 unchanged lines hidden (view full) ---

440 "Indexing policy of the pattern sequence table")
441 pattern_sequence_table_replacement_policy = Param.BaseReplacementPolicy(
442 LRURP(), "Replacement policy of the pattern sequence table")
443
444 region_miss_order_buffer_entries = Param.Unsigned(131072,
445 "Number of entries of the Region Miss Order Buffer")
446 reconstruction_entries = Param.Unsigned(256,
447 "Number of reconstruction entries")
448
449class HWPProbeEventRetiredInsts(HWPProbeEvent):
450 def register(self):
451 if self.obj:
452 for name in self.names:
453 self.prefetcher.getCCObject().addEventProbeRetiredInsts(
454 self.obj.getCCObject(), name)
455
456class PIFPrefetcher(QueuedPrefetcher):
457 type = 'PIFPrefetcher'
458 cxx_class = 'PIFPrefetcher'
459 cxx_header = "mem/cache/prefetch/pif.hh"
460 cxx_exports = [
461 PyBindMethod("addEventProbeRetiredInsts"),
462 ]
463
464 prec_spatial_region_bits = Param.Unsigned(2,
465 "Number of preceding addresses in the spatial region")
466 succ_spatial_region_bits = Param.Unsigned(8,
467 "Number of subsequent addresses in the spatial region")
468 compactor_entries = Param.Unsigned(2, "Entries in the temp. compactor")
469 stream_address_buffer_entries = Param.Unsigned(7, "Entries in the SAB")
470 history_buffer_size = Param.Unsigned(16, "Entries in the history buffer")
471
472 index_entries = Param.MemorySize("64",
473 "Number of entries in the index")
474 index_assoc = Param.Unsigned(64,
475 "Associativity of the index")
476 index_indexing_policy = Param.BaseIndexingPolicy(
477 SetAssociative(entry_size = 1, assoc = Parent.index_assoc,
478 size = Parent.index_entries),
479 "Indexing policy of the index")
480 index_replacement_policy = Param.BaseReplacementPolicy(LRURP(),
481 "Replacement policy of the index")
482
483 def listenFromProbeRetiredInstructions(self, simObj):
484 if not isinstance(simObj, BaseCPU):
485 raise TypeError("argument must be of BaseCPU type")
486 self.addEvent(HWPProbeEventRetiredInsts(self, simObj,"RetiredInstsPC"))