Re: [OpenSTA-users] selecting random data from file
Brought to you by:
dansut
|
From: Dan D. <ddo...@me...> - 2007-08-16 18:42:21
|
Parvinder wrote: |=20 | Hello, | Is it possible to select data randomly from a file?=A0 I doesn't appear= to be the case | out-of-box, if you know of a work around please let me know. |=20 | I created a variable whose source type is file and marked it as "Random= ", when I | try to access the file using the 'generate' command I get an error "invalid operand | type." | Thanks. |=20 | Parvinder Ghotra We accomplished randomized file data grab with this code: ! Data File Randomization Definition Block: ! Integer acquire_loop ! Integer acquireloopnum ( 1 - 5) ! Integer acquireloopnum1 !Generate random loop counter=20 Acquire Mutex "GenLoop" Generate acquireloopnum Set acquireloopnum1 =3D acquireloopnum Release Mutex "GenLoop" ! Add below around the NEXT command within the Acquire Mutex Block ! DO acquire_loop =3D 0, acquireloopnum1=20 ! NEXT Whole_String ! ENDDO ! Grab the next row of data in the related data files all at the same tim= e ACQUIRE MUTEX "data_row_grab" DO acquire_loop =3D 0, acquireloopnum1=20 NEXT <data row> ENDDO SET data_local =3D <data row> RELEASE MUTEX "data_row_grab" =2E..Dan www.mentora.com=20 |