generated from riscv-software-src/template-riscv-code
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created the common Allocators class and hooked it up (#97)
Removed some dead code as well. Added `void onStartingTeardown_() override {}` to the LSU in this PR as an example. This method is called every time just before the unit is destroyed -- either during an exception or a clean teardown.
- Loading branch information
Knute Lingaard
authored
Oct 9, 2023
1 parent
aed04b1
commit 0c98a64
Showing
16 changed files
with
281 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// <OlympiaAllocators.hpp> -*- C++ -*- | ||
|
||
#pragma once | ||
|
||
/*! | ||
* \file OlympiaAllocators.hpp | ||
* \brief Defines a general TreeNode that contains all allocators used | ||
* in simulation | ||
*/ | ||
|
||
#include "sparta/simulation/TreeNode.hpp" | ||
|
||
#include "Inst.hpp" | ||
#include "MemoryAccessInfo.hpp" | ||
#include "LSU.hpp" // A little heavyweight to include for now... | ||
|
||
namespace olympia | ||
{ | ||
/*! | ||
* \class OlympiaAllocators | ||
* \brief A TreeNode that is actually a functional resource | ||
* containing memory allocators | ||
*/ | ||
class OlympiaAllocators : public sparta::TreeNode | ||
{ | ||
public: | ||
static constexpr char name[] = "olympia_allocators"; | ||
|
||
OlympiaAllocators(sparta::TreeNode *node) : | ||
sparta::TreeNode(node, name, "Allocators used in simulation") | ||
{} | ||
|
||
static OlympiaAllocators * getOlympiaAllocators(sparta::TreeNode *node) | ||
{ | ||
OlympiaAllocators * allocators = nullptr; | ||
if(node) | ||
{ | ||
if(node->hasChild(OlympiaAllocators::name)) { | ||
// If this class is converted to a resource, use this line | ||
//allocators = node->getChild(OlympiaAllocators::name)->getResourceAs<OlympiaAllocators>(); | ||
allocators = node->getChildAs<OlympiaAllocators>(OlympiaAllocators::name); | ||
} | ||
else { | ||
return getOlympiaAllocators(node->getParent()); | ||
} | ||
} | ||
return allocators; | ||
} | ||
|
||
// Allocators used in simulation. These values can be | ||
// parameterized in the future by converting this class into a | ||
// full-blown sparta::Resource and adding a sparta::ParameterSet | ||
InstAllocator inst_allocator {3000, 2500}; | ||
InstArchInfoAllocator inst_arch_info_allocator{3000, 2500}; | ||
|
||
// For LSU/MSS | ||
LSU::LoadStoreInstInfoAllocator load_store_info_allocator{100, 80}; | ||
MemoryAccessInfoAllocator memory_access_allocator {100, 80}; | ||
|
||
}; | ||
} |
Oops, something went wrong.