The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 17th, 2024, 12:46am
Pages: 1
Send Topic Print
Verilog A model for white noise source (Read 11053 times)
Mayank
Community Fellow
*****
Offline



Posts: 334

Verilog A model for white noise source
Jan 24th, 2010, 10:30pm
 
Hi,
    I am new to verilogA but am trying to write a verilogA model for white noise source...It isn't compiling...

My Code :---

Code:
`include "constants.vams"
`include "disciplines.vams"

module white_noise_source(p, n);
inout p;
inout n;
electrical p;
electrical n;

parameter real T = 200;
parameter real R = 10e3;
parameter real k = 1.38e-23;

V(p,n) <+ white_noise(4*'P_K*T*R,"thermal");

endmodule 



The Compilation error is :--

Error found by spectre during AHDL compile.
   ERROR (VACOMP-2259): "V<<--? (p,n) <+ white_noise(4*'P_K*T*R,"thermal");"
       "/work/rf/white_noise_source/veriloga/veriloga.va", line
       16: syntax error.
   ERROR (VACOMP-1814): Maximum allowable errors exceeded. Exiting AHDL
       compilation....

Could somebody pls explain this / correct this error ?? Or if somebody has already built a white noise source model...could you post it pls. ??

--
mayank.
Back to top
 
 
View Profile   IP Logged
pancho_hideboo
Senior Fellow
******
Offline



Posts: 1424
Real Homeless
Re: Verilog A model for white noise source
Reply #1 - Jan 24th, 2010, 10:37pm
 
Mayank wrote on Jan 24th, 2010, 10:30pm:
   ERROR (VACOMP-2259): "V<<--? (p,n) <+ white_noise(4*'P_K*T*R,"thermal");"
Simply there is a typo.
It has to be :
    V(p, n) <+ white_noise(4*`P_K*T*R, "thermal");
Back to top
 
« Last Edit: Jan 25th, 2010, 1:16am by pancho_hideboo »  
View Profile WWW Top+Secret Top+Secret   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Verilog A model for white noise source
Reply #2 - Jan 25th, 2010, 6:49am
 
Pancho is right about the ' vs `

However, it looks to me that the compiler is actually complaining before that point, perhaps because there is no "analog" before the contribution.

analog
 V(p, n) <+ white_noise(4*`P_K*T*R, "thermal");

or
analog begin
 V(p, n) <+ white_noise(4*`P_K*T*R, "thermal");
end

(you'll need begin/end if you have more than one statement in the analog block)
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.