The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Apr 19th, 2024, 9:54pm
Pages: 1
Send Topic Print
Could you explain the meaning of a verilog-AMS code? (Read 1720 times)
ruwan2
Junior Member
**
Offline



Posts: 15

Could you explain the meaning of a verilog-AMS code?
Mar 27th, 2015, 8:39pm
 
Hi,

I come across the following code from verilog-AMS reference book. First of
all, it is found that I have to comment out one of

// wire dnet;


or

// ddiscrete dnet;

in order a verilog-AMS simulation software (SMASH) to work.

What is the meaning of the above two attributes?

It has:

electrical anet;


'dnet' has obvious electrical attribute? I feel that it is weird to have
 
'electrical anet;'


Could you explain it to me?



Thanks,







module a2d(dnet, anet);
input dnet;
output anet;
wire dnet;
ddiscrete dnet;
electrical anet;
real avar;
analog begin
if (dnet === 1'b1)
avar = 5;
else if (dnet === 1'bx)
avar = avar; // hold value
else if (dnet === 1'b0)
avar = 0;
else if (dnet === 1'bz)
avar = 2.5; // high impedance - float value
V(anet) <+ avar;
end
endmodule
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
Massachusetts, USA
Re: Could you explain the meaning of a verilog-AMS code?
Reply #1 - Mar 30th, 2015, 6:10am
 
Shouldn't this be "module d2a" ?

It looks to me to be reading the values from the digital net "dnet" and setting the (analog) value on "anet"

You should really read Section 3.6.2.2, Domain binding, from VAMS LRM 2.4, which gives as examples the disciplines "electrical" and "ddiscrete"
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.