dep_graph.hh (13429:a1e199fd8122) | dep_graph.hh (13472:7ceacede4f1e) |
---|---|
1/* 2 * Copyright (c) 2012 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 108 unchanged lines hidden (view full) --- 117 118 private: 119 /** Array of linked lists. Each linked list is a list of all the 120 * instructions that depend upon a given register. The actual 121 * register's index is used to index into the graph; ie all 122 * instructions in flight that are dependent upon r34 will be 123 * in the linked list of dependGraph[34]. 124 */ | 1/* 2 * Copyright (c) 2012 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 108 unchanged lines hidden (view full) --- 117 118 private: 119 /** Array of linked lists. Each linked list is a list of all the 120 * instructions that depend upon a given register. The actual 121 * register's index is used to index into the graph; ie all 122 * instructions in flight that are dependent upon r34 will be 123 * in the linked list of dependGraph[34]. 124 */ |
125 DepEntry *dependGraph; | 125 std::vector<DepEntry> dependGraph; |
126 127 /** Number of linked lists; identical to the number of registers. */ 128 int numEntries; 129 130 // Debug variable, remove when done testing. 131 unsigned memAllocCounter; 132 133 public: 134 // Debug variable, remove when done testing. 135 uint64_t nodesTraversed; 136 // Debug variable, remove when done testing. 137 uint64_t nodesRemoved; 138}; 139 140template <class DynInstPtr> 141DependencyGraph<DynInstPtr>::~DependencyGraph() 142{ | 126 127 /** Number of linked lists; identical to the number of registers. */ 128 int numEntries; 129 130 // Debug variable, remove when done testing. 131 unsigned memAllocCounter; 132 133 public: 134 // Debug variable, remove when done testing. 135 uint64_t nodesTraversed; 136 // Debug variable, remove when done testing. 137 uint64_t nodesRemoved; 138}; 139 140template <class DynInstPtr> 141DependencyGraph<DynInstPtr>::~DependencyGraph() 142{ |
143 delete [] dependGraph; | |
144} 145 146template <class DynInstPtr> 147void 148DependencyGraph<DynInstPtr>::resize(int num_entries) 149{ 150 numEntries = num_entries; | 143} 144 145template <class DynInstPtr> 146void 147DependencyGraph<DynInstPtr>::resize(int num_entries) 148{ 149 numEntries = num_entries; |
151 dependGraph = new DepEntry[numEntries]; | 150 dependGraph.resize(numEntries); |
152} 153 154template <class DynInstPtr> 155void 156DependencyGraph<DynInstPtr>::reset() 157{ 158 // Clear the dependency graph 159 DepEntry *curr; --- 140 unchanged lines hidden --- | 151} 152 153template <class DynInstPtr> 154void 155DependencyGraph<DynInstPtr>::reset() 156{ 157 // Clear the dependency graph 158 DepEntry *curr; --- 140 unchanged lines hidden --- |