The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 12:34am
Pages: 1
Send Topic Print
user-defined disciplines and natures (Read 796 times)
engelbrl
New Member
*
Offline



Posts: 8
Oregon State University
user-defined disciplines and natures
May 05th, 2008, 1:27pm
 
I'm very new to Verilog-AMS and am working in nanomagnetics.  I'm trying to develop  Verilog-A models for some nanomagnetic devices (like a spin valve) and am stumbling on the discipline/nature declaration. I have read through the VerilogAMS LRM and searched through Ken Kundert's AMS book and can not see/find what is my syntax error.  Here is an example model followed by the SpectreHDL compile error message:

// VerilogA for vlogA, write_line, veriloga

`include "constants.vams"
`include "disciplines.vams"

discipline magneticfield
     potential Mfield ;
enddiscipline

nature Mfield
units = "A/m" ;
access = H ;
abstol = 1n ;
endnature

module write_line(inp,inn,hout);
input inp, inn ;
electrical inp, inn ;
output hout ;
magneticfield hout ;

parameter real res = 1.0 ;
parameter real w = 1.0u ;

analog begin
     H(hout) <+ I(inp,inn)/(2*w) ;
end

endmodule

Error message:
Error found by spectre during SpectreHDL compile.
"..... line 7: "potential Mfield <<--? ;"
"..... line 7: Error: syntax error
"..... line 20: "magneticfield hout <<--? ;"
"..... line 20: Error: syntax error

I'm sure it's simple, but I've wasted too much time already - what am I doing wrong????

Thanks for the help, Undecided
Back to top
 
 

linda
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: user-defined disciplines and natures
Reply #1 - May 5th, 2008, 2:11pm
 
Have you tried moving the declaration of the nature to before the discipline so that Mfield is defined before it is used?

-Ken
Back to top
 
 
View Profile WWW   IP Logged
engelbrl
New Member
*
Offline



Posts: 8
Oregon State University
Re: user-defined disciplines and natures
Reply #2 - May 5th, 2008, 10:40pm
 
Thanks Mr. Kundert,

I will put the nature declaration before the discipline declaration - I don't remember seeing anything about a necessary order; I just thought the information from the various declarations was sorted at compile time...  hopefully it will work!

*Thanks so much*
Back to top
 
 

linda
View Profile   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.