Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] stable from gem5:stable #6

Merged
merged 4 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Version 24.1.0.2

**[HOTFIX]** Adds PR <https://github.com/gem5/gem5/pull/1930> as a hotfix to v24.1.0.

This fixes a bug which was was causing the CHI coherence protocol to fail in multi-core simulations.
The fix sets the `RubySystem` pointer when the TBE is allocated, instead of when `set_tbe` is performed, thus ensuring that the `RubySystem` pointer is set before the TBE is used.

# Version 24.1.0.1

**[HOTFIX]** This hotfix release applies the following:
Expand Down
2 changes: 1 addition & 1 deletion src/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ PROJECT_NAME = gem5
# This could be handy for archiving the generated documentation or
# if some version control system is used.

PROJECT_NUMBER = v24.1.0.1
PROJECT_NUMBER = v24.1.0.2

# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
Expand Down
2 changes: 1 addition & 1 deletion src/base/version.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ namespace gem5
/**
* @ingroup api_base_utils
*/
const char *gem5Version = "24.1.0.1";
const char *gem5Version = "24.1.0.2";

} // namespace gem5
19 changes: 17 additions & 2 deletions src/mem/ruby/structures/TBETable.hh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <unordered_map>

#include "mem/ruby/common/Address.hh"
#include "mem/ruby/system/RubySystem.hh"

namespace gem5
{
Expand All @@ -70,7 +71,7 @@ class TBETable
return (m_number_of_TBEs - m_map.size()) >= n;
}

void setBlockSize(const int block_size) { m_block_size = block_size; }
void setRubySystem(RubySystem* rs);

ENTRY *getNullEntry();
ENTRY *lookup(Addr address);
Expand All @@ -89,6 +90,10 @@ class TBETable
private:
int m_number_of_TBEs = 0;
int m_block_size = 0;
RubySystem* m_ruby_system = nullptr;

static constexpr bool entryRequiresRubySystem =
std::is_member_function_pointer_v<decltype(&ENTRY::setRubySystem)>;
};

template<class ENTRY>
Expand All @@ -100,6 +105,14 @@ operator<<(std::ostream& out, const TBETable<ENTRY>& obj)
return out;
}

template<class ENTRY>
inline
void TBETable<ENTRY>::setRubySystem(RubySystem* rs)
{
m_ruby_system = rs;
m_block_size = rs->getBlockSizeBytes();
}

template<class ENTRY>
inline bool
TBETable<ENTRY>::isPresent(Addr address) const
Expand All @@ -116,7 +129,9 @@ TBETable<ENTRY>::allocate(Addr address)
assert(!isPresent(address));
assert(m_map.size() < m_number_of_TBEs);
assert(m_block_size > 0);
m_map.emplace(address, ENTRY(m_block_size));
ENTRY new_entry = ENTRY(m_block_size);
new_entry.setRubySystem(m_ruby_system);
m_map.emplace(address, new_entry);
}

template<class ENTRY>
Expand Down
13 changes: 6 additions & 7 deletions src/mem/slicc/symbols/StateMachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,13 +831,13 @@ def printControllerCC(self, path, includes):
comment = f"Type {vtype.ident} default"
code('*$vid = ${{vtype["default"]}}; // $comment')

# For objects that require knowing the cache line size,
# For objects that require a pointer to RubySystem,
# set the value here.
if vtype.c_ident in ("TBETable"):
block_size_func = "m_ruby_system->getBlockSizeBytes()"
code(f"(*{vid}).setBlockSize({block_size_func});")

if vtype.c_ident in ("NetDest", "PerfectCacheMemory"):
if vtype.c_ident in (
"NetDest",
"PerfectCacheMemory",
"TBETable",
):
code(f"(*{vid}).setRubySystem(m_ruby_system);")

for param in self.config_parameters:
Expand Down Expand Up @@ -1271,7 +1271,6 @@ def printControllerCC(self, path, includes):
$c_ident::set_tbe(${{self.TBEType.c_ident}}*& m_tbe_ptr, ${{self.TBEType.c_ident}}* m_new_tbe)
{
m_tbe_ptr = m_new_tbe;
m_tbe_ptr->setRubySystem(m_ruby_system);
}

void
Expand Down
Loading