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,