Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

VerilogA Transition Operator

Status
Not open for further replies.
Joined
Jun 14, 2022
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
8
Desired Behaviour:

1655227948395.png


Code:

Code:
module clk_gen(in, out)
input in;
output out;
electrical in, out;

parameter td = 100n;

real rise_abstime;

analog begin
    
    @(cross(V(in) - 900m, +1)) begin
        rise_abstime = $abstime;
    end
    
    @(timer(rise_abstime+td)) begin
        V(out) <+ transition(0, 1.8, 1n)
    end

end



I keep getting an error saying that the transition operator cannot be used nested in a conditional. How else am I supposed to cause a transition at particular point in time???
 

I think you want to do something like this instead:


Code:
module clk_gen(clk_in, clk_out);

input clk_in;
output clk_out;
electrical clk_in, clk_out;
parameter real td = 100n;
real clk_val = 0;
parameter vsup = 1.8;

analog begin
            @ ( cross(V(clk_in) - vsup/2.0, +1) ) begin
            clk_val = vsup;
        end
            @ ( cross(V(clk_in) - vsup/2.0, -1) ) begin
            clk_val = 0;
        end
    

    V(clk_out) <+  transition(clk_val, td, 1n, 1n);

end

endmodule
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top