Re: [OpenSTA-devel] Re: When is Random not random?
Brought to you by:
dansut
|
From: Mark E. <ma...@bo...> - 2006-01-13 17:56:39
|
Wickersham, Peter wrote:
> Ok, so now that I can build, I have added a random number generator
> class based on the Mersenne Twister PRNG. It is fast, uniform, and has a
> long period (iterations before repeating).
>
> However, I have run into issues in actually getting the seed from the
> script set in the code. I reviewed the current code in CECRangeVar and
> CECListVar and it looked like those classes were always ignoring the
> seed and just using a random one to start. So, I decided to test this,
> but I can't seem to get any SEED I set in the script to actually get
> passed into the constuctors for these variable classes. They always get
> 0, which is the default higher in the stack if no seed is specified.
>
> Does anyone know the SCL parsing/compilation pieces enough to help me
> track down where the SEED seems to get lost.
>
try the file varlist.cxx
CECVar * Cvarlist::define_variable(const string& scriptname, const
TRecord * rec, const string& dir, bool use_decl)
...
has the lines
// Extract seed for random values
long seed;
par = rec->param("seed");
if(par == NULL)
seed = 0;
else
seed = par->intVal();
to extract the seed from the TOF
however SCL seem to be generating an ivalue object not "seed"
GenericObjects.odl seem to be expecting an ivalue so the above code
should probably change the literal "seed" to the constant
TParam::stIvalue.
If that still doesn't work I can look a bit further.
Mark
|