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 30 and 32

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

Rev 30 Rev 32
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>
 28/05/2011  Clean up for opensource. <wsong83@gmail.com>
 30/05/2011  Clean up for opensource. <wsong83@gmail.com>
 
 
*/
*/
 
 
#ifndef PROCELEM_H_
#ifndef PROCELEM_H_
#define PROCELEM_H_
#define PROCELEM_H_
 
 
#include "noc_define.h"
#include "define.h"
#include <systemc.h>
#include <systemc.h>
 
 
 
 
// 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_exp(double exp) {
double rand_exponential(double exp) {
  unsigned int rint = rand()%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 * exp * log(rint));
}
}
 
 
class ProcElem : public sc_module {
class ProcElem : public sc_module {

powered by: WebSVN 2.1.0

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