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:



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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…