summaryrefslogtreecommitdiff
path: root/infra/bus.h
diff options
context:
space:
mode:
authorJulian Blake Kongslie2022-10-15 13:59:46 -0700
committerJulian Blake Kongslie2022-10-15 13:59:46 -0700
commitc25e80b08f473fce0fdf11f2445f5b3f3b2bf342 (patch)
tree91a22c102d510771cffe79afd2c9d683dbfaeb08 /infra/bus.h
parentSome trivial arbiter improvements. (diff)
downloadbiggolf-c25e80b08f473fce0fdf11f2445f5b3f3b2bf342.tar.xz
Move shared_bus into arbiter
Diffstat (limited to 'infra/bus.h')
-rw-r--r--infra/bus.h22
1 files changed, 0 insertions, 22 deletions
diff --git a/infra/bus.h b/infra/bus.h
deleted file mode 100644
index e986174..0000000
--- a/infra/bus.h
+++ /dev/null
@@ -1,22 +0,0 @@
1#pragma once
2
3#include <array>
4#include <cassert>
5
6#include "infra/sim.h"
7
8namespace infra {
9 template<typename T, unsigned int peers> struct shared_bus : public sim {
10 std::array<port<T>, peers> peerp;
11 port<T> *outp = nullptr;
12
13 void clock() {
14 for (unsigned int i = 0; i < peers; ++i) {
15 if (peerp[i].can_read()) {
16 assert(outp->can_write());
17 outp->write(peerp[i].read());
18 }
19 }
20 }
21 };
22}