The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> user-defined disciplines and natures
https://designers-guide.org/forum/YaBB.pl?num=1210019272

Message started by engelbrl on May 5th, 2008, 1:27pm

Title: user-defined disciplines and natures
Post by engelbrl on May 5th, 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, :-/

Title: Re: user-defined disciplines and natures
Post by Ken Kundert on 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

Title: Re: user-defined disciplines and natures
Post by engelbrl on 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*

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.