aboutsummaryrefslogtreecommitdiff
path: root/src/states.h
blob: 4baf72cf9849ad59138d4a3637489a70e415cbcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef INCLUDED_STATES_H
#define INCLUDED_STATES_H

#include <stdlib.h>
#include "config.h"
#include "busses.h"
#include "caches.h"
#include "cpus.h"
#include "memory.h"
#include "connections.h"

struct state {
  int cache_locking_busses;
  int bus_cycles;
  struct bus   data_bus;
  struct bus   addr_bus;
  struct bus shared_bus;
  struct cache      caches                [CPU_COUNT];
  struct cpu        cpus                  [CPU_COUNT];
  struct connection cons_cpu_cache_addr   [CPU_COUNT];
  struct connection cons_cpu_cache_data   [CPU_COUNT];
  struct connection cons_cache_bus_shared [CPU_COUNT];
  struct connection cons_cache_bus_addr   [CPU_COUNT];
  struct connection cons_cache_bus_data   [CPU_COUNT];
  struct connection con_memory_bus_addr;
  struct connection con_memory_bus_data;
  struct memory memory;
};

extern struct state states[MAX_TICKS];
extern size_t current_tick;
extern size_t last_tick;

void set_state (size_t tick);
void reset_state (void);
void init_state (void);
void save_state (void);

#endif