From d18a37a740db37707e5266e5ca6a8fd956737197 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Mon, 25 Sep 2023 05:14:25 -0600 Subject: tb: implement cache ring --- tb/avalon.hpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'tb/avalon.hpp') diff --git a/tb/avalon.hpp b/tb/avalon.hpp index 40bfe9a..fd87c31 100644 --- a/tb/avalon.hpp +++ b/tb/avalon.hpp @@ -7,11 +7,14 @@ #include #include +#include + namespace taller::avalon { union line { - __int128 qword; + __int128 qword; + VlWide<4> verilated; struct { @@ -22,8 +25,26 @@ namespace taller::avalon { std::uint32_t words[4]; }; + + line() noexcept = default; + + inline line(VlWide<4> verilated) noexcept + : verilated(verilated) + {} + + inline operator VlWide<4>() const noexcept + { + return this->verilated; + } + + inline bool operator==(VlWide<4> verilated) const noexcept + { + return this->verilated == verilated; + } }; + static_assert(sizeof(line) == 16); + class slave { public: @@ -202,7 +223,7 @@ namespace taller::avalon std::vector devices; interrupt_controller *root_intc = nullptr; std::uint32_t avl_address = 0; - std::uint32_t avl_writedata = 0; + line avl_writedata; unsigned avl_byteenable = 0; bool avl_read = false; bool avl_write = false; -- cgit v1.2.3