Mercurial > cgi-bin > hgwebdir.cgi > PR > Applications > HWSim > HWSim__LPGPU_Arch__HWDef
annotate ContextUnitElem_Activities.c @ 2:f068965d9269
Activity function for the Context Unit Elem
| author | sohan |
|---|---|
| date | Wed, 07 Mar 2012 17:24:57 +0100 |
| parents | |
| children |
| rev | line source |
|---|---|
| sohan@2 | 1 |
| sohan@2 | 2 /* |
| sohan@2 | 3 * Copyright 2011 OpenSourceStewardshipFoundation.org |
| sohan@2 | 4 * Licensed under GNU General Public License version 2 |
| sohan@2 | 5 * |
| sohan@2 | 6 * Author: seanhalle@yahoo.com |
| sohan@2 | 7 * |
| sohan@2 | 8 */ |
| sohan@2 | 9 |
| sohan@2 | 10 #include "HWSim__LPGPU_Arch__HWDef/HWSim__LPGPU_Arch__HWDef.h" |
| sohan@2 | 11 #include ¨contextUnitElem.h¨ |
| sohan@2 | 12 |
| sohan@2 | 13 |
| sohan@2 | 14 //==================================================================== |
| sohan@2 | 15 /*This is the ping-pong element for the Hello World hardware |
| sohan@2 | 16 * |
| sohan@2 | 17 *It has only one kind of activity, which only puts a communication on |
| sohan@2 | 18 * the element's one out-port. |
| sohan@2 | 19 * |
| sohan@2 | 20 *The in-port has only one trigger registered on it, which fires that |
| sohan@2 | 21 * activity. |
| sohan@2 | 22 */ |
| sohan@2 | 23 |
| sohan@2 | 24 #define NO_MSG NULL |
| sohan@2 | 25 #define PORT0 0 |
| sohan@2 | 26 |
| sohan@2 | 27 /* |
| sohan@2 | 28 *Note, the returned value is passed to the timing function |
| sohan@2 | 29 */ |
| sohan@2 | 30 void * |
| sohan@2 | 31 contextUnitElem_SchedulerActivity_behavior( void *_params, HWSimElem *elem ) |
| sohan@2 | 32 { |
| sohan@2 | 33 PingPongParams *params; |
| sohan@2 | 34 params = (PingPongParams *)_params; |
| sohan@2 | 35 // DEBUG( dbgHW, "ping pong activity\n", clone_PingPongParams(params) ); |
| sohan@2 | 36 |
| sohan@2 | 37 // HWSim__send_on_port( NO_MSG, PORT0, elem ); |
| sohan@2 | 38 ContextUnit currentContext; |
| sohan@2 | 39 |
| sohan@2 | 40 currentcontext=elem->state[0]; |
| sohan@2 | 41 |
| sohan@2 | 42 while (currentcontext->FS.PS.ReadyForPipe!=true) |
| sohan@2 | 43 currentcontext++; |
| sohan@2 | 44 /* This port contains Instr+PC+ContextId*/ |
| sohan@2 | 45 //Need to decide the structure of Signals |
| sohan@2 | 46 //Need to take care of boundaries conditions |
| sohan@2 | 47 outPorts[0].lastMsgSent=; |
| sohan@2 | 48 currentcontext++; |
| sohan@2 | 49 } |
| sohan@2 | 50 |
| sohan@2 | 51 HWSimTimeSpan |
| sohan@2 | 52 contextUnitElem_SchedulerActivity_timing( void * dataFromBehaviorFn ) |
| sohan@2 | 53 { |
| sohan@2 | 54 return 10; |
| sohan@2 | 55 } |
