Commit 4ca53c06 authored by Antonia Francis's avatar Antonia Francis

* Gqueue test finished with full documentation and 100% coverage

parent 4deeb350
......@@ -88,6 +88,20 @@ sent, but the previous one (inferior by 1). assert (reception !=
sent_level ); assert (reception == sent_level - 1); The other port
constitutes a control assay.
Test Sporadic 6 :
These tests are used to verify the behavior when working with IN DATA PORTS
and not IN EVENT DATA PORTS. It allows us to get a coverage of 100% of the code
with this test file.
Initially we verify that the reception has been done well.
First we use a get_value function, and then a next_value before verifying that
a get_count on a IN DATA PORT always gives back the value 1 and an used_size
always giving back the value 0.
Thay behavior awaited is illustrated by Beware Warnings.
We try a get_value on an empty port and finally we dequeue the event
sent from Period Port P2 to Sporad Port P1 to trigger the sporadic task.
## Periodic Test details
Each time messages are sent by the periodic task and received by itself.
......@@ -124,8 +138,13 @@ Test Periodic 2 :
This time two messages are as well sent to the periodic task to itself.
The goal is to verify whether, if the queue is full, an error message is well sent.
We set up a reception port with a size of 1 and we sent 2 messages to this port.
If a message is printed, then the test is passed.
The user is able to see it itself on the console.
The goal is to verify whether, if the queue is full, only a message is received
and it is the first one.The transport file must send an error message and prevent
the sending of the file.
The goal is then to verify whether the store_in function is also blocked
when the queue of the destined port isfull.
In both cases we verify that the message first sent is not erased by the other ones,
respectively supposedly not transmitted and not stored_in.
If messages are printed, then the test is passed.
In another hand, the goal is to verify that a get_value on an output port
gives right back an error message.
......@@ -17,6 +17,7 @@ public
P4 : in event data port int { Queue_Size => 42;};
P5 : out event data port int;
P6 : in event data port int {Queue_Size => 1;};
P7 : out data port int; -- XXX
properties
Dispatch_Protocol => Periodic;
Period => 1000 ms;
......@@ -31,9 +32,8 @@ public
thread Spo1
features
P1 : in event data port int { Queue_Size => 42;};
P2 : in event data port int { Queue_Size => 42;};
P3 : out event data port Int;
P4 : in event data port int { Queue_Size => 42;};
P2 : in event data port int { Queue_Size => 42;};
P3 : in data port int;
properties
Dispatch_Protocol => Sporadic; -- Concurrency configuration
Period => 100 ms;
......@@ -56,9 +56,9 @@ public
connections
C1 : port Per_thread.P2 -> Spo_thread.P1;
C2 : port Per_thread.P1 -> Spo_thread.P2;
C3 : port Spo_thread.P3 -> Spo_thread.P4;
C4 : port Per_thread.P3 -> Per_thread.P4;
C5 : port Per_thread.P5 -> Per_thread.P6;
C3 : port Per_thread.P3 -> Per_thread.P4;
C4 : port Per_thread.P5 -> Per_thread.P6;
C5 : port Per_thread.P7 -> Spo_thread.P3;
end Torture_Software.impl;
......
......@@ -13,6 +13,7 @@
#include <po_hi_transport.h>
#include <po_hi_gqueue.h>
#include <po_hi_returns.h>
/*****************************************************************************/
/* Helper macros to access AADL entities */
......@@ -36,36 +37,53 @@ void test_sporad_2(__po_hi_task_id self);
void test_sporad_3(__po_hi_task_id self);
void test_sporad_4(__po_hi_task_id self);
void test_sporad_5(__po_hi_task_id self);
void test_sporad_6(__po_hi_task_id self);
bool init = true;
bool first_iteration = true;
int number = 0;
/*
* Integers allowing to count the events pending on each port
*/
int count_p1;
int count_p2;
int count_p3;
int count_p4;
int count_p5;
int count_p6;
int count_output;
/*
* Declarations of port used in the connections.
*/
__po_hi_local_port_t port_p1 = LOCAL_PORT (spo_thread,p1);
__po_hi_local_port_t port_p2 = LOCAL_PORT (spo_thread,p2);
__po_hi_local_port_t port_p3 = LOCAL_PORT (spo_thread,p3);
__po_hi_local_port_t port_p4 = LOCAL_PORT (per_thread,p4);
__po_hi_local_port_t port_p3 = LOCAL_PORT (per_thread,p3);
__po_hi_local_port_t port_p5 = LOCAL_PORT (per_thread,p5);
__po_hi_local_port_t port_p6 = LOCAL_PORT (per_thread,p6);
__po_hi_local_port_t port_output = LOCAL_PORT (per_thread, p5);
/*
* Semaphore used to coordinate the period and sporad tasks : At the
* end of the first battery of test (number of message == 1), a
* sem_post is done which liberates a sem_wait. The number of
* messages is increased by one.
* messages is increased by one for the second test.
*/
sem_t *semaphore;
/*****************************************************************************/
/*********************************************************************************************************************************************/
/*
* Periodic task receiving and sending messages depending on the case.
*/
void period(__po_hi_task_id self) {
int i, j;
#if defined (TEST_VERBOSE)
printf("Number of port_p1 = %d, port_p2 = %d, port_p3 = %d, port_p4 = %d, port_p6 = %d, port_output= %d\n", port_p1, port_p2, port_p3, port_p4, port_p6, port_output);
#endif
if (init == true){
semaphore = sem_open("/aadl", O_CREAT|O_EXCL, S_IRUSR | S_IWUSR, 1);
if (semaphore == NULL) {
......@@ -79,7 +97,12 @@ void period(__po_hi_task_id self) {
*** "number" iterations *** */
if (first_iteration){
sem_wait(semaphore);
printf("\n**** Starting Tests **** \n");
if (number < 4){
printf("\n\n**** Starting Tests **** \n");
}
if (number == 4){
printf("\n**** Ending tests **** \n");
}
first_iteration = false;
number++;
}
......@@ -88,8 +111,9 @@ void period(__po_hi_task_id self) {
__po_hi_request_t r2;
/*****************************************************************************/
/* *** Initial Test of the different functions *** */
/* *** SENDING FOR TEST SPORADIC 1 to 4 *** */
/* *** Test of gqueue with one message *** */
if (number < 2){
/* Message sent on Period Port 1 to Sporad port 2 */
sent_lvl = lvl;
......@@ -98,7 +122,7 @@ void period(__po_hi_task_id self) {
lvl++;
#if defined (TEST_VERBOSE)
printf("\n Storeout P1 to P2, task id = %d, port id = %d", self, LOCAL_PORT (per_thread, p1));
printf("\n Storeout Period P1 to Sporad P2, task id = %d, from port id = %d", self, LOCAL_PORT (per_thread, p1));
#endif
__po_hi_gqueue_store_out
......@@ -112,7 +136,7 @@ void period(__po_hi_task_id self) {
r2.PORT_VARIABLE (per_thread,p2) = level;
level++;
#if defined (TEST_VERBOSE)
printf("\n Storeout P2 to P1, task id = %d, port id = %d\n",
printf("\n Storeout Period P2 to Sporad P1, task id = %d, from port id = %d\n",
self, LOCAL_PORT (per_thread, p2));
#endif
__po_hi_gqueue_store_out
......@@ -122,20 +146,22 @@ void period(__po_hi_task_id self) {
}
/*****************************************************************************/
/* *** TEST PERIODIC 1 *** */
/* *** Test of two messages sent on one port *** */
/* Transmission */
count_p4 = __po_hi_gqueue_get_count(self, port_p4);
if ((number == 2)&&(count_p4 == 0)){
printf("\n*** TEST PERIODIC 1 ***\n");
count_p4 = __po_hi_gqueue_get_count(self, port_p4);
assert (count_p4 == 0);
for (i = 1; i <= number; i++){
for (i = 1; i <= number ; i++){
sent_lvl = lvl;
r1.port = REQUEST_PORT (per_thread, p3);
r1.PORT_VARIABLE (per_thread,p3) = lvl;
lvl++;
#if defined (TEST_VERBOSE)
printf("\n Storeout P1 to P2, task id = %d, port id = %d", self, LOCAL_PORT (per_thread, p3));
printf("\n Storeout Period P3 to Period P4, task id = %d, from port id = %d", self, LOCAL_PORT (per_thread, p3));
#endif
__po_hi_gqueue_store_out
(self,
......@@ -145,9 +171,11 @@ void period(__po_hi_task_id self) {
}
assert (count_p4 == 0);
}
/* Reception */
count_p4 = __po_hi_gqueue_get_count(self, port_p4);
if ((number == 2)&&(count_p4 == number)){
if ((number == 2)&&(count_p4 == number )){
__po_hi_request_t request;
int reception;
count_p4 = __po_hi_gqueue_get_count(self, port_p4);
......@@ -158,24 +186,26 @@ void period(__po_hi_task_id self) {
printf("\nfirst request = %d", MACRO_TEST);
printf("\nsent_lvl = %d", sent_lvl);
printf("\nreceived = %d", reception);
printf("\nnumber, j = %d %d\n", number, j);
printf("\nnumber received, j = %d %d\n", number , j);
#endif
assert(reception == sent_lvl - number + j + 1);
__po_hi_gqueue_next_value (self,port_p4);
}
printf ("Two Messages test passed\n");
printf ("two Messages test passed\n");
/* Necessary to launch new tests, otherwise triggered by sporadic if it is involved */
first_iteration = true;
sem_post(semaphore);
}
/*****************************************************************************/
/* *** Test of gqueue error message *** */
/* *** TEST PERIODIC 2 *** */
/* *** Test of gqueue error messages *** */
/* *** Test of get value on an output port error message *** */
/* Transmission */
count_p6 = __po_hi_gqueue_get_count(self, port_p6);
if ((number == 3 )&&(count_p6 == 0)){
printf("\n\n*** TEST PERIODIC 2 ***\n");
if ((number == 3)&&(count_p6 == 0)){
printf("\n*** TEST PERIODIC 2 ***\n");
count_p6 = __po_hi_gqueue_get_count(self, port_p6);
assert (count_p6 == 0);
for (i = 1; i < number ; i++){
......@@ -184,7 +214,7 @@ void period(__po_hi_task_id self) {
r1.PORT_VARIABLE (per_thread,p5) = lvl;
lvl++;
#if defined (TEST_VERBOSE)
printf("\n Storeout P1 to P2, task id = %d, port id = %d", self, LOCAL_PORT (per_thread, p5));
printf("\n Storeout Period P5 to Period P6, task id = %d, from port id = %d", self, LOCAL_PORT (per_thread, p5));
#endif
__po_hi_gqueue_store_out
(self,
......@@ -193,29 +223,110 @@ void period(__po_hi_task_id self) {
__po_hi_send_output (self,REQUEST_PORT(per_thread, p5));
}
}
/* Reception */
count_p6 = __po_hi_gqueue_get_count(self, port_p6);
if ((number == 3)&&(count_p6 == 1)){
printf ("\n*** An error message should appear *** \n\n");
if (number == 3){
/* One message only must have been received */
assert (count_p6 == 1);
__po_hi_request_t request;
int reception;
/* Verifying the only message stored is the one send in the first place */
__po_hi_gqueue_get_value(self,port_p6,&(request));
reception = request.PORT_VARIABLE(per_thread,p6);
assert(reception == sent_lvl - 1);
/* The transport send function blocks the sending of the second message to the FULL port.
* An error message should appear */
printf ("\n*** An error message from TRANSPORT should appear *** \n");
/* When forcing the store_in of a random value on a FULL port,
* An error message must be sent by the store_in function */
__po_hi_gqueue_store_in(self, port_p6, &r1);
printf ("*** A second message from GQUEUE should appear *** \n");
/* Verifying the previous store_in has failed and not overwritten the value */
__po_hi_gqueue_get_value(self,port_p6,&(request));
reception = request.PORT_VARIABLE(per_thread,p6);
assert(reception == sent_lvl - 1);
count_p6 = __po_hi_gqueue_get_count(self, port_p6);
for (j = 0; j < count_p6; j++) {
__po_hi_gqueue_next_value (self,port_p6);
}
printf ("\n*** If so, error message test passed *** \n\n");
first_iteration = true;
sem_post(semaphore);
/* The port is cleaned and at the end of the function, as all ports are flushed, the message will be sent */
printf ("*** If so, 'error message on full queue' test passed *** \n");
/* Trying to reach something on the output port of the case */
int err = __po_hi_gqueue_get_value(self,port_output,&(request));
assert (err == __PO_HI_INVALID);
printf ("*** An error message from GQUEUE should appear *** \n");
printf ("*** If so, 'get value on output port' test passed *** \n");
/* Necessary to launch new tests, otherwise triggered by sporadic if it is involved */
first_iteration = true;
sem_post(semaphore);
}
if (number > 3){
/*****************************************************************************/
/* *** SENDING FOR TEST SPORADIC 5 *** */
/* *** Test of fifo indata *** */
if (number == 4){
/* Dequeuing the message arrived at the new iteration of the function.
* The message couldn't be sent previously because the port was full (cf test periodic 2).
* The line is only present to reset the port to an empty state */
__po_hi_gqueue_next_value (self,port_p6);
count_p6 = __po_hi_gqueue_get_count(self, port_p6);
assert(count_p6 == 0);
/* Transmission towards the fifo indata port */
sent_lvl = lvl;
r1.port = REQUEST_PORT (per_thread, p7);
r1.PORT_VARIABLE (per_thread,p7) = lvl;
lvl++;
#if defined (TEST_VERBOSE)
printf("\n Storeout Period P7 to Sporad P3, task id = %d, from port id = %d", self, LOCAL_PORT (per_thread, p7));
#endif
__po_hi_gqueue_store_out
(self,
LOCAL_PORT (per_thread, p7),
&r1);
/* Adding a send output through P2 "just" to awaken the sporadic task
to process incoming data on its data port */
#if defined (TEST_VERBOSE)
printf("\n Storeout Period P2 to Sporad P1, task id = %d, from port id = %d", self, LOCAL_PORT (per_thread, p1));
#endif
r1.port = REQUEST_PORT (per_thread, p2);
r1.PORT_VARIABLE (per_thread,p2) = lvl;
__po_hi_gqueue_store_out
(self,
LOCAL_PORT (per_thread, p2),
&r1);
}
/*****************************************************************************/
/* *** Getting out of loop *** */
if (number > 4){
sem_unlink("/aadl");
sem_close(semaphore);
exit(0);
}
}
/*****************************************************************************/
/*********************************************************************************************************************************************/
/*
* Sporadic task triggered by received events.
*/
void sporad(__po_hi_task_id self) {
/* Test with one message sent by the Period task */
if (number == 1){
......@@ -230,6 +341,10 @@ void sporad(__po_hi_task_id self) {
/* FIFO test on reception port P2 */
test_sporad_5 (self);
}
if (number == 4){
test_sporad_6 (self);
}
/* Boolean and semaphore launching the next type of test */
first_iteration = true;
......@@ -446,3 +561,35 @@ void test_sporad_5(__po_hi_task_id self) {
printf ("FIFO test on port p2 passed\n");
}
/*****************************************************************************/
void test_sporad_6(__po_hi_task_id self) {
__po_hi_request_t request;
int reception;
printf ("\n*** TEST SPORADIC 6 ****\n");
printf ("*** A warning message from GQUEUE (store_in) should have appeared *** \n");
/* Verifying that the reception has been done well */
__po_hi_gqueue_get_value(self,port_p3,&(request));
reception = request.PORT_VARIABLE(spo_thread,p3);
assert(reception == sent_lvl);
/* Asserting the used_size is always of 0 for indata port */
count_p3 = __po_hi_gqueue_used_size(self, port_p3);
assert(count_p3 == 0);
printf ("*** A warning message from GQUEUE (next_value) should appear *** \n");
__po_hi_gqueue_next_value(self,port_p3);
count_p3 = __po_hi_gqueue_used_size(self, port_p3);
assert(count_p3 == 0);
/* Verifying that the get_count is Still of 1 after dequeuing */
printf ("*** A warning message from GQUEUE (get_count) should appear *** \n");
count_p3 = __po_hi_gqueue_get_count(self, port_p3);
assert (count_p3 == 1);
/* Get_value on an empty port */
__po_hi_gqueue_get_value(self,port_p3,&(request));
/* Dequeuing the event that has served to trigger the sporadic task */
int a = __po_hi_gqueue_next_value (self,port_p1);
assert (a == 1);
printf ("\n*** If so, FIFO INDATA test passed *** ");
}
USER_CFLAGS=-g
USER_CFLAGS=-D__PO_HI_USE_GPROF
COVERAGE=gcov
......@@ -268,6 +268,7 @@ void __po_hi_gqueue_init (__po_hi_task_id id,
assert(__po_hi_gqueues_used_size[id][i] == 0);
assert(__po_hi_gqueues_most_recent_values[id][i].port == __PO_HI_GQUEUE_INVALID_PORT);
if (i > 0){
/* Usually HAS TO be right */
//assert(__po_hi_gqueues_first[id][i] >= 0);
}
}
......@@ -317,7 +318,6 @@ __po_hi_port_id_t __po_hi_gqueue_store_in (__po_hi_task_id id,
__DEBUGMSG ("__po_hi_gqueue_store_in : NULL POINTER\n");
}
#endif
/* Locking only a mutex */
__PO_HI_DEBUG_DEBUG ("\nWaiting on Store_in on task %d, port = %d, size of port = %d\n", id, port,__po_hi_gqueue_get_port_size(id, port));
int result = __po_hi_sem_mutex_wait_gqueue(__po_hi_gqueues_semaphores,id);
......@@ -327,6 +327,7 @@ __po_hi_port_id_t __po_hi_gqueue_store_in (__po_hi_task_id id,
if (__po_hi_gqueue_get_port_size(id,port) == __PO_HI_GQUEUE_FIFO_INDATA)
{
memcpy(ptr,request,sizeof(*request));
__PO_HI_DEBUG_CRITICAL ("[GQUEUE] BEWARE, for a FIFO_INDATA port, the used_size is always at 0 (not augmented in a store_in) task-id=%d, port=%d\n", id, port);
}
else
{
......@@ -386,7 +387,6 @@ __po_hi_port_id_t __po_hi_gqueue_store_in (__po_hi_task_id id,
int rel = __po_hi_sem_release_gqueue(__po_hi_gqueues_semaphores,id);
__DEBUGMSG("GQUEUE_SEM_RELEASE %d %d\n", id, rel);
assert(rel == __PO_HI_SUCCESS);
__DEBUGMSG ("[GQUEUE] store_in completed\n");
#ifdef __PO_HI_GQUEUE_ASSERTIONS
......@@ -460,6 +460,7 @@ int __po_hi_gqueue_get_count( __po_hi_task_id id, __po_hi_local_port_t port)
{
if (__po_hi_gqueue_get_port_size(id,port) == __PO_HI_GQUEUE_FIFO_INDATA)
{
__PO_HI_DEBUG_CRITICAL ("[GQUEUE] BEWARE a FIFO_INDATA port will always have a get_count of 1, even if empty, task-id=%d, port=%d\n", id, port);
return 1; /* data port are always of size 1 */
}
else
......@@ -488,15 +489,21 @@ int __po_hi_gqueue_get_value (__po_hi_task_id id,
* If the port is an OUTPUT, with no value queued, the function returns
* nothing.
*/
if (__po_hi_gqueue_get_port_size(id,port) == 0)
if (__po_hi_gqueue_get_port_size(id,port) == -2)
{
__PO_HI_DEBUG_CRITICAL ("[GQUEUE] OUTPUT PORT, REQUEST NOT SET UP, task-id=%d, port=%d\n", id, port);
__DEBUGMSG("THE PORT IS AN OUTPUT, REQUEST NOT SET UP");
return 0;
/* Releasing only the mutex of the semaphore*/
int rel = __po_hi_sem_mutex_release_gqueue(__po_hi_gqueues_semaphores,id);
__DEBUGMSG("GQUEUE_SEM_MUTEX_RELEASE %d %d\n", id, rel);
assert(rel == __PO_HI_SUCCESS);
return __PO_HI_INVALID;
}
/*
* If the port is an event port, with no value queued, then we block
* the thread.
*/
/* Empty port case 1 : NO FIFO INDATA */
if (__po_hi_gqueue_get_port_size(id,port) != __PO_HI_GQUEUE_FIFO_INDATA)
{
while (__po_hi_gqueues_port_is_empty[id][port] == 1)
......@@ -507,7 +514,8 @@ int __po_hi_gqueue_get_value (__po_hi_task_id id,
assert(res_sem == __PO_HI_SUCCESS);
}
}
if (__po_hi_gqueue_used_size(id,port) == 0)
/* Empty port case 2 : FIFO INDATA */
if ((__po_hi_gqueue_get_port_size(id,port) == __PO_HI_GQUEUE_FIFO_INDATA) && (__po_hi_gqueue_used_size(id,port) == 0))
{
memcpy (request, ptr, sizeof (__po_hi_request_t));
//update_runtime (id, port, ptr);
......@@ -536,7 +544,7 @@ int __po_hi_gqueue_get_value (__po_hi_task_id id,
assert(res == __PO_HI_SUCCESS);
__PO_HI_DEBUG_DEBUG("After get_value for task-id %d , port = %d, offset = %d, woffset = %d, history_offset = %d, history_woffset = %d, port size = %d, fifo size = %d, gqueues adress = %d \n\n", id, port, __po_hi_gqueues_offsets[id][port], __po_hi_gqueues_woffsets[id][port],__po_hi_gqueues_global_history_offset[id],__po_hi_gqueues_global_history_woffset[id], __po_hi_gqueues_sizes[id][port], __po_hi_gqueues_total_fifo_size[id], __po_hi_gqueues[id]);
return 0;
return __PO_HI_SUCCESS;
}
/******************************************************************************/
......@@ -550,11 +558,11 @@ int __po_hi_gqueue_next_value (__po_hi_task_id id, __po_hi_local_port_t port)
__po_hi_port_id_t nb_empty = __po_hi_gqueues_n_empty[id];
#endif
/* incomplete semantics, should discriminate and report whether
/* Incomplete semantics, Should discriminate and report whether
there is a next value or not */
/* XXX change and use assert ? */
if (__po_hi_gqueue_get_port_size(id,port) == __PO_HI_GQUEUE_FIFO_INDATA)
{
__PO_HI_DEBUG_CRITICAL ("[GQUEUE] BEWARE, for a FIFO_INDATA port, the used_size is always at 0 (not reduced in a next_value) task-id=%d, port=%d\n", id, port);
return 1;
}
......
......@@ -80,13 +80,16 @@ long int __po_hi_air_port[__PO_HI_NB_PORTS];
int __po_hi_xtratum_port[__PO_HI_NB_PORTS];
#endif
int __po_hi_transport_send (__po_hi_task_id id, __po_hi_port_t port)
{
__po_hi_request_t* request;
__po_hi_uint8_t ndest;
__po_hi_uint8_t i;
__po_hi_local_port_t local_port;
__po_hi_port_t destination_port;
__po_hi_local_port_t destination_port_local;
__po_hi_entity_t destination_entity;
local_port = __po_hi_get_local_port_from_global_port (port);
......@@ -94,13 +97,13 @@ int __po_hi_transport_send (__po_hi_task_id id, __po_hi_port_t port)
if (request->port == -1)
{
__PO_HI_DEBUG_DEBUG ("Send output task %d, port %d : no value to send\n", id, port);
__PO_HI_DEBUG_DEBUG ("Send output task %d, global port %d : no value to send\n", id, port);
return __PO_HI_SUCCESS;
}
ndest = __po_hi_gqueue_get_destinations_number (id, local_port);
assert(ndest);
__PO_HI_DEBUG_DEBUG ("Send value, emitter task %d, emitter port %d, emitter entity %d, destination ports :\n", id, port, __po_hi_port_global_to_entity[port]);
__PO_HI_DEBUG_DEBUG ("Send value, emitter task %d, emitter port %d, emitter port local %d, emitter entity %d, destination ports list:\n", id, port, local_port, __po_hi_port_global_to_entity[port]);
#if __PO_HI_DEBUG_LEVEL >= __PO_HI_DEBUG_LEVEL_INFO
__DEBUGMSG ("Packet to send: |");
......@@ -119,13 +122,18 @@ int __po_hi_transport_send (__po_hi_task_id id, __po_hi_port_t port)
}
__DEBUGMSG ("|\n");
#endif
for (i=0 ; i < __po_hi_gqueue_get_destinations_number (id, local_port) ; i++)
{
destination_port = __po_hi_gqueue_get_destination (id, local_port, i);
destination_port_local = __po_hi_get_local_port_from_global_port (destination_port);
destination_entity = __po_hi_get_entity_from_global_port (destination_port);
assert(destination_entity != -1);
__PO_HI_DEBUG_DEBUG ("\t%d (entity=%d)", destination_port, destination_entity);
__PO_HI_DEBUG_DEBUG ("Destination number %d, global port \t%d, local port %d, (entity=%d)", i, destination_port, destination_port_local, destination_entity);
if ((__po_hi_gqueue_used_size(id, destination_port_local) == __po_hi_gqueue_get_port_size(id, destination_port_local)) && (__po_hi_gqueue_get_port_size(id, destination_port_local) != __PO_HI_GQUEUE_FIFO_INDATA)){
/* The gqueue on the destination port is full, error message transmitted */
__PO_HI_DEBUG_CRITICAL("[TRANSPORT] QUEUE FULL ON THE DESTINATION PORT, NOT TRANSMITTED, task-id=%d, port=%d", id, destination_port_local);
return __PO_HI_ERROR_QUEUE_FULL;
}
request->port = destination_port;
......@@ -219,7 +227,6 @@ int __po_hi_transport_send (__po_hi_task_id id, __po_hi_port_t port)
(ANY, TRANSPORT_SEND, id, port, destination_port, local_port,
__po_hi_get_local_port_from_global_port (destination_port), request);
#endif
}
request->port = __PO_HI_GQUEUE_INVALID_PORT;
......@@ -231,6 +238,7 @@ int __po_hi_transport_send (__po_hi_task_id id, __po_hi_port_t port)
return __PO_HI_SUCCESS;
}
__po_hi_node_t __po_hi_transport_get_node_from_entity (const __po_hi_entity_t entity)
{
return __po_hi_entity_table[entity];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment