implementation of the main routines for handling paceval in hardware, in particular via an FPGA implementation (annotation: the source code of paceval_fFPGAHandling.cpp can be given to customers to perform specialized handling of the hardware)
More...
#include <time.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "./inc/paceval_fFPGAHandling.h"
|
#define | max(__a, __b) (((__a) > (__b)) ? (__a) : (__b)) |
|
|
__int64 | paceval_cComputation_getIDfromPACEVAL_HANDLE (const PACEVAL_HANDLE handle_pacevalComputation_in) |
|
unsigned long | paceval_cComputation_getNodeData (const PACEVAL_HANDLE handle_pacevalComputation_in, const unsigned long positionNode_in, long *maxValueFields_out, paceval_sFPGANodeData *handle_nodeDataStruct_out, paceval_sFPGANodeCacheStatusForStacks *handle_nodeDataCacheStatusStructs_out) |
|
bool | paceval_cComputation_setFPGAMemoryAllocation (const PACEVAL_HANDLE handle_pacevalComputation_in, void *pointerToFPGAMemory_in) |
|
void * | paceval_cComputation_getFPGAMemoryAllocation (const PACEVAL_HANDLE handle_pacevalComputation_in) |
|
void | paceval_activityStart_FPGA_CreateComputation (const PACEVAL_HANDLE handle_pacevalComputation_in, const unsigned long functionLengthString_in, const unsigned long numberOfVariables_in, const bool useInterval_in) |
|
bool | paceval_activityEnd_FPGA_CreateComputation (const PACEVAL_HANDLE handle_pacevalComputation_in, const unsigned long functionLengthString_in, const unsigned long numberOfVariables_in, const bool useInterval_in, const bool success_in, const unsigned long numberOfNodes_in, const unsigned long numberOfStacks_in) |
|
bool | paceval_activityStart_FPGA_GetComputationResult (const PACEVAL_HANDLE handle_pacevalComputation_in, const paceval_eCalculationPrecisionTypes useCalculationPrecision_in, const unsigned long stackNumber_in) |
|
bool | paceval_activityMain_FPGA_DoComputation (const PACEVAL_HANDLE handle_pacevalComputation_in, const unsigned char computationCircle_in, paceval_eCalculationPrecisionTypes useCalculationPrecision_in, const unsigned long stackNumber_in, const void *variablesValues_in, double *resultAsDouble_out, float *resultAsFloat_out, paceval_eErrorTypes *errorType_out, unsigned long *errorNodePosition_out) |
|
void | paceval_activityMain_FPGA_ResetCachedNodeData (const PACEVAL_HANDLE handle_pacevalComputation_in, const unsigned long stackNumber_in) |
|
void | paceval_activityEnd_FPGA_GetComputationResult (const PACEVAL_HANDLE handle_pacevalComputation_in, const paceval_eCalculationPrecisionTypes useCalculationPrecision_in, const unsigned long stackNumber_in, const bool validResultStandard_in, const void *resultStandard_in, const bool validResultFPGA_in, const void *resultFPGA_in) |
|
void | paceval_activityStart_FPGA_DeleteComputation (const PACEVAL_HANDLE handle_pacevalComputation_in) |
|
implementation of the main routines for handling paceval in hardware, in particular via an FPGA implementation (annotation: the source code of paceval_fFPGAHandling.cpp can be given to customers to perform specialized handling of the hardware)
◆ max
#define max |
( |
| __a, |
|
|
| __b ) (((__a) > (__b)) ? (__a) : (__b)) |
◆ paceval_activityEnd_FPGA_CreateComputation()
bool paceval_activityEnd_FPGA_CreateComputation |
( |
const PACEVAL_HANDLE | handle_pacevalComputation_in, |
|
|
const unsigned long | functionLengthString_in, |
|
|
const unsigned long | numberOfVariables_in, |
|
|
const bool | useInterval_in, |
|
|
const bool | success_in, |
|
|
const unsigned long | numberOfNodes_in, |
|
|
const unsigned long | numberOfStacks_in ) |
this C function is called when a paceval computation object has been created via the paceval library
- Parameters
-
handle_pacevalComputation_in | the pointer to the paceval computation object managed in the paceval library |
functionLengthString_in | the length of the function that is processed via the paceval library |
numberOfVariables_in | the number of variables of the function |
useInterval_in | should interval arithmetic be used (true) or not (false) |
success_in | the creation of the paceval computation object via the paceval library was successful (true) or not (false) |
numberOfNodes_in | the number of nodes of the paceval computation object |
numberOfStacks_in | the maximum number of stacks required for the calculations |
◆ paceval_activityEnd_FPGA_GetComputationResult()
void paceval_activityEnd_FPGA_GetComputationResult |
( |
const PACEVAL_HANDLE | handle_pacevalComputation_in, |
|
|
const paceval_eCalculationPrecisionTypes | useCalculationPrecision_in, |
|
|
const unsigned long | stackNumber_in, |
|
|
const bool | validResultStandard_in, |
|
|
const void * | resultStandard_in, |
|
|
const bool | validResultFPGA_in, |
|
|
const void * | resultFPGA_in ) |
this C function is called when a calculation has been performed on a paceval computation object via the paceval library
- Parameters
-
handle_pacevalComputation_in | the pointer to the paceval computation object managed in the paceval library |
useCalculationPrecision_in | the precision (float or double) with which the calculation should be performed |
stackNumber_in | the stack on which the calculation is to be performed |
validResultStandard_in | indicates whether the result of the standard calculation is valid |
resultStandard_in | the result of the standard calculation (float or double depending on useCalculationPrecision_in) |
validResultFPGA_in | indicates whether the result of the calculation via the FPGA is valid (see especially paceval_activityMain_FPGA_DoComputation()) |
resultFPGA_in | the result of the calculation via the FPGA (float or double depending on useCalculationPrecision_in) |
◆ paceval_activityMain_FPGA_DoComputation()
bool paceval_activityMain_FPGA_DoComputation |
( |
const PACEVAL_HANDLE | handle_pacevalComputation_in, |
|
|
const unsigned char | computationCircle_in, |
|
|
paceval_eCalculationPrecisionTypes | useCalculationPrecision_in, |
|
|
const unsigned long | stackNumber_in, |
|
|
const void * | variablesValues_in, |
|
|
double * | resultAsDouble_out, |
|
|
float * | resultAsFloat_out, |
|
|
paceval_eErrorTypes * | errorType_out, |
|
|
unsigned long * | errorNodePosition_out ) |
This C function is responsible for processing the mathematical calculation on the FPGA
- Parameters
-
handle_pacevalComputation_in | the pointer to the paceval computation object managed in the paceval library |
useCalculationPrecision_in | the precision (float or double) with which the calculation should be performed |
stackNumber_in | the stack on which the calculation is to be performed |
variablesValues_in | the pointer to the values for the variables (float or double depending on useCalculationPrecision_in) |
resultAsDouble_out | the placeholder for the result of the calculation as a double if everything worked |
resultAsFloat_out | the placeholder for the result of the calculation as a float if everything worked |
errorType_out | in case of error, the type of error that occurred (see paceval_eErrorTypes in paceval_main.h) |
errorNodePosition_out | in case of an error, the position of the error that occurred (can be used to report to the user by the paceval library) |
◆ paceval_activityMain_FPGA_ResetCachedNodeData()
void paceval_activityMain_FPGA_ResetCachedNodeData |
( |
const PACEVAL_HANDLE | handle_pacevalComputation_in, |
|
|
const unsigned long | stackNumber_in ) |
this C function is responsible for resetting the invalid cache in case of an abort or error in paceval_activityMain_FPGA_DoComputation() (annotation: this does not affect the cache for constant values)
- Parameters
-
handle_pacevalComputation_in | the pointer to the paceval computation object managed in the paceval library |
stackNumber_in | the stack on which the calculation is to be performed |
◆ paceval_activityStart_FPGA_CreateComputation()
void paceval_activityStart_FPGA_CreateComputation |
( |
const PACEVAL_HANDLE | handle_pacevalComputation_in, |
|
|
const unsigned long | functionLengthString_in, |
|
|
const unsigned long | numberOfVariables_in, |
|
|
const bool | useInterval_in ) |
this C function is called when a paceval computation object is created via the paceval library
- Parameters
-
handle_pacevalComputation_in | the pointer to the paceval computation object managed in the paceval library |
functionLengthString_in | the length of the function that is processed via the paceval library |
numberOfVariables_in | the number of variables of the function |
useInterval_in | should interval arithmetic be used (true) or not (false) |
◆ paceval_activityStart_FPGA_DeleteComputation()
void paceval_activityStart_FPGA_DeleteComputation |
( |
const PACEVAL_HANDLE | handle_pacevalComputation_in | ) |
|
this C function is called when a paceval computation object is deleted via the paceval library (annotation: in particular all allocated memory must be released)
- Parameters
-
handle_pacevalComputation_in | the pointer to the paceval computation object managed in the paceval library |
◆ paceval_activityStart_FPGA_GetComputationResult()
this C function is called when a calculation is to be performed on a paceval computation object via the paceval library
- Parameters
-
handle_pacevalComputation_in | the pointer to the paceval computation object managed in the paceval library |
useCalculationPrecision_in | the precision (float or double) with which the calculation should be performed |
stackNumber_in | the stack on which the calculation is to be performed |
◆ paceval_cComputation_getFPGAMemoryAllocation()
void * paceval_cComputation_getFPGAMemoryAllocation |
( |
const PACEVAL_HANDLE | handle_pacevalComputation_in | ) |
|
fetches an address noted in a paceval computation object to a memory location and the return value is the pointer to the saved memory location or NULL if no memory location has been saved yet
- Parameters
-
handle_pacevalComputation_in | the pointer to the paceval computation object managed in the paceval library |
◆ paceval_cComputation_getIDfromPACEVAL_HANDLE()
__int64 paceval_cComputation_getIDfromPACEVAL_HANDLE |
( |
const PACEVAL_HANDLE | handle_pacevalComputation_in | ) |
|
converts the pointer to a paceval computation object into a 64-bit number that can be used as a reference and the return value is a 64-bit number
- Parameters
-
handle_pacevalComputation_in | the pointer to the paceval computation object managed in the paceval library |
◆ paceval_cComputation_getNodeData()
gets a node of the linked list of a paceval computation object and the return value is the total number of nodes in the list
- Parameters
-
handle_pacevalComputation_in | the pointer to the paceval computation object managed in the paceval library |
positionNode_in | the position in the linked list of nodes to be read |
maxValueFields_out | the maximum field number used in the node |
handle_nodeDataStruct_out | the data structure used to fetch and hold the node contents (see paceval_cCommonData.h) |
handle_nodeDataCacheStatusStructs_out | the data structure used to fetch and hold the cache contents (see paceval_cCommonData.h) |
◆ paceval_cComputation_setFPGAMemoryAllocation()
bool paceval_cComputation_setFPGAMemoryAllocation |
( |
const PACEVAL_HANDLE | handle_pacevalComputation_in, |
|
|
void * | pointerToFPGAMemory_in ) |
remembers the address of a memory location in a temporary calculation object and the return value is true if the function was successful, otherwise the return value is false
- Parameters
-
handle_pacevalComputation_in | the pointer to the paceval computation object managed in the paceval library |
pointerToFPGAMemory_in | the address of the memory location to be remembered on the paceval computation object managed in the paceval library |