Initial commit.

This commit is contained in:
2017-10-26 19:57:24 +02:00
commit 9ce8b5485d
1090 changed files with 47036 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
#ifndef MOC_INTERNAL_CORE_SPU_H_
#define MOC_INTERNAL_CORE_SPU_H_
#include "../imoc_core.h"
/**
* \addtogroup internal_core
**/
//@{
/**
* @name SPU only
**/
//@{
/**
* Node-handle structure.
*
* \note SPU only
*
* Information each node knowns about himself and the world.
**/
typedef struct moc_node_handle_spu_struct
{
uint8_t rank; /**< rank of node */
uint8_t comm_size; /**< number of overall processes */
uint8_t queue_size; /**< Size of a message-queue */
uint64_t ls_base; /**< Effective address of own local-store */
volatile moc_message_envelope_t* message_queue_base; /**< base-address of own message-queues */
volatile moc_message_status_t* status_array_base; /**< base-address of own message-status-array */
uint64_t buffer_base; /**< base-address of own buffer */
uint32_t buffer_size; /**< size of own buffer */
volatile moc_process_t* moc_process_list; /**< list of all other MOC-processes
(index is rank of process) */
} moc_node_handle_spu_t; /**< typedef of \ref moc_node_handle_spu_struct */
/**
* Information each node knowns about himself and the world.
*
* \note SPU only
**/
moc_node_handle_spu_t node_handle;
//@}
//@}
#endif /*MOC_INTERNAL_CORE_SPU_H_*/
+115
View File
@@ -0,0 +1,115 @@
#ifndef MOC_INTERNAL_GET_DATA_H_
#define MOC_INTERNAL_GET_DATA_H_
#include <stdint.h>
#include "../../moc.h"
/**
* \addtogroup internal_p2p_dma
**/
//@{
/**
* @name SPU-only
**/
//@{
/**
* Internal wrapper-function for a blocking DMA-get operation.
* Data can be of any size, constraints of low-level DMA-functions
* are dealt by this function.
* However data-addresses have to be at least 16-byte aligned.
*
* This function actually always reads a multiple of 16 from the source,
* but copies only size bytes of it to target. This means however that up
* to 15 bytes are read from an invalid location. As it is never written to
* them this should always be safe.
*
* @param target \b in ls-address of buffer
* @param source \b in ea-address of data
* @param size \b in size of data in byte
* @return 0 when success otherwise error-code
**/
int IMOC_get_data(void* target, uint64_t source, uint32_t size);
/**
* Internal wrapper-function for a blocking DMA-put operation.
* Data-size should be a multiple of 16 because of low-level constraints, but
* there is no upper limit of transfer-size.
* Data-addresses have to be at least 16-byte aligned.
*
* This function actually always reads a multiple of 16 from the source, and copies
* it to target. This means however that up to 15 bytes are written to and invalid
* location, so if one wants to use it with invalid sizes precautions have to be taken
* in order to make it safe.
*
* @param source \b in ls-address of data
* @param target \b in ea-address of buffer
* @param size \b in size of data in byte
* @return 0 when success otherwise error-code
**/
int IMOC_put_data(void* source, uint64_t target, uint32_t size);
/**
* Internal wrapper-function for a non-blocking DMA-get operation.
* Data can be of any size, constraints of low-level DMA-functions
* are dealt by this function.
* However data-addresses have to be at least 16-byte aligned.
*
* This function actually always reads a multiple of 16 from the source,
* but copies only size bytes of it to target. This means however that up
* to 15 bytes are read from an invalid location. As it is never written to
* them this should always be safe.
*
* @param target \b in ls-address of buffer
* @param source \b in ea-address of data
* @param size \b in size of data in byte
* @param request \b out request-handle
* @return 0 when success otherwise error-code
**/
int IMOC_iget_data(void* target, uint64_t source, uint32_t size, imoc_dma_request* request);
/**
* Internal wrapper-function for a blocking DMA-put operation.
* Data-size should be a multiple of 16 because of low-level constraints, but
* there is no upper limit of transfer-size.
* Data-addresses have to be at least 16-byte aligned.
*
* This function actually always reads a multiple of 16 from the source, and copies
* it to target. This means however that up to 15 bytes are written to and invalid
* location, so if one wants to use it with invalid sizes precautions have to be taken
* in order to make it safe.
*
* @param source \b in ls-address of data
* @param target \b in ea-address of buffer
* @param size \b in size of data in byte
* @param request \b out request-handle
* @return 0 when success otherwise error-code
**/
int IMOC_iput_data(void* source, uint64_t target, uint32_t size, imoc_dma_request* request);
/**
* Waits till a IMOC_iget_data or IMOC_iput_data is completed.
*
* @param request \b in request-handle
* @return 0 when success otherwise error-code
**/
int IMOC_wait_dma(imoc_dma_request* request);
/**
* Tests if a IMOC_iget_data or IMOC_iput_data is completed.
*
* @param request \b in request-handle
* @param flag \b out true if operation is completed
* @return 0 when success otherwise error-code
**/
int IMOC_test_dma(imoc_dma_request* request, int *flag);
//@}
//@}
#endif /*MOC_INTERNAL_GET_DATA_H_*/