diff options
| author | 2026-11-08 00:37:41 +0000 | |
|---|---|---|
| committer | 2026-11-08 00:37:41 +0000 | |
| commit | 1cf06615f97bc27f732a880e89e9366140095bf1 (patch) | |
| tree | a02c356c64b150c164fd72254da33d872f572957 /src/states.h | |
| download | coursework-master.tar.gz | |
Diffstat (limited to 'src/states.h')
| -rw-r--r-- | src/states.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/states.h b/src/states.h new file mode 100644 index 0000000..4baf72c --- /dev/null +++ b/src/states.h | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | #ifndef INCLUDED_STATES_H | ||
| 2 | #define INCLUDED_STATES_H | ||
| 3 | |||
| 4 | #include <stdlib.h> | ||
| 5 | #include "config.h" | ||
| 6 | #include "busses.h" | ||
| 7 | #include "caches.h" | ||
| 8 | #include "cpus.h" | ||
| 9 | #include "memory.h" | ||
| 10 | #include "connections.h" | ||
| 11 | |||
| 12 | struct state { | ||
| 13 | int cache_locking_busses; | ||
| 14 | int bus_cycles; | ||
| 15 | struct bus data_bus; | ||
| 16 | struct bus addr_bus; | ||
| 17 | struct bus shared_bus; | ||
| 18 | struct cache caches [CPU_COUNT]; | ||
| 19 | struct cpu cpus [CPU_COUNT]; | ||
| 20 | struct connection cons_cpu_cache_addr [CPU_COUNT]; | ||
| 21 | struct connection cons_cpu_cache_data [CPU_COUNT]; | ||
| 22 | struct connection cons_cache_bus_shared [CPU_COUNT]; | ||
| 23 | struct connection cons_cache_bus_addr [CPU_COUNT]; | ||
| 24 | struct connection cons_cache_bus_data [CPU_COUNT]; | ||
| 25 | struct connection con_memory_bus_addr; | ||
| 26 | struct connection con_memory_bus_data; | ||
| 27 | struct memory memory; | ||
| 28 | }; | ||
| 29 | |||
| 30 | extern struct state states[MAX_TICKS]; | ||
| 31 | extern size_t current_tick; | ||
| 32 | extern size_t last_tick; | ||
| 33 | |||
| 34 | void set_state (size_t tick); | ||
| 35 | void reset_state (void); | ||
| 36 | void init_state (void); | ||
| 37 | void save_state (void); | ||
| 38 | |||
| 39 | #endif | ||
