sohan@2: sohan@2: /* sohan@2: * Copyright 2011 OpenSourceStewardshipFoundation.org sohan@2: * Licensed under GNU General Public License version 2 sohan@2: * sohan@2: * Author: seanhalle@yahoo.com sohan@2: * sohan@2: */ sohan@2: sohan@2: #include "HWSim__LPGPU_Arch__HWDef/HWSim__LPGPU_Arch__HWDef.h" sohan@2: #include ¨contextUnitElem.h¨ sohan@2: sohan@2: sohan@2: //==================================================================== sohan@2: /*This is the ping-pong element for the Hello World hardware sohan@2: * sohan@2: *It has only one kind of activity, which only puts a communication on sohan@2: * the element's one out-port. sohan@2: * sohan@2: *The in-port has only one trigger registered on it, which fires that sohan@2: * activity. sohan@2: */ sohan@2: sohan@2: #define NO_MSG NULL sohan@2: #define PORT0 0 sohan@2: sohan@2: /* sohan@2: *Note, the returned value is passed to the timing function sohan@2: */ sohan@2: void * sohan@2: contextUnitElem_SchedulerActivity_behavior( void *_params, HWSimElem *elem ) sohan@2: { sohan@2: PingPongParams *params; sohan@2: params = (PingPongParams *)_params; sohan@2: // DEBUG( dbgHW, "ping pong activity\n", clone_PingPongParams(params) ); sohan@2: sohan@2: // HWSim__send_on_port( NO_MSG, PORT0, elem ); sohan@2: ContextUnit currentContext; sohan@2: sohan@2: currentcontext=elem->state[0]; sohan@2: sohan@2: while (currentcontext->FS.PS.ReadyForPipe!=true) sohan@2: currentcontext++; sohan@2: /* This port contains Instr+PC+ContextId*/ sohan@2: //Need to decide the structure of Signals sohan@2: //Need to take care of boundaries conditions sohan@2: outPorts[0].lastMsgSent=; sohan@2: currentcontext++; sohan@2: } sohan@2: sohan@2: HWSimTimeSpan sohan@2: contextUnitElem_SchedulerActivity_timing( void * dataFromBehaviorFn ) sohan@2: { sohan@2: return 10; sohan@2: }