# HG changeset patch # User sohan # Date 1331137497 -3600 # Node ID f068965d926930fbf3f59142d21e5dcfb33c009c # Parent 46c8ea895bffcb1d8a137013b42c6a8076716f13 Activity function for the Context Unit Elem diff -r 46c8ea895bff -r f068965d9269 ContextUnitElem_Activities.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ContextUnitElem_Activities.c Wed Mar 07 17:24:57 2012 +0100 @@ -0,0 +1,55 @@ + +/* + * Copyright 2011 OpenSourceStewardshipFoundation.org + * Licensed under GNU General Public License version 2 + * + * Author: seanhalle@yahoo.com + * + */ + +#include "HWSim__LPGPU_Arch__HWDef/HWSim__LPGPU_Arch__HWDef.h" +#include ¨contextUnitElem.h¨ + + +//==================================================================== +/*This is the ping-pong element for the Hello World hardware + * + *It has only one kind of activity, which only puts a communication on + * the element's one out-port. + * + *The in-port has only one trigger registered on it, which fires that + * activity. + */ + +#define NO_MSG NULL +#define PORT0 0 + +/* + *Note, the returned value is passed to the timing function + */ +void * +contextUnitElem_SchedulerActivity_behavior( void *_params, HWSimElem *elem ) + { + PingPongParams *params; + params = (PingPongParams *)_params; +// DEBUG( dbgHW, "ping pong activity\n", clone_PingPongParams(params) ); + +// HWSim__send_on_port( NO_MSG, PORT0, elem ); + ContextUnit currentContext; + + currentcontext=elem->state[0]; + + while (currentcontext->FS.PS.ReadyForPipe!=true) + currentcontext++; + /* This port contains Instr+PC+ContextId*/ + //Need to decide the structure of Signals + //Need to take care of boundaries conditions + outPorts[0].lastMsgSent=; + currentcontext++; + } + +HWSimTimeSpan +contextUnitElem_SchedulerActivity_timing( void * dataFromBehaviorFn ) + { + return 10; + } \ No newline at end of file