diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-03-02 17:46:57 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-03-02 17:46:57 +0200 |
| commit | ad6107d33a8a222d9062aae45d0e8d8483939d5d (patch) | |
| tree | 42896a55a89e1f0fac2d1963752836095fab5ae7 /include | |
| parent | e991095180f774e3582329447c291a11499989ba (diff) | |
| download | gran-ad6107d33a8a222d9062aae45d0e8d8483939d5d.tar.gz gran-ad6107d33a8a222d9062aae45d0e8d8483939d5d.zip | |
add an idealized NoC
+ Purely virtual, doesn't exist, but would be 'theoretically' ideal.
Diffstat (limited to 'include')
| -rw-r--r-- | include/gran/ideal_noc.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/gran/ideal_noc.h b/include/gran/ideal_noc.h new file mode 100644 index 0000000..638454a --- /dev/null +++ b/include/gran/ideal_noc.h @@ -0,0 +1,34 @@ +#ifndef GRAN_IDEAL_NOC_H +#define GRAN_IDEAL_NOC_H + +/** + * Essentially, this is the behaviour of a NoC that everyone wants, but nobody + * knows how to get. All-to all, single cycle, with oldest-first arbitration. + * + * I don't think it's been proven to be physically/mathematically + * impossible to build such a system (with reasonable performance/area costs), + * but at least there's no known way with existing mainstream technologies. + * There are some interesting future research areas, like adding wireless elements + * to the NoC, optical interconnects, superconducting routers and pulse computing, + * but nothing definite as far as I'm aware. Still, might be fun to compare how + * close to an idealized situation we can get, and maybe just daydream. + */ + +#include <stdint.h> +#include <gran/component.h> + +struct component *create_ideal_noc(uint32_t elems, size_t latency); +stat ideal_noc_connect(struct component *noc, struct component *component, uint32_t elem); + +static inline void addr_ideal_noc(uint64_t addr, uint32_t *elem, uint32_t *off) +{ + if (off) *off = addr & 0xffffffff; + if (elem) *elem = (addr >> 32) & 0xffffffff; +} + +static inline uint64_t ideal_noc_addr(uint32_t elem, uint32_t off) +{ + return ((uint64_t)elem << 32) | off; +} + +#endif /* GRAN_IDEAL_NOC_H */ |
