SpiNNFrontEndCommon  7.4.2
Common support code for user-facing front end systems.
common-typedefs.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 The University of Manchester
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /*
18  * common-typedefs.h
19  *
20  *
21  * SUMMARY
22  * Data type definitions for SpiNNaker Neuron-modelling
23  *
24  * AUTHOR
25  * Dave Lester (david.r.lester@manchester.ac.uk)
26  *
27  * COPYRIGHT
28  * Copyright (c) Dave Lester and The University of Manchester, 2013.
29  * All rights reserved.
30  * SpiNNaker Project
31  * Advanced Processor Technologies Group
32  * School of Computer Science
33  * The University of Manchester
34  * Manchester M13 9PL, UK
35  *
36  * DESCRIPTION
37  *
38  *
39  * CREATION DATE
40  * 10 December, 2013
41  *
42  * HISTORY
43  *
44  * DETAILS
45  * Created on : 10 December 2013
46  * Version : $Revision$
47  * Last modified on : $Date$
48  * Last modified by : $Author$
49  * $Id$
50  *
51  * $Log$
52  *
53  */
54 
58 
59 #ifndef __COMMON_TYPEDEFS_H__
60 #define __COMMON_TYPEDEFS_H__
61 
62 #include <stdint.h>
63 #include <stdbool.h>
64 #include <stdfix.h>
65 #include "stdfix-full-iso.h"
66 
67 // Pseudo-function Declarations
68 
77 
78 #ifndef use
79 #define use(x) do {} while ((x)!=(x))
80 #endif
81 
82 
83 // Define int/uint helper macros to create the correct
84 // type names for int/uint of a particular size.
85 //
86 // This requires an extra level of macro call to "stringify"
87 // the result.
88 
89 #define __int_helper(b) int ## b ## _t
90 #define __uint_helper(b) uint ## b ## _t
94 #define __int_t(b) __int_helper(b)
98 #define __uint_t(b) __uint_helper(b)
99 
100 // Give meaningful names to the common types.
101 // (checking that they haven't already been declared.)
102 
103 #ifndef __SIZE_T__
105 typedef uint32_t size_t;
106 #define __SIZE_T__
107 #endif /*__SIZE_T__*/
108 
109 #ifndef __INDEX_T__
111 typedef uint32_t index_t;
112 #define __INDEX_T__
113 #endif /*__INDEX_T__*/
114 
115 #ifndef __COUNTER_T__
117 typedef uint32_t counter_t;
118 #define __COUNTER_T__
119 #endif /*__COUNTER_T__*/
120 
121 #ifndef __TIMER_T__
123 typedef uint32_t timer_t;
124 #define __TIMER_T__
125 #endif /*__TIMER_T__*/
126 
127 #ifndef __ADDRESS_T__
129 typedef uint32_t* address_t;
130 #define __ADDRESS_T__
131 #endif /*__ADDRESS_T__*/
132 
133 #endif /* __COMMON_TYPEDEFS_H__ */
uint32_t size_t
An unsigned integer used for the size of objects.
uint32_t timer_t
An unsigned integer used to track the simulation time.
uint32_t index_t
An unsigned integer used as an index.
uint32_t * address_t
A generic pointer to a word.
uint32_t counter_t
An unsigned integer used as a counter or iterator.