OpenCores
URL https://opencores.org/ocsvn/async_sdm_noc/async_sdm_noc/trunk

Subversion Repositories async_sdm_noc

[/] [async_sdm_noc/] [branches/] [init/] [common/] [tb/] [procelem.h] - Diff between revs 32 and 33

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 32 Rev 33
Line 11... Line 11...
 
 
 The SystemC processing element.
 The SystemC processing element.
 
 
 History:
 History:
 26/02/2011  Initial version. <wsong83@gmail.com>
 26/02/2011  Initial version. <wsong83@gmail.com>
 30/05/2011  Clean up for opensource. <wsong83@gmail.com>
 31/05/2011  Clean up for opensource. <wsong83@gmail.com>
 
 
*/
*/
 
 
#ifndef PROCELEM_H_
#ifndef PROCELEM_H_
#define PROCELEM_H_
#define PROCELEM_H_
Line 26... Line 26...
 
 
// a function to generate random numbers comply with an exponential distribution with expection exp
// a function to generate random numbers comply with an exponential distribution with expection exp
double rand_exponential(double exp) {
double rand_exponential(double exp) {
  unsigned int rint = rand() % (unsigned int)(1e6);
  unsigned int rint = rand() % (unsigned int)(1e6);
  double rdat = rint * 1.0 / 1e6;
  double rdat = rint * 1.0 / 1e6;
  return (-1 * exp * log(rint));
  return (-1.0 * exp * log(rdat));
}
}
 
 
class ProcElem : public sc_module {
class ProcElem : public sc_module {
 
 
public:
public:

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.