The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 16th, 2024, 4:04pm
Pages: 1
Send Topic Print
How do I force DFF state to zero @ initial step? (Read 2171 times)
gabe
New Member
*
Offline



Posts: 2

How do I force DFF state to zero @ initial step?
Mar 28th, 2007, 5:16pm
 
hi -

I have a non-hidden-state reset DFF (D is always tied high).

I'd like it to come up in zero state, and not go high until the first rising edge of vclk1.

What I've done below (set a flag @ initial_step) does not work.

Does anybody know how to solve this problem?

thanks

Gabe

module d_ff_r(vclk1, vrst, q, qb);
input vclk1, vrst;
output q, qb;
electrical vclk1, vrst, q, qb;
parameter real vlogic_high = 1.8;
parameter real vlogic_low = 0;
parameter real vtrans = 1;
parameter real tdel = 1n from [0:inf);
parameter real trise = 1n from (0:inf);
parameter real tfall = 1n from (0:inf);
integer now1, out1, x;

  analog begin

     now1=0;
     x=1;

     @ ( initial_step ) begin
           x=0;
     now1=1;
     end
     
     @ (cross(V(vclk1)-vtrans,+1)) begin
           now1=1;
     x=1;
     end
     
     @ (cross(V(vrst)-vtrans,-1)) begin
           now1=1;
     x=1;
     end      
     
     y1=((V(vrst)>vtrans) && (x==1));      
     
     out1=idt(0,y1,now1);
     
       V(q) <+ transition( out1 ? vlogic_high:vlogic_low,tdel, trise, tfall );
       V(qb) <+ vlogic_low + vlogic_high - V(q);
     end
endmodule
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: How do I force DFF state to zero @ initial ste
Reply #1 - Mar 28th, 2007, 8:56pm
 
Gabe,
   I have updated the RF dff model on this site to take a parameter that specifies the initial state of the flip flop (http://designers-guide.org/VerilogAMS/rf-models/dff/dff.va). You might try it.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
gabe
New Member
*
Offline



Posts: 2

Re: How do I force DFF state to zero @ initial ste
Reply #2 - Mar 29th, 2007, 8:13am
 
thanks Ken!
Back to top
 
 
View Profile   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.