drake
1.0.0
|
Go to the source code of this file.
#define drake_platform_stream_create | ( | stream, | |
application | |||
) |
void* (drake_function(application))(size_t id, task_status_t state); \ void (drake_schedule_init(application))(drake_schedule_t*); \ void (drake_schedule_destroy(application))(drake_schedule_t*); \ int (drake_task_number(application))(); \ char* (drake_task_name(application))(size_t); \ drake_platform_stream_create_explicit(stream, PELIB_##CONCAT_2(drake_schedule_init_, application), PELIB_##CONCAT_2(drake_schedule_destroy_, application), PELIB_CONCAT_2(drake_function_, application))
Provides a frontend to create a stream for an application. Generates a call to drake_stream_create_explicit with a pointer to the function to schedule initialization function that corresponds to the application
Definition at line 31 of file platform.h.
typedef struct drake_platform* drake_platform_t |
Abstract type for time measurement
Definition at line 42 of file platform.h.
typedef struct drake_power* drake_power_t |
Abstract type for power measurement and recording
Definition at line 44 of file platform.h.
typedef struct drake_time* drake_time_t |
Abstract type for time measurement
Definition at line 40 of file platform.h.
enum drake_power_monitor |
Descriptor of power quantities to manipulate. DRAKE_POWER_CHIP denotes the pwoer consumption of the whoe chip the caller core is part of. DRAKE_POWER_MEMORY_CONTROLLER is the power consumption of all memory controllers. DRAKE_POWER_CORE is the power of the caller core alone
Definition at line 155 of file platform.h.
void drake_platform_barrier | ( | void * | ) |
Barrier accross all cores involved in the streaming application running
int drake_platform_commit | ( | volatile void * | addr | ) |
Triggers the sending of data written at addr, to the corresponding core. The data may have been sent before the call, but it is guaranteed to have been sent after this function call. It is not guaranteed however, that the recicpient core has received it when the function returns.
void drake_platform_core_disable | ( | drake_platform_t | pt, |
size_t | core | ||
) |
void drake_platform_core_enable | ( | drake_platform_t | pt, |
size_t | core | ||
) |
size_t drake_platform_core_id | ( | ) |
Returns the id of the core calling this function
size_t drake_platform_core_max | ( | ) |
Maximum number of cores the execution platform can offer
size_t drake_platform_core_size | ( | ) |
Returns the number of cores available at the time the streaming program is run. This must match the number of cores in the schedule of the streaming task begin run
Cleans up a drake stream execution platform. Runs after a streaming application is destroyed
void drake_platform_exclusive_begin | ( | ) |
Begins a critical section
void drake_platform_exclusive_end | ( | ) |
Ends a critical section
size_t drake_platform_get_frequency | ( | drake_platform_t | ) |
Returns the current frequency in KHz
float drake_platform_get_voltage | ( | ) |
Returns the current voltage in Volts
drake_platform_t drake_platform_init | ( | void * | ) |
Initializes a drake stream execution platform. Runs before a streaming application is created
void drake_platform_power_begin | ( | drake_power_t | pwr | ) |
Begins power consumption measurement
pwr | Power data structure that holds power data measured and well as all pwoer measurement settings |
Clean up and deallocate the memory associated to a power measurement and recording structure
size_t drake_platform_power_end | ( | drake_power_t | ) |
Stops power consumption measurement
drake_power_t drake_platform_power_init | ( | drake_platform_t | pt, |
size_t | samples, | ||
int | measurement | ||
) |
Initializes a power structure
sample | Maximal number of sample the power structure can hold |
measurement | binary combination of power quantities to measure. For instance, 1 << DRAKE_POWER_CHIP | 1 << DRAKE_POWER_CORE |
FILE* drake_platform_power_printf | ( | FILE * | stream, |
drake_power_t | , | ||
char * | separator | ||
) |
Writes all power quantities measured associated to a time step, in output stream in human-readable manner, one line per time step, all power quantities of a time step in the same line, with a separator
stream | Output stream |
separator | String to write between two power quantities shown in each output line |
FILE* drake_platform_power_printf_cumulate | ( | FILE * | stream, |
drake_power_t | , | ||
int | metrics, | ||
char * | separator | ||
) |
Writes the sum of all power quantities measured associated to a time step, in output stream in human-readable manner, one line per time step, all power quantities of a time step in the same line, with a separator.
stream | Output stream |
metrics | Power quantities to be combined together, for instance 1 << DRAKE_POWER_CHIP | 1 << DRAKE_POWER_CORE |
separator | String to write between two power quantities shown in each output line |
FILE* drake_platform_power_printf_line | ( | FILE * | stream, |
drake_power_t | , | ||
size_t | line, | ||
char * | separator | ||
) |
Writes a unique line of all power quantities measured associated to a time step, in output stream in human-readable manner, one line per time step, all power quantities of a time step in the same line, with a separator
stream | Output stream |
line | line index, starting at 0, of the line to be written |
separator | String to write between two power quantities shown in each output line |
FILE* drake_platform_power_printf_line_cumulate | ( | FILE * | stream, |
drake_power_t | , | ||
size_t | line, | ||
int | metrics, | ||
char * | separator | ||
) |
Writes the sum of all power quantities measured associated to a time step, in output stream in human-readable manner, one line per time step, all power quantities of a time step in the same line, with a separator.
stream | Output stream |
line | line index, starting at 0, of the line to be written |
metrics | Power quantities to be combined together, for instance 1 << DRAKE_POWER_CHIP | 1 << DRAKE_POWER_CORE |
separator | String to write between two power quantities shown in each output line |
void drake_platform_private_free | ( | void * | ) |
Free memory in off-chip private memory of the caller core
void* drake_platform_private_malloc | ( | size_t | size | ) |
Allocate memory in off-chip private memory of the caller core
size_t drake_platform_private_size | ( | ) |
Returns the size in byte of the calling core's allocatable private on-chip memory
int drake_platform_pull | ( | volatile void * | addr | ) |
Fetch data from the core corresponding to the memory address
int drake_platform_set_frequency | ( | int | frequency | ) |
Set the frequency of the caller core
frequency | Frequency in KHz |
int drake_platform_set_frequency_autoscale | ( | int | frequency | ) |
Sets the frequency of the caller core and scales voltage if necessary
frequency | Frequency in KHz |
int drake_platform_set_voltage | ( | float | voltage | ) |
Sets the voltage of the caller core
voltage | Voltage in Volts |
int drake_platform_set_voltage_frequency | ( | drake_platform_t | , |
size_t | frequency | ||
) |
Sets the frequency of the caller core and scales voltage if necessary
frequency | Frequency in KHz |
size_t drake_platform_shared_align | ( | ) |
Returns the size of a memory line in shared memory
void drake_platform_shared_free | ( | volatile void * | addr, |
size_t | core | ||
) |
Deallocates the on-chip communication memory corresponding to the address given. Only the calling cores can see that the memory has been freed. Every core should run this function in the same order using the same parameter. Any implementation must be deterministic.
volatile void* drake_platform_shared_malloc | ( | size_t | size, |
size_t | core | ||
) |
Allocates on-chip communication memory for a given core. Memory allocated is only visible to the calling core. Every core should run this function in the same order using the same parameters. Any implementation must be deterministic.
size | Sice in byte of the memory to be allocated |
core | id of the core for which to allocate memory |
volatile void* drake_platform_shared_malloc_mailbox | ( | size_t | size, |
size_t | core | ||
) |
size_t drake_platform_shared_size | ( | ) |
Returns the size in byte of the calling core's allocatable communication on-chip memory
int drake_platform_sleep | ( | drake_time_t | period | ) |
Makes the caller core to sleep
period | sleep time in milliseconds |
void drake_platform_sleep_disable | ( | drake_platform_t | pt, |
size_t | core | ||
) |
void drake_platform_sleep_enable | ( | drake_platform_t | pt, |
size_t | core | ||
) |
void drake_platform_store_free | ( | void * | ) |
Frees on-chip private memory of the core that call this function
void* drake_platform_store_malloc | ( | size_t | size | ) |
Allocates memory on on-chip private memory of the core that calls this function
int drake_platform_stream_create_explicit | ( | drake_platform_t | stream, |
void(*)(drake_schedule_t *) | schedule_init, | ||
void(*)(drake_schedule_t *) | schedule_destroy, | ||
void *(*)(size_t id, task_status_t status) | task_function | ||
) |
int drake_platform_stream_init | ( | drake_platform_t | stream, |
void * | arg | ||
) |
int drake_platform_time_add | ( | drake_time_t | res, |
drake_time_t | t1, | ||
drake_time_t | t2 | ||
) |
Adds two time quantities and stores the resutl in a time structure
res | Time struction containing the result of t1 + t2 |
t1 | First operand of the time addition |
t2 | Second operand of the time addition |
Allocates a time structure
void drake_platform_time_destroy | ( | drake_time_t | time | ) |
Cleans up and deallocates a time structure
int drake_platform_time_equals | ( | drake_time_t | t1, |
drake_time_t | t2 | ||
) |
Returns 0 if t1 != t2
int drake_platform_time_get | ( | drake_time_t | ) |
Gives the current time in millisecond
time | Abstract type that receives the current time |
int drake_platform_time_greater | ( | drake_time_t | t1, |
drake_time_t | t2 | ||
) |
Returns 0 if t1 <= t2
int drake_platform_time_init | ( | drake_time_t | t, |
double | ms | ||
) |
Inittializes a time structure
ms | Time in millisecond to initialize time structure with |
FILE* drake_platform_time_printf | ( | FILE * | stream, |
drake_time_t | |||
) |
Writes time on output stream from time structure
int drake_platform_time_subtract | ( | drake_time_t | res, |
drake_time_t | t1, | ||
drake_time_t | t2 | ||
) |
Substract two time quantities and stores the result in a time structure
res | Time structure containing the result of t1 - t2 |
t1 | First operand of time subtraction |
t2 | Second operation of time subtraction |
void* drake_remote_addr | ( | void * | addr, |
size_t | core | ||
) |
Returns the memory address in a distant core, that corresponds to an address of the caller core's local communication memory and that can be used to send messages
addr | Address of the caller core's local communication memory |
core | Core id that can directly read of write in the memory address returned |