rob_impl.hh (4318:eb4241362a80) rob_impl.hh (4329:52057dbec096)
1/*
2 * Copyright (c) 2004-2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

30 */
31
32#include "config/full_system.hh"
33#include "cpu/o3/rob.hh"
34
35#include <list>
36
37template <class Impl>
1/*
2 * Copyright (c) 2004-2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

30 */
31
32#include "config/full_system.hh"
33#include "cpu/o3/rob.hh"
34
35#include <list>
36
37template <class Impl>
38ROB::ROB(unsigned _numEntries, unsigned _squashWidth,
38ROB<Impl>::ROB(O3CPU *_cpu, unsigned _numEntries, unsigned _squashWidth,
39 std::string _smtROBPolicy, unsigned _smtROBThreshold,
40 unsigned _numThreads)
39 std::string _smtROBPolicy, unsigned _smtROBThreshold,
40 unsigned _numThreads)
41 : numEntries(_numEntries),
41 : cpu(_cpu),
42 numEntries(_numEntries),
42 squashWidth(_squashWidth),
43 numInstsInROB(0),
44 numThreads(_numThreads)
45{
46 for (int tid=0; tid < numThreads; tid++) {
47 squashedSeqNum[tid] = 0;
48 doneSquashing[tid] = true;
49 threadEntries[tid] = 0;

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

61
62 //Set Max Entries to Total ROB Capacity
63 for (int i = 0; i < numThreads; i++) {
64 maxEntries[i]=numEntries;
65 }
66
67 } else if (policy == "partitioned") {
68 robPolicy = Partitioned;
43 squashWidth(_squashWidth),
44 numInstsInROB(0),
45 numThreads(_numThreads)
46{
47 for (int tid=0; tid < numThreads; tid++) {
48 squashedSeqNum[tid] = 0;
49 doneSquashing[tid] = true;
50 threadEntries[tid] = 0;

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

62
63 //Set Max Entries to Total ROB Capacity
64 for (int i = 0; i < numThreads; i++) {
65 maxEntries[i]=numEntries;
66 }
67
68 } else if (policy == "partitioned") {
69 robPolicy = Partitioned;
69// DPRINTF(Fetch, "ROB sharing policy set to Partitioned\n");
70 DPRINTF(Fetch, "ROB sharing policy set to Partitioned\n");
70
71 //@todo:make work if part_amt doesnt divide evenly.
72 int part_amt = numEntries / numThreads;
73
74 //Divide ROB up evenly
75 for (int i = 0; i < numThreads; i++) {
76 maxEntries[i]=part_amt;
77 }
78
79 } else if (policy == "threshold") {
80 robPolicy = Threshold;
71
72 //@todo:make work if part_amt doesnt divide evenly.
73 int part_amt = numEntries / numThreads;
74
75 //Divide ROB up evenly
76 for (int i = 0; i < numThreads; i++) {
77 maxEntries[i]=part_amt;
78 }
79
80 } else if (policy == "threshold") {
81 robPolicy = Threshold;
81// DPRINTF(Fetch, "ROB sharing policy set to Threshold\n");
82 DPRINTF(Fetch, "ROB sharing policy set to Threshold\n");
82
83 int threshold = _smtROBThreshold;;
84
85 //Divide up by threshold amount
86 for (int i = 0; i < numThreads; i++) {
87 maxEntries[i]=threshold;
88 }
89 } else {
90 assert(0 && "Invalid ROB Sharing Policy.Options Are:{Dynamic,"
91 "Partitioned, Threshold}");
92 }
83
84 int threshold = _smtROBThreshold;;
85
86 //Divide up by threshold amount
87 for (int i = 0; i < numThreads; i++) {
88 maxEntries[i]=threshold;
89 }
90 } else {
91 assert(0 && "Invalid ROB Sharing Policy.Options Are:{Dynamic,"
92 "Partitioned, Threshold}");
93 }
93}
94
94
95template <class Impl>
96std::string
97ROB<Impl>::name() const
98{
99 return cpu->name() + ".rob";
100}
101
102template <class Impl>
103void
104ROB<Impl>::setCPU(O3CPU *cpu_ptr)
105{
106 cpu = cpu_ptr;
107
108 // Set the per-thread iterators to the end of the instruction list.
109 for (int i=0; i < numThreads;i++) {
110 squashIt[i] = instList[i].end();
111 }
112
113 // Initialize the "universal" ROB head & tail point to invalid
114 // pointers
115 head = instList[0].end();
116 tail = instList[0].end();
117}
118
119template <class Impl>
95 // Set the per-thread iterators to the end of the instruction list.
96 for (int i=0; i < numThreads;i++) {
97 squashIt[i] = instList[i].end();
98 }
99
100 // Initialize the "universal" ROB head & tail point to invalid
101 // pointers
102 head = instList[0].end();
103 tail = instList[0].end();
104}
105
106template <class Impl>
107std::string
108ROB<Impl>::name() const
109{
110 return cpu->name() + ".rob";
111}
112
113template <class Impl>
120void
121ROB<Impl>::setActiveThreads(std::list<unsigned> *at_ptr)
122{
123 DPRINTF(ROB, "Setting active threads list pointer.\n");
124 activeThreads = at_ptr;
125}
126
127template <class Impl>

--- 574 unchanged lines hidden ---
114void
115ROB<Impl>::setActiveThreads(std::list<unsigned> *at_ptr)
116{
117 DPRINTF(ROB, "Setting active threads list pointer.\n");
118 activeThreads = at_ptr;
119}
120
121template <class Impl>

--- 574 unchanged lines hidden ---