> On Aug. 20, 2014, 4:54 p.m., Nilay Vaish wrote:
> > This patch seems fine.  Is it possible to prevent random() from creeping 
> > back in again?

Besides diligent code reviews...? :-)

I cannot think of a way besides creating a global function rand(), random(), 
std::rand() etc and try and intercept it, but this is very dodgy and not fool 
proof.


- Andreas


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviews.gem5.org/r/2352/#review5280
-----------------------------------------------------------


On Aug. 17, 2014, 10:50 a.m., Andreas Hansson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviews.gem5.org/r/2352/
> -----------------------------------------------------------
> 
> (Updated Aug. 17, 2014, 10:50 a.m.)
> 
> 
> Review request for Default.
> 
> 
> Repository: gem5
> 
> 
> Description
> -------
> 
> Changeset 10312:fbe980a8472c
> ---------------------------
> base: Use the global Mersenne twister throughout
> 
> This patch tidies up random number generation to ensure that it is
> done consistently throughout the code base. In essence this involves a
> clean-up of Ruby, and some code simplifications in the traffic
> generator.
> 
> As part of this patch a bunch of skewed distributions (off-by-one etc)
> have been fixed.
> 
> Note that a single global random number generator is used, and that
> the object instantiation order will impact the behaviour (the sequence
> of numbers will be unaffected, but if module A calles random before
> module B then they would obviously see a different outcome). The
> dependency on the instantiation order is true in any case due to the
> execution-model of gem5, so we leave it as is. Also note that the
> global ranom generator is not thread safe at this point.
> 
> Regressions using the memtest, TrafficGen or any Ruby tester are
> affected and will be updated accordingly.
> 
> 
> Diffs
> -----
> 
>   src/cpu/testers/directedtest/SeriesRequestGenerator.cc 79fde1c67ed8 
>   src/cpu/testers/memtest/memtest.cc 79fde1c67ed8 
>   src/cpu/testers/networktest/networktest.cc 79fde1c67ed8 
>   src/cpu/testers/rubytest/Check.cc 79fde1c67ed8 
>   src/cpu/testers/rubytest/CheckTable.cc 79fde1c67ed8 
>   src/cpu/testers/traffic_gen/generators.cc 79fde1c67ed8 
>   src/cpu/testers/traffic_gen/traffic_gen.cc 79fde1c67ed8 
>   src/mem/ruby/buffers/MessageBuffer.cc 79fde1c67ed8 
>   src/mem/ruby/common/NetDest.hh 79fde1c67ed8 
>   src/mem/ruby/common/NetDest.cc 79fde1c67ed8 
>   src/mem/ruby/common/Set.hh 79fde1c67ed8 
>   src/mem/ruby/common/Set.cc 79fde1c67ed8 
>   src/mem/ruby/network/simple/PerfectSwitch.cc 79fde1c67ed8 
>   src/mem/ruby/slicc_interface/RubySlicc_Util.hh 79fde1c67ed8 
>   src/mem/ruby/system/RubyMemoryControl.cc 79fde1c67ed8 
> 
> Diff: http://reviews.gem5.org/r/2352/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andreas Hansson
> 
>

_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to