27 int *tuple,
int counter,
29 size_t local_store_size,
30 int num_inputs,
int num_outputs,
int color)
39 prt_assert(counter > 0,
"counter less or equal zero");
61 if (local_store_size > 0) {
124 prt_assert(vdp != NULL,
"inserting in a NULL VDP");
125 prt_assert(channel != NULL,
"inserting a NULL channel");
127 "wrong channel direction");
133 "input channel destination tuple does not match VDP tuple");
136 "inserting channel in occupied input slot");
139 prt_assert(slot >= 0 && slot < vdp->num_inputs,
"slot out of range");
140 vdp->
input[slot] = channel;
147 "output channel source tuple does not match VDP tuple");
150 "inserting channel in occupied output slot");
153 prt_assert(slot >= 0 && slot < vdp->num_outputs,
"slot out of range");
154 vdp->
output[slot] = channel;
179 if (vdp->
input[i] != NULL)
prt_vdp_function_t function
int prt_tuple_compare(void *tuple_a, void *tuple_b)
tuple comparison
prt_vdp_t * prt_vdp_new(int *tuple, int counter, prt_vdp_function_t function, size_t local_store_size, int num_inputs, int num_outputs, int color)
VDP constructor.
struct prt_channel_s ** input
void(* prt_vdp_function_t)(int *, int, struct prt_channel_s **, struct prt_channel_s **, void *, void *)
VDP's function pointer Defines the type of the pointer to the VDP's function.
int prt_vdp_ready(prt_vdp_t *vdp)
Check if a VDP is ready to fire. Only checks established channels. (NULL channels don't prevent firin...
void prt_tuple_delete(int *tuple)
tuple destructor
int prt_channel_empty(prt_channel_t *channel)
Checks if a channel is empty.
Virtual Data Processor (VDP)
void prt_channel_delete(prt_channel_t *channel)
channel destructor
VDP's data channel Implements a data link between a pair of VDPs. Identifies the source and destinati...
void prt_vdp_delete(prt_vdp_t *vdp)
VDP destructor Delete all local output channels. All local input channels are destroyed as output cha...
#define prt_assert(cond, msg)
Virtual Data Processor (VDP) Is uniquely identified by a tuple. Fires for a predefined number of cycl...
enum prt_channel_direction_e prt_channel_direction_t
VDP's data channel direction Identifies the direction of a VDP channel during insertion.
struct prt_thread_s * thread
struct prt_channel_s ** output
void prt_vdp_channel_insert(prt_vdp_t *vdp, prt_channel_t *channel, prt_channel_direction_t direction, int slot)
Insert a new channel into a VDP.