From df69f7b7c73be01968ba767ab112b227533bbd70 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sun, 20 Nov 2022 13:42:59 -0600 Subject: Add tick, bail signals to simulated Avalon slaves --- tb/avalon.impl.hpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'tb/avalon.impl.hpp') diff --git a/tb/avalon.impl.hpp b/tb/avalon.impl.hpp index 3173af8..5ba514f 100644 --- a/tb/avalon.impl.hpp +++ b/tb/avalon.impl.hpp @@ -52,7 +52,14 @@ namespace taller::avalon } return true; - } else if(!active) + } + + for(auto &binding : devices) + { + binding.dev.tick(); + } + + if(!active) { avl_address = plat.avl_address; avl_read = plat.avl_read; @@ -77,6 +84,8 @@ namespace taller::avalon if(!active) { + bail(); + const char *op = avl_read ? "read" : "write"; fprintf(stderr, "[avl] attempt to %s memory hole at 0x%08x\n", op, avl_address); return false; @@ -84,6 +93,8 @@ namespace taller::avalon if(avl_address & active->word_mask()) { + bail(); + fprintf(stderr, "[avl] unaligned address: 0x%08x\n", avl_address); return false; } @@ -104,6 +115,15 @@ namespace taller::avalon return true; } + template + void interconnect::bail() noexcept + { + for(auto &binding : devices) + { + binding.dev.bail(); + } + } + template std::uint32_t interconnect::dump(std::uint32_t addr) { -- cgit v1.2.3