diff options
| author | Alejandro Soto <alejandro@34project.org> | 2023-09-25 05:14:25 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2023-09-25 05:14:25 -0600 |
| commit | d18a37a740db37707e5266e5ca6a8fd956737197 (patch) | |
| tree | 3e2d6ea6d354d8cac722f864f5b8c51fd881e2a9 /tb/avalon.hpp | |
| parent | 27978501a87c5bb7a9fd78e376e8f6772cad009e (diff) | |
tb: implement cache ring
Diffstat (limited to 'tb/avalon.hpp')
| -rw-r--r-- | tb/avalon.hpp | 25 |
1 files changed, 23 insertions, 2 deletions
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 <stdexcept> #include <vector> +#include <verilated.h> + 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<binding> 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; |
