Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Verilog-a code to latch analog voltages

Chinmaye

Advanced Member level 4
Joined
Jan 18, 2016
Messages
112
Helped
0
Reputation
0
Reaction score
1
Trophy points
18
Activity points
883
Dear all,
I am trying to model analog latch in verilog-a but have been unable to do it. The requirement is as follows
It is required to sample an analog value at positive clock cycle of CLK2 and hold the same value even during the negative clock cycle of CLK2.
Any leads??
 

Chinmaye

Advanced Member level 4
Joined
Jan 18, 2016
Messages
112
Helped
0
Reputation
0
Reaction score
1
Trophy points
18
Activity points
883
@cross() does not allow V() inside it. Hence it cannot be used
 

pancho_hideboo

Advanced Member level 5
Joined
Oct 21, 2006
Messages
2,856
Helped
763
Reputation
1,526
Reaction score
716
Trophy points
1,393
Location
Real Homeless
Activity points
17,449
@cross() does not allow V() inside it.
Hence it cannot be used
No.
You can not understand Verilog-A at all.

if V(clk2) >=0 aho = V(in);
@cross(V(clk2), -1) aho = V(in);
V(out) <+ aho;
 
Last edited:

vivekroy

Full Member level 5
Joined
Jan 19, 2019
Messages
245
Helped
100
Reputation
200
Reaction score
97
Trophy points
28
Location
N/A
Activity points
1,660
Dear all,
I am trying to model analog latch in verilog-a but have been unable to do it. The requirement is as follows
It is required to sample an analog value at positive clock cycle of CLK2 and hold the same value even during the negative clock cycle of CLK2.
Any leads??
Look at page 113 of http://www.lumerink.com/docs/VerilogA.pdf

Your exact solution is given!!
 

pancho_hideboo

Advanced Member level 5
Joined
Oct 21, 2006
Messages
2,856
Helped
763
Reputation
1,526
Reaction score
716
Trophy points
1,393
Location
Real Homeless
Activity points
17,449

vivekroy

Full Member level 5
Joined
Jan 19, 2019
Messages
245
Helped
100
Reputation
200
Reaction score
97
Trophy points
28
Location
N/A
Activity points
1,660
Here you go

Code:
// VerilogA code

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

module veriloga_latch(vin,vclk,vout_sampled);
input vin,vclk;
output vout_sampled;
voltage vin, vclk, vout_sampled;
parameter real vdd=1;
real vsample=0;
analog begin
	if (V(vclk)>0.9*vdd) begin
		vsample=V(vin);
	end
	V(vout_sampled) <+ vsample;
	end
	


endmodule
Here is the op:
latch_op.JPG
 
Toggle Sidebar

Part and Inventory Search


Welcome to EDABoard.com

Sponsor

Sponsor

Design Fast


×
Top