comparison kernel.rhope @ 99:e09c2d1d6d5b

Got dataflow graph code working in compiler (nworker_c.rhope)
author Mike Pavone <pavone@retrodev.com>
date Fri, 06 Aug 2010 01:42:37 -0400
parents a34a982ecd32
children f51c4c17457c
comparison
equal deleted inserted replaced
98:a34a982ecd32 99:e09c2d1d6d5b
14 Blueprint Boolean 14 Blueprint Boolean
15 { 15 {
16 Val(Int32,Naked) 16 Val(Int32,Naked)
17 } 17 }
18 18
19 String@Boolean[b:out]
20 {
21 If[b]
22 { out <- "Yes" }
23 { out <- "No" }
24 }
25
19 /* 26 /*
20 Blueprint Blueprint 27 Blueprint Blueprint
21 { 28 {
22 Val(Blueprint,Naked) 29 Val(Blueprint,Naked)
23 }*/ 30 }*/
206 } 213 }
207 214
208 Get Input@Worker[worker(Worker),bindex(Int32):val,not populated] 215 Get Input@Worker[worker(Worker),bindex(Int32):val,not populated]
209 { 216 {
210 index <- [bindex]Trunc Int16 217 index <- [bindex]Trunc Int16
211 ,not populated <- If[_internal_worker_hasinput[worker,index]] 218 ,not populated <- If[[index]<[[worker]Size >>]]
212 { 219 {
213 val <- _internal_worker_getinput[worker,index] 220 ,not populated <- If[_internal_worker_hasinput[worker,index]]
221 {
222 val <- _internal_worker_getinput[worker,index]
223 }
214 } 224 }
215 } 225 }
216 226
217 _Copy Params[source(Worker),dest(Worker),cur(Int16):out(Worker)] 227 _Copy Params[source(Worker),dest(Worker),cur(Int16):out(Worker)]
218 { 228 {
231 } 241 }
232 242
233 Set Input@Worker[worker(Worker),bindex(Int32),val:out(Worker)] 243 Set Input@Worker[worker(Worker),bindex(Int32),val:out(Worker)]
234 { 244 {
235 index <- [bindex]Trunc Int16 245 index <- [bindex]Trunc Int16
246 [worker]Get Input[bindex]
247 { newcount <- Count >>[worker] }
248 { newcount <- [Count >>[worker]]+[1i16] }
236 If[[index] < [[worker]Size >>]] 249 If[[index] < [[worker]Size >>]]
237 { 250 {
238 set <- _internal_worker_setinput[worker, index, val] 251 set <- _internal_worker_setinput[worker, index, val]
239 }{ 252 }{
240 set <- _internal_worker_setinput[ 253 set <- _internal_worker_setinput[
241 _Copy Params[worker, 254 _Copy Params[worker,
242 [ _internal_worker_alloc[[index]+[1i16]] ]Index <<[[worker]Index >>] 255 [ _internal_worker_alloc[[index]+[1i16]] ]Index <<[[worker]Index >>]
243 , 0i16] 256 , 0i16]
244 , index, val] 257 , index, val]
245 } 258 }
246 out <- [set]Count <<[ [[set]Count >>]+[1i16] ] 259 out <- [set]Count <<[newcount]
247 } 260 }
248 261
249 =@Blueprint[left,right:out] 262 =@Blueprint[left,right:out]
250 { 263 {
251 out <- [_internal_blueprint_eq[left,right]]!=[0] 264 out <- [_internal_blueprint_eq[left,right]]!=[0]