diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-09-25 21:00:16 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-09-25 21:00:16 +0300 |
| commit | 6d0e7c5eba49efc171e63ff2631722a5c7f95460 (patch) | |
| tree | 9159d22c6ee1ee2949dcf8455998405b031cb351 /include | |
| parent | fecb86f6093c1e8aed6ab05c29c5af9d0cb93157 (diff) | |
| download | gran-6d0e7c5eba49efc171e63ff2631722a5c7f95460.tar.gz gran-6d0e7c5eba49efc171e63ff2631722a5c7f95460.zip | |
technically speaking deadlock free, but starves
Diffstat (limited to 'include')
| -rw-r--r-- | include/gran/cpu/riscv/simple_riscv64.h | 2 | ||||
| -rw-r--r-- | include/gran/grid/node.h | 18 | ||||
| -rw-r--r-- | include/gran/grid/router.h | 10 |
3 files changed, 8 insertions, 22 deletions
diff --git a/include/gran/cpu/riscv/simple_riscv64.h b/include/gran/cpu/riscv/simple_riscv64.h index fe6e686..142c619 100644 --- a/include/gran/cpu/riscv/simple_riscv64.h +++ b/include/gran/cpu/riscv/simple_riscv64.h @@ -6,7 +6,7 @@ #include <gran/component.h> -struct component *create_simple_riscv64(uint64_t rcv, uint32_t start_pc, +struct component *create_simple_riscv64(uint64_t rcv, uint64_t start_pc, struct component *imem, struct component *dmem); diff --git a/include/gran/grid/node.h b/include/gran/grid/node.h index 16116d2..db617f8 100644 --- a/include/gran/grid/node.h +++ b/include/gran/grid/node.h @@ -4,30 +4,26 @@ #include <gran/component.h> #include <stdint.h> -struct component *create_grid_node(uint8_t u, uint8_t v, uint8_t x, uint8_t y); +struct component *create_grid_node(uint16_t x, uint16_t y); stat grid_node_connect(struct component *node, struct component *left, struct component *right, struct component *up, struct component *down, - struct component *lower, struct component *ascend); + struct component *lower); -static inline uint64_t grid_addr(uint8_t u, uint8_t v, uint8_t x, uint8_t y, uint32_t off) +static inline uint64_t grid_addr(uint16_t x, uint16_t y, uint32_t off) { return off | ((uint64_t)x << 32) - | ((uint64_t)y << 40) - | ((uint64_t)u << 48) - | ((uint64_t)v << 56) + | ((uint64_t)y << 48) ; } -static inline void addr_grid(uint64_t addr, uint32_t *off, uint8_t *x, uint8_t *y, uint8_t *u, uint8_t *v) +static inline void addr_grid(uint64_t addr, uint32_t *off, uint16_t *x, uint16_t *y) { if (off) *off = addr & 0xffffffff; - if (x) *x = (addr >> 32) & 0xff; - if (y) *y = (addr >> 40) & 0xff; - if (u) *u = (addr >> 48) & 0xff; - if (v) *v = (addr >> 56) & 0xff; + if (x) *x = (addr >> 32) & 0xffff; + if (y) *y = (addr >> 48) & 0xffff; } #endif /* GRAN_GRID_NODE_H */ diff --git a/include/gran/grid/router.h b/include/gran/grid/router.h deleted file mode 100644 index cff0fa1..0000000 --- a/include/gran/grid/router.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef GRAN_NODE_ROUTER_H -#define GRAN_NODE_ROUTER_H - -#include <gran/component.h> - -struct component *create_node_router(uint8_t u, uint8_t v, uint8_t x, uint8_t y); -stat node_router_add(struct component *router, struct component *component, uint32_t addr, uint32_t size); -stat node_router_ascend(struct component *router, struct component *node); - -#endif /* GRAN_NODE_ROUTER_H */ |
