1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16#ifndef _HRT_HIVE_TYPES_H
17#define _HRT_HIVE_TYPES_H
18
19#include "version.h"
20#include "defs.h"
21
22#ifndef HRTCAT3
23#define _HRTCAT3(m, n, o) m##n##o
24#define HRTCAT3(m, n, o) _HRTCAT3(m, n, o)
25#endif
26
27#ifndef HRTCAT4
28#define _HRTCAT4(m, n, o, p) m##n##o##p
29#define HRTCAT4(m, n, o, p) _HRTCAT4(m, n, o, p)
30#endif
31
32#ifndef HRTMIN
33#define HRTMIN(a, b) (((a) < (b)) ? (a) : (b))
34#endif
35
36#ifndef HRTMAX
37#define HRTMAX(a, b) (((a) > (b)) ? (a) : (b))
38#endif
39
40
41typedef unsigned int hive_bool;
42#define hive_false 0
43#define hive_true 1
44
45typedef char hive_int8;
46typedef short hive_int16;
47typedef int hive_int32;
48typedef long long hive_int64;
49
50typedef unsigned char hive_uint8;
51typedef unsigned short hive_uint16;
52typedef unsigned int hive_uint32;
53typedef unsigned long long hive_uint64;
54
55#define HRT_DATA_WIDTH 32
56#define HRT_ADDRESS_WIDTH 64
57#define HRT_DATA_BYTES (HRT_DATA_WIDTH / 8)
58#define HRT_ADDRESS_BYTES (HRT_ADDRESS_WIDTH / 8)
59#define SIZEOF_HRT_REG (HRT_DATA_WIDTH >> 3)
60
61typedef hive_uint32 hrt_data;
62typedef hive_uint64 hrt_address;
63
64
65typedef hive_uint64 hive_sim_address;
66
67
68
69typedef unsigned int hive_uint;
70typedef hive_uint32 hive_address;
71typedef hive_address hive_slave_address;
72typedef hive_address hive_mem_address;
73
74
75typedef hive_uint hive_mmio_id;
76typedef hive_mmio_id hive_slave_id;
77typedef hive_mmio_id hive_port_id;
78typedef hive_mmio_id hive_master_id;
79typedef hive_mmio_id hive_mem_id;
80typedef hive_mmio_id hive_dev_id;
81typedef hive_mmio_id hive_fifo_id;
82
83typedef hive_uint hive_hier_id;
84typedef hive_hier_id hive_device_id;
85typedef hive_device_id hive_proc_id;
86typedef hive_device_id hive_cell_id;
87typedef hive_device_id hive_host_id;
88typedef hive_device_id hive_bus_id;
89typedef hive_device_id hive_bridge_id;
90typedef hive_device_id hive_fifo_adapter_id;
91typedef hive_device_id hive_custom_device_id;
92
93typedef hive_uint hive_slot_id;
94typedef hive_uint hive_fu_id;
95typedef hive_uint hive_reg_file_id;
96typedef hive_uint hive_reg_id;
97
98
99typedef hive_uint hive_outport_id;
100typedef hive_uint hive_inport_id;
101
102typedef hive_uint hive_msink_id;
103
104
105typedef char *hive_program;
106typedef char *hive_function;
107
108#endif
109