PULSAR  1.0.0
Parallel Ultra Light Systolic Array Runtime
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
prt_vdp.h
Go to the documentation of this file.
1 
11 #ifndef PRT_VDP_H
12 #define PRT_VDP_H
13 
14 #include "prt.h"
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 struct prt_thread_s;
21 struct prt_channel_s;
23 
28 typedef void (*prt_vdp_function_t)(int*, int, struct prt_channel_s**, struct prt_channel_s**, void*, void*);
29 
37 typedef struct prt_vdp_s {
38  struct prt_thread_s *thread; // back pointer to the parent thread
39  int *tuple; // the VDP's tuple
40  int counter; // the VDP's countdown counter
41  int num_inputs; // number of input channels
42  struct prt_channel_s **input; // array of input channels
43  int num_outputs; // number of output channels
44  struct prt_channel_s **output; // array of output channels
45  prt_vdp_function_t function; // VDP's function
46  void *local_store; // VDP's persistent local storage
47  int color; // RGB color for tracing
48 } prt_vdp_t;
49 
51  int *tuple, int counter,
52  prt_vdp_function_t function,
53  size_t local_store_size,
54  int num_inputs, int num_outputs, int color);
58  prt_vdp_t *vdp, struct prt_channel_s *channel,
59  enum prt_channel_direction_e direction, int slot);
61 
62 #ifdef __cplusplus
63 }
64 #endif
65 
66 #endif /* PRT_VDP_H */
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.
Definition: prt_vdp.c:176
int color
Definition: prt_vdp.h:47
struct prt_channel_s ** input
Definition: prt_vdp.h:42
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.
Definition: prt_vdp.h:28
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...
Definition: prt_vdp.c:225
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.
Definition: prt_vdp.c:27
void * local_store
Definition: prt_vdp.h:46
int counter
Definition: prt_vdp.h:40
prt_channel_direction_e
VDP's data channel direction Identifies the direction of a VDP channel during insertion.
Definition: prt_channel.h:47
VDP's data channel Implements a data link between a pair of VDPs. Identifies the source and destinati...
Definition: prt_channel.h:29
void prt_vdp_delete(prt_vdp_t *vdp)
VDP destructor Used for destruction of local VDPs. Destroy all input channels. Destroy all dangling o...
Definition: prt_vdp.c:80
int num_inputs
Definition: prt_vdp.h:41
int num_outputs
Definition: prt_vdp.h:43
Virtual Data Processor (VDP) Is uniquely identified by a tuple. Fires for a predefined number of cycl...
Definition: prt_vdp.h:37
struct prt_vdp_s prt_vdp_t
Virtual Data Processor (VDP) Is uniquely identified by a tuple. Fires for a predefined number of cycl...
void prt_vdp_annihilate(prt_vdp_t *vdp)
VDP annihilator Used for complete annihilation of VDPs that don't belong. Destroy all input channels...
Definition: prt_vdp.c:128
VSA's worker thread Owns a number of VDPs. Knows the communication proxy.
Definition: prt_thread.h:27
struct prt_thread_s * thread
Definition: prt_vdp.h:38
struct prt_channel_s ** output
Definition: prt_vdp.h:44
int * tuple
Definition: prt_vdp.h:39
struct prt_vdp_s * vdp
Definition: prt_channel.h:30