From d96b8c7d12fc61ec609d6138627b9d6d18139a9a Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 28 Oct 2023 00:00:21 +0300 Subject: move to monorepo + Will probably have to make some changes to dir layout to make things make more sense --- triscv/src/tmb.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 triscv/src/tmb.c (limited to 'triscv/src/tmb.c') diff --git a/triscv/src/tmb.c b/triscv/src/tmb.c new file mode 100644 index 0000000..3f6c037 --- /dev/null +++ b/triscv/src/tmb.c @@ -0,0 +1,29 @@ +#include + +struct map { + vm_t to; + tri_t val; + size_t width; + bool valid; +}; + +#define TMB_SIZE 3 +struct tmb { + struct map map[TMB_SIZE]; +}; + +struct tmb *tmb_create() +{ + return calloc(1, sizeof(struct tmb)); +} + +void tmb_destroy(struct tmb *tmb) +{ + free(tmb); +} + +size_t tmb_size(struct cpu *cpu) +{ + (void)cpu; + return TMB_SIZE; +} -- cgit v1.3