module: clocked_white_noise
description: 
timing_sensitivity: posedge clk
parameters:  int en_noise, double spectral_density, double clk_freq
inputs: bool clk
outputs:  double out
classes:  Rand randg("gauss")
static_variables:  double noise_scale
init:  
if (clk_freq < 1e-30)
  {
   printf("error in 'clocked_white_noise':  clk_freq must be >= 1e-30\n");
   printf("  -> in this case, clk_freq = %5.3e\n", clk_freq);
   exit(1);
  }

noise_scale = spectral_density*sqrt(0.5*clk_freq);
end:  
code:  
if (en_noise == 0)
   out = 0.0;
else
   out = noise_scale*randg.inp();

