From d133cc70b125efc1d6c992cb49ce1bca41cf580e Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sun, 30 Apr 2023 17:47:00 +0300 Subject: refactor component tree --- include/gran/bus/simple_bus.h | 10 ++++++++++ include/gran/clock_domain.h | 6 +++--- include/gran/common.h | 6 +++--- include/gran/component.h | 6 +++--- include/gran/components/bus/simple_bus.h | 10 ---------- include/gran/components/mem/simple_mem.h | 8 -------- include/gran/cpu/riscv/simple_riscv32.h | 8 ++++++++ include/gran/mem/simple_mem.h | 8 ++++++++ include/gran/root.h | 6 +++--- 9 files changed, 38 insertions(+), 30 deletions(-) create mode 100644 include/gran/bus/simple_bus.h delete mode 100644 include/gran/components/bus/simple_bus.h delete mode 100644 include/gran/components/mem/simple_mem.h create mode 100644 include/gran/cpu/riscv/simple_riscv32.h create mode 100644 include/gran/mem/simple_mem.h (limited to 'include') diff --git a/include/gran/bus/simple_bus.h b/include/gran/bus/simple_bus.h new file mode 100644 index 0000000..c569e8a --- /dev/null +++ b/include/gran/bus/simple_bus.h @@ -0,0 +1,10 @@ +#ifndef GRAN_SIMPLE_BUS_H +#define GRAN_SIMPLE_BUS_H + +#include + +struct component *create_simple_bus(); +stat simple_bus_add(struct component *bus, struct component *component, + uintptr_t addr, size_t size); + +#endif /* GRAN_SIMPLE_BUS_H */ diff --git a/include/gran/clock_domain.h b/include/gran/clock_domain.h index 3f960ae..9fb04a4 100644 --- a/include/gran/clock_domain.h +++ b/include/gran/clock_domain.h @@ -1,5 +1,5 @@ -#ifndef EXSIM_CLOCK_DOMAIN_H -#define EXSIM_CLOCK_DOMAIN_H +#ifndef GRAN_CLOCK_DOMAIN_H +#define GRAN_CLOCK_DOMAIN_H #include #include @@ -37,4 +37,4 @@ bool le_time(struct clock_time a, struct clock_time b); struct clock_time max_time(struct clock_time a, struct clock_time b); struct clock_time domain_time(struct clock_domain *); -#endif /* EXSIM_CLOCK_DOMAIN_H */ +#endif /* GRAN_CLOCK_DOMAIN_H */ diff --git a/include/gran/common.h b/include/gran/common.h index c012c49..b4b8978 100644 --- a/include/gran/common.h +++ b/include/gran/common.h @@ -1,5 +1,5 @@ -#ifndef EXSIM_COMMON_H -#define EXSIM_COMMON_H +#ifndef GRAN_COMMON_H +#define GRAN_COMMON_H #include @@ -31,4 +31,4 @@ typedef enum { #define debug(x, ...) #endif -#endif /* EXSIM_COMMON_H */ +#endif /* GRAN_COMMON_H */ diff --git a/include/gran/component.h b/include/gran/component.h index cd21a6b..498d7c0 100644 --- a/include/gran/component.h +++ b/include/gran/component.h @@ -1,5 +1,5 @@ -#ifndef EXSIM_COMPONENT_H -#define EXSIM_COMPONENT_H +#ifndef GRAN_COMPONENT_H +#define GRAN_COMPONENT_H #include #include @@ -104,4 +104,4 @@ static inline stat swap_u8(struct component *component, uintptr_t addr, return swap(component, addr, sizeof(uint8_t), c, sizeof(uint8_t), c); } -#endif /* EXSIM_COMPONENT_H */ +#endif /* GRAN_COMPONENT_H */ diff --git a/include/gran/components/bus/simple_bus.h b/include/gran/components/bus/simple_bus.h deleted file mode 100644 index 3a5f814..0000000 --- a/include/gran/components/bus/simple_bus.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef EXSIM_SIMPLE_BUS_H -#define EXSIM_SIMPLE_BUS_H - -#include - -struct component *create_simple_bus(); -stat simple_bus_add(struct component *bus, struct component *component, - uintptr_t addr, size_t size); - -#endif /* EXSIM_SIMPLE_BUS_H */ diff --git a/include/gran/components/mem/simple_mem.h b/include/gran/components/mem/simple_mem.h deleted file mode 100644 index 8e0845c..0000000 --- a/include/gran/components/mem/simple_mem.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef EXSIM_SIMPLE_MEM_H -#define EXSIM_SIMPLE_MEM_H - -#include - -struct component *create_simple_mem(size_t size); - -#endif /* EXSIM_SIMPLE_MEM_H */ diff --git a/include/gran/cpu/riscv/simple_riscv32.h b/include/gran/cpu/riscv/simple_riscv32.h new file mode 100644 index 0000000..054c76d --- /dev/null +++ b/include/gran/cpu/riscv/simple_riscv32.h @@ -0,0 +1,8 @@ +#ifndef GRAN_SIMPLE_RISCV32 +#define GRAN_SIMPLE_RISCV32 + +#include + +struct component *create_simple_riscv32(uint32_t start_pc, struct component *imem, struct component *dmem); + +#endif /* GRAN_SIMPLE_RISCV */ diff --git a/include/gran/mem/simple_mem.h b/include/gran/mem/simple_mem.h new file mode 100644 index 0000000..984dbf6 --- /dev/null +++ b/include/gran/mem/simple_mem.h @@ -0,0 +1,8 @@ +#ifndef GRAN_SIMPLE_MEM_H +#define GRAN_SIMPLE_MEM_H + +#include + +struct component *create_simple_mem(size_t size); + +#endif /* GRAN_SIMPLE_MEM_H */ diff --git a/include/gran/root.h b/include/gran/root.h index d158b04..32ca1cf 100644 --- a/include/gran/root.h +++ b/include/gran/root.h @@ -1,5 +1,5 @@ -#ifndef EXSIM_ROOT_H -#define EXSIM_ROOT_H +#ifndef GRAN_ROOT_H +#define GRAN_ROOT_H #include #include @@ -11,4 +11,4 @@ stat root_add_clock(struct gran_root *, struct clock_domain *); stat root_run(struct gran_root *); void destroy_root(struct gran_root *); -#endif /* EXSIM_ROOT_H */ +#endif /* GRAN_ROOT_H */ -- cgit v1.3