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