The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Apr 19th, 2024, 10:42am
Pages: 1
Send Topic Print
how to use "mixedsignal;" (Read 2122 times)
ruwan2
Junior Member
**
Offline



Posts: 15

how to use "mixedsignal;"
Mar 28th, 2015, 10:32pm
 
Hi,

I see the following code on LRM. I do not see "mixedsignal" defined. Whether "mixedsignal" is a reserved word?

Could you explain it to me?



Thanks,









Code:
module dig_inv(in, out);
input in;
output out;
reg out;
ddiscrete in, out;
always begin
out = #10 ~in;
end
endmodule
module analog_inv(in, out);
input in;
output out;
electrical in, out;
parameter real vth = 2.5;
real outval;
analog begin
if (V(in) > vth)
outval = 0;
else
outval = 5 ;
V(out) <+ transition(outval);
end
endmodule
module ring;
dig_inv d1 (n1, n2);
dig_inv d2 (n2, n3);
analog_inv a3 (n3, n1);
endmodule
connectmodule elect_to_logic(el,cm);
input el;
output cm;
reg cm;
electrical el;
ddiscrete cm;
always
@(cross(V(el) - 2.5, 1))
cm = 1;
always
@(cross(V(el) - 2.5, -1))
cm = 0;
endmodule
connectmodule logic_to_elect(cm,el);
input cm;
output el;
ddiscrete cm;
electrical el;
analog
V(el) <+ transition((cm == 1) ? 5.0 : 0.0);
endmodule
connectrules mixedsignal;
connect elect_to_logic;
connect logic_to_elect;
endconnectrules 

Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: how to use "mixedsignal;"
Reply #1 - Mar 30th, 2015, 11:57am
 
You are defining the name mixedsignal. It should be included as a top-level module when running the simulation so that verilog knows which connect modules to use.

When asking for help, you should make it easier for people to help you by formatting your code so that it is readable. The lack of indenting in your code makes it unnecessarily difficult to read.

-Ken
Back to top
 
 
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.