Changeset 430 for branches/thune
- Timestamp:
- 07/08/07 05:51:41 (17 months ago)
- Location:
- branches/thune/thread_safe
- Files:
-
- 3 modified
-
component.c (modified) (7 diffs)
-
component.h (modified) (1 diff)
-
doc/UserManual (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/thune/thread_safe/component.c
r429 r430 39 39 int* counter; 40 40 UAtom atom; 41 uint32_t special = 0; 41 42 42 43 … … 60 61 *counter = *counter + 1; 61 62 } 63 else if( ur_is(it, UT_SELECT) ) 64 { 65 if( ur_atom(it) >= UT_BI_COUNT ) 66 { 67 if( ur_selIsAtom(it) && (counter == &inC) ) 68 { 69 const char* str = ur_atomCStr( ur_sel(it), 0 ); 70 if( *str == 'q' ) 71 special |= 1 << inC; // Quiet 72 else if( *str == 's' ) 73 special |= 0x10000 << inC; // Strobe 74 } 75 *counter = *counter + 1; 76 } 77 } 62 78 ++it; 63 79 } … … 75 91 while( it != end ) 76 92 { 77 if( ur_is(it, UT_WORD) )93 if( ur_is(it, UT_WORD) || ur_is(it, UT_SELECT) ) 78 94 { 79 95 atom = ur_atom(it); … … 94 110 ++it; 95 111 ur_initType( it, UT_COORD ); // component-counts 96 it->coord.len = 4;112 it->coord.len = 6; 97 113 ur_ccIn(it) = inC; 98 114 ur_ccOut(it) = outC; 99 115 ur_ccLoc(it) = localC; 100 116 ur_ccMask(it) = 0xffff << inC; 117 ur_ccSpec(it) = special; 101 118 ++it; 102 119 ur_copyCell( it, *bodCell ); // component-body … … 120 137 121 138 139 /* 140 (sig body -- comp) 141 */ 122 142 UR_CALL( uc_component ) 123 143 { … … 398 418 UCell* val; 399 419 int trigger; 420 uint32_t mask; 421 uint32_t special; 400 422 401 423 if( wrdN < COMPONENT_CELLS ) … … 412 434 ur_copyCell( val, *nval ); 413 435 436 mask = 0x10001 << wrdN; 437 special = ur_ccSpec(plugCnts) & mask; 438 414 439 trigger = ur_ccMask(plugCnts); 415 440 if( trigger != -1 ) 416 441 { 417 trigger |= (1 << wrdN); 418 ur_ccMask(plugCnts) = trigger; 442 trigger |= mask; 443 444 if( special < 0x10000 ) // Not Strobe 445 ur_ccMask(plugCnts) = trigger; 446 419 447 if( trigger != -1 ) 420 448 return; 421 449 } 450 451 if( special & 0xffff ) // Quiet 452 return; 422 453 423 454 // All inputs are set; add to execute list... -
branches/thune/thread_safe/component.h
r428 r430 14 14 15 15 // Component Count Accessors 16 #define ur_ccIn(cell) (cell)->coord.elem[0] 17 #define ur_ccOut(cell) (cell)->coord.elem[1] 18 #define ur_ccLoc(cell) (cell)->coord.elem[2] 19 #define ur_ccMask(cell) (cell)->coord.elem[3] 16 #define ur_ccIn(cell) (cell)->coord.elem[0] 17 #define ur_ccOut(cell) (cell)->coord.elem[1] 18 #define ur_ccLoc(cell) (cell)->coord.elem[2] 19 #define ur_ccMask(cell) (cell)->coord.elem[3] 20 #define ur_ccSpec(cell) (cell)->dt.mask1 20 21 21 22 // LIMIT: ur_ccMask limits number of component inputs to 16. 22 // Could use last int32_t of cell to handle 32.23 23 24 24 -
branches/thune/thread_safe/doc/UserManual
r426 r430 286 286 287 287 c1 probe connect 288 289 290 Quiet Inputs 291 ~~~~~~~~~~~~ 292 293 Inputs can be declared with a */quiet* selector to prevent them from 294 activating the component when set. 295 296 Here is an example component with an enable switch:: 297 298 [in enable/quiet -- out] [enable ift (in 2 mul :out)] component :mul2 299 300 false :mul2/enable ; No activation 301 2 :mul2/in ; Activation, but no output 302 true :mul2/enable ; No activation 303 2 :mul2/in ; Activation with output 304 305 306 Strobe Inputs 307 ~~~~~~~~~~~~~ 308 309 A single input can be declared with a */strobe* selector. This input will 310 then control when the component activates. No other input will cause an 311 activation. 288 312 289 313
