Bit field manipulation.
More...
#include "bit_field.h"
#include "sark.h"
|
#define | __use(x) ((void) (x)) |
| The use macro allows us to "pretend" to use a variable in a function; this is useful if we run with -Wextra set for extra warnings.
|
|
Bit field manipulation.
A bit field is a vector of machine words which is treated as a vector of bits.
For SpiNNaker each machine word is 32 bits, and so a bit_field for each neuron (assuming 256 neurons) would be 8 words long.
The API includes:
There are also support functions for:
- printing
- randomly setting up a bit field
- Author
- Dave Lester (david.nosp@m..r.l.nosp@m.ester.nosp@m.@man.nosp@m.chest.nosp@m.er.a.nosp@m.c.uk), Jamie Knight (knigh.nosp@m.tj@c.nosp@m.s.man.nosp@m..ac..nosp@m.uk)
- Copyright
- Copyright (c) Dave Lester, Jamie Knight and The University of Manchester, 2013. All rights reserved. SpiNNaker Project Advanced Processor Technologies Group School of Computer Science The University of Manchester Manchester M13 9PL, UK
- Date
- 12 December, 2013
◆ __use
#define __use |
( |
|
x | ) |
((void) (x)) |
The use macro allows us to "pretend" to use a variable in a function; this is useful if we run with -Wextra set for extra warnings.
- Parameters
-
x | The name of the argument to mark as used |
◆ print_bit_field_entry()
static void print_bit_field_entry |
( |
uint32_t |
e | ) |
|
|
inlinestatic |
This function prints out an individual word of a bit_field, as a sequence of ones and zeros.
- Parameters
-
[in] | e | The word of a bit_field to be printed. |
◆ print_bit_field_bits()
This function prints out an entire bit_field, as a sequence of ones and zeros.
- Parameters
-
[in] | b | The sequence of words representing a bit_field. |
[in] | s | The size of the bit_field. |
◆ print_bit_field()
This function prints out an entire bit_field, as a sequence of hexadecimal numbers, one per line.
- Parameters
-
[in] | b | The sequence of words representing a bit_field. |
[in] | s | The size of the bit_field. |
◆ random_bit_field()
Generates a random bit_field for testing purposes.
- Parameters
-
[in] | b | The sequence of words representing a bit_field. |
[in] | s | The size of the bit_field. |
◆ bit_field_alloc()
allocates a bit_field_t object
- Parameters
-
[in] | n_atoms | the number of atoms to cover with this bitfield |
- Returns
- the allocated bitfield