/**\file */ #ifndef SLIC_DECLARATIONS_StreamFMA_H #define SLIC_DECLARATIONS_StreamFMA_H #include "MaxSLiCInterface.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define StreamFMA_DYNAMIC_CLOCKS_ENABLED (0) #define StreamFMA_PCIE_ALIGNMENT (16) /*----------------------------------------------------------------------------*/ /*---------------------------- Interface default -----------------------------*/ /*----------------------------------------------------------------------------*/ /** * \brief Basic static function for the interface 'default'. * * \param [in] ticks_StreamFMAKernel The number of ticks for which kernel "StreamFMAKernel" will run. * \param [in] instream_inAT1 Stream "inAT1". * \param [in] instream_size_inAT1 The size of the stream instream_inAT1 in bytes. * \param [in] instream_inBT1 Stream "inBT1". * \param [in] instream_size_inBT1 The size of the stream instream_inBT1 in bytes. * \param [out] outstream_oDataT3 Stream "oDataT3". * \param [in] outstream_size_oDataT3 The size of the stream outstream_oDataT3 in bytes. * \param [in] lmem_address_MemoryControllerPro0_inAT2 Linear LMem control for "inAT2" stream: base address, in bytes. * \param [in] lmem_arr_size_MemoryControllerPro0_inAT2 Linear LMem control for "inAT2" stream: array size, in bytes. * \param [in] lmem_address_MemoryControllerPro0_inAT3 Linear LMem control for "inAT3" stream: base address, in bytes. * \param [in] lmem_arr_size_MemoryControllerPro0_inAT3 Linear LMem control for "inAT3" stream: array size, in bytes. * \param [in] lmem_address_MemoryControllerPro0_inBT2 Linear LMem control for "inBT2" stream: base address, in bytes. * \param [in] lmem_arr_size_MemoryControllerPro0_inBT2 Linear LMem control for "inBT2" stream: array size, in bytes. * \param [in] lmem_address_MemoryControllerPro0_inBT3 Linear LMem control for "inBT3" stream: base address, in bytes. * \param [in] lmem_arr_size_MemoryControllerPro0_inBT3 Linear LMem control for "inBT3" stream: array size, in bytes. * \param [in] lmem_address_MemoryControllerPro0_oDataT1 Linear LMem control for "oDataT1" stream: base address, in bytes. * \param [in] lmem_arr_size_MemoryControllerPro0_oDataT1 Linear LMem control for "oDataT1" stream: array size, in bytes. * \param [in] lmem_address_MemoryControllerPro0_oDataT2 Linear LMem control for "oDataT2" stream: base address, in bytes. * \param [in] lmem_arr_size_MemoryControllerPro0_oDataT2 Linear LMem control for "oDataT2" stream: array size, in bytes. */ void StreamFMA( uint64_t ticks_StreamFMAKernel, const void *instream_inAT1, size_t instream_size_inAT1, const void *instream_inBT1, size_t instream_size_inBT1, void *outstream_oDataT3, size_t outstream_size_oDataT3, size_t lmem_address_MemoryControllerPro0_inAT2, size_t lmem_arr_size_MemoryControllerPro0_inAT2, size_t lmem_address_MemoryControllerPro0_inAT3, size_t lmem_arr_size_MemoryControllerPro0_inAT3, size_t lmem_address_MemoryControllerPro0_inBT2, size_t lmem_arr_size_MemoryControllerPro0_inBT2, size_t lmem_address_MemoryControllerPro0_inBT3, size_t lmem_arr_size_MemoryControllerPro0_inBT3, size_t lmem_address_MemoryControllerPro0_oDataT1, size_t lmem_arr_size_MemoryControllerPro0_oDataT1, size_t lmem_address_MemoryControllerPro0_oDataT2, size_t lmem_arr_size_MemoryControllerPro0_oDataT2); /** * \brief Basic static non-blocking function for the interface 'default'. * * Schedule to run on an engine and return immediately. * The status of the run can be checked either by ::max_wait or ::max_nowait; * note that one of these *must* be called, so that associated memory can be released. * * * \param [in] ticks_StreamFMAKernel The number of ticks for which kernel "StreamFMAKernel" will run. * \param [in] instream_inAT1 Stream "inAT1". * \param [in] instream_size_inAT1 The size of the stream instream_inAT1 in bytes. * \param [in] instream_inBT1 Stream "inBT1". * \param [in] instream_size_inBT1 The size of the stream instream_inBT1 in bytes. * \param [out] outstream_oDataT3 Stream "oDataT3". * \param [in] outstream_size_oDataT3 The size of the stream outstream_oDataT3 in bytes. * \param [in] lmem_address_MemoryControllerPro0_inAT2 Linear LMem control for "inAT2" stream: base address, in bytes. * \param [in] lmem_arr_size_MemoryControllerPro0_inAT2 Linear LMem control for "inAT2" stream: array size, in bytes. * \param [in] lmem_address_MemoryControllerPro0_inAT3 Linear LMem control for "inAT3" stream: base address, in bytes. * \param [in] lmem_arr_size_MemoryControllerPro0_inAT3 Linear LMem control for "inAT3" stream: array size, in bytes. * \param [in] lmem_address_MemoryControllerPro0_inBT2 Linear LMem control for "inBT2" stream: base address, in bytes. * \param [in] lmem_arr_size_MemoryControllerPro0_inBT2 Linear LMem control for "inBT2" stream: array size, in bytes. * \param [in] lmem_address_MemoryControllerPro0_inBT3 Linear LMem control for "inBT3" stream: base address, in bytes. * \param [in] lmem_arr_size_MemoryControllerPro0_inBT3 Linear LMem control for "inBT3" stream: array size, in bytes. * \param [in] lmem_address_MemoryControllerPro0_oDataT1 Linear LMem control for "oDataT1" stream: base address, in bytes. * \param [in] lmem_arr_size_MemoryControllerPro0_oDataT1 Linear LMem control for "oDataT1" stream: array size, in bytes. * \param [in] lmem_address_MemoryControllerPro0_oDataT2 Linear LMem control for "oDataT2" stream: base address, in bytes. * \param [in] lmem_arr_size_MemoryControllerPro0_oDataT2 Linear LMem control for "oDataT2" stream: array size, in bytes. * \return A handle on the execution status, or NULL in case of error. */ max_run_t *StreamFMA_nonblock( uint64_t ticks_StreamFMAKernel, const void *instream_inAT1, size_t instream_size_inAT1, const void *instream_inBT1, size_t instream_size_inBT1, void *outstream_oDataT3, size_t outstream_size_oDataT3, size_t lmem_address_MemoryControllerPro0_inAT2, size_t lmem_arr_size_MemoryControllerPro0_inAT2, size_t lmem_address_MemoryControllerPro0_inAT3, size_t lmem_arr_size_MemoryControllerPro0_inAT3, size_t lmem_address_MemoryControllerPro0_inBT2, size_t lmem_arr_size_MemoryControllerPro0_inBT2, size_t lmem_address_MemoryControllerPro0_inBT3, size_t lmem_arr_size_MemoryControllerPro0_inBT3, size_t lmem_address_MemoryControllerPro0_oDataT1, size_t lmem_arr_size_MemoryControllerPro0_oDataT1, size_t lmem_address_MemoryControllerPro0_oDataT2, size_t lmem_arr_size_MemoryControllerPro0_oDataT2); /** * \brief Advanced static interface, structure for the engine interface 'default' * */ typedef struct { uint64_t ticks_StreamFMAKernel; /**< [in] The number of ticks for which kernel "StreamFMAKernel" will run. */ const void *instream_inAT1; /**< [in] Stream "inAT1". */ size_t instream_size_inAT1; /**< [in] The size of the stream instream_inAT1 in bytes. */ const void *instream_inBT1; /**< [in] Stream "inBT1". */ size_t instream_size_inBT1; /**< [in] The size of the stream instream_inBT1 in bytes. */ void *outstream_oDataT3; /**< [out] Stream "oDataT3". */ size_t outstream_size_oDataT3; /**< [in] The size of the stream outstream_oDataT3 in bytes. */ size_t lmem_address_MemoryControllerPro0_inAT2; /**< [in] Linear LMem control for "inAT2" stream: base address, in bytes. */ size_t lmem_arr_size_MemoryControllerPro0_inAT2; /**< [in] Linear LMem control for "inAT2" stream: array size, in bytes. */ size_t lmem_address_MemoryControllerPro0_inAT3; /**< [in] Linear LMem control for "inAT3" stream: base address, in bytes. */ size_t lmem_arr_size_MemoryControllerPro0_inAT3; /**< [in] Linear LMem control for "inAT3" stream: array size, in bytes. */ size_t lmem_address_MemoryControllerPro0_inBT2; /**< [in] Linear LMem control for "inBT2" stream: base address, in bytes. */ size_t lmem_arr_size_MemoryControllerPro0_inBT2; /**< [in] Linear LMem control for "inBT2" stream: array size, in bytes. */ size_t lmem_address_MemoryControllerPro0_inBT3; /**< [in] Linear LMem control for "inBT3" stream: base address, in bytes. */ size_t lmem_arr_size_MemoryControllerPro0_inBT3; /**< [in] Linear LMem control for "inBT3" stream: array size, in bytes. */ size_t lmem_address_MemoryControllerPro0_oDataT1; /**< [in] Linear LMem control for "oDataT1" stream: base address, in bytes. */ size_t lmem_arr_size_MemoryControllerPro0_oDataT1; /**< [in] Linear LMem control for "oDataT1" stream: array size, in bytes. */ size_t lmem_address_MemoryControllerPro0_oDataT2; /**< [in] Linear LMem control for "oDataT2" stream: base address, in bytes. */ size_t lmem_arr_size_MemoryControllerPro0_oDataT2; /**< [in] Linear LMem control for "oDataT2" stream: array size, in bytes. */ } StreamFMA_actions_t; /** * \brief Advanced static function for the interface 'default'. * * \param [in] engine The engine on which the actions will be executed. * \param [in,out] interface_actions Actions to be executed. */ void StreamFMA_run( max_engine_t *engine, StreamFMA_actions_t *interface_actions); /** * \brief Advanced static non-blocking function for the interface 'default'. * * Schedule the actions to run on the engine and return immediately. * The status of the run can be checked either by ::max_wait or ::max_nowait; * note that one of these *must* be called, so that associated memory can be released. * * * \param [in] engine The engine on which the actions will be executed. * \param [in] interface_actions Actions to be executed. * \return A handle on the execution status of the actions, or NULL in case of error. */ max_run_t *StreamFMA_run_nonblock( max_engine_t *engine, StreamFMA_actions_t *interface_actions); /** * \brief Group run advanced static function for the interface 'default'. * * \param [in] group Group to use. * \param [in,out] interface_actions Actions to run. * * Run the actions on the first device available in the group. */ void StreamFMA_run_group(max_group_t *group, StreamFMA_actions_t *interface_actions); /** * \brief Group run advanced static non-blocking function for the interface 'default'. * * * Schedule the actions to run on the first device available in the group and return immediately. * The status of the run must be checked with ::max_wait. * Note that use of ::max_nowait is prohibited with non-blocking running on groups: * see the ::max_run_group_nonblock documentation for more explanation. * * \param [in] group Group to use. * \param [in] interface_actions Actions to run. * \return A handle on the execution status of the actions, or NULL in case of error. */ max_run_t *StreamFMA_run_group_nonblock(max_group_t *group, StreamFMA_actions_t *interface_actions); /** * \brief Array run advanced static function for the interface 'default'. * * \param [in] engarray The array of devices to use. * \param [in,out] interface_actions The array of actions to run. * * Run the array of actions on the array of engines. The length of interface_actions * must match the size of engarray. */ void StreamFMA_run_array(max_engarray_t *engarray, StreamFMA_actions_t *interface_actions[]); /** * \brief Array run advanced static non-blocking function for the interface 'default'. * * * Schedule to run the array of actions on the array of engines, and return immediately. * The length of interface_actions must match the size of engarray. * The status of the run can be checked either by ::max_wait or ::max_nowait; * note that one of these *must* be called, so that associated memory can be released. * * \param [in] engarray The array of devices to use. * \param [in] interface_actions The array of actions to run. * \return A handle on the execution status of the actions, or NULL in case of error. */ max_run_t *StreamFMA_run_array_nonblock(max_engarray_t *engarray, StreamFMA_actions_t *interface_actions[]); /** * \brief Converts a static-interface action struct into a dynamic-interface max_actions_t struct. * * Note that this is an internal utility function used by other functions in the static interface. * * \param [in] maxfile The maxfile to use. * \param [in] interface_actions The interface-specific actions to run. * \return The dynamic-interface actions to run, or NULL in case of error. */ max_actions_t* StreamFMA_convert(max_file_t *maxfile, StreamFMA_actions_t *interface_actions); /** * \brief Initialise a maxfile. */ max_file_t* StreamFMA_init(void); /* Error handling functions */ int StreamFMA_has_errors(void); const char* StreamFMA_get_errors(void); void StreamFMA_clear_errors(void); /* Free statically allocated maxfile data */ void StreamFMA_free(void); /* returns: -1 = error running command; 0 = no error reported */ int StreamFMA_simulator_start(void); /* returns: -1 = error running command; 0 = no error reported */ int StreamFMA_simulator_stop(void); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SLIC_DECLARATIONS_StreamFMA_H */