dshoter13
Member level 4
- Joined
- Oct 20, 2014
- Messages
- 72
- Helped
- 4
- Reputation
- 8
- Reaction score
- 4
- Trophy points
- 8
- Activity points
- 619
Hi, I'm new to verilog and i'm trying to validate the theory behind a oscillator for TDC purporse.
My goal is to simulate the oscillator (ring topology) for the following scenarios:
- I want it to oscillate when the signal con1 is enable;
- As soon as the signal con1 becames 0, i want it to stop, freezing the state of each "output" (inverter)
Can anyone help me? I can make the oscillation happen, but when the signal con1 arrives, it does extra "oscillations" due to the While loop.
I'm completely new to verilog, so any help is welcome!
I'm sorry for my english.
Thank you all for your attention.
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 //Verilog-AMS HDL for "ADPLL", "work_tb" "verilogams" `timescale 1ns/1ps `include "constants.vams" `include "disciplines.vams" module sgro (con1, vs1, vs2, vs3, vs4, vs5); input con1; output vs1, vs2, vs3, vs4, vs5; reg vs1, vs2, vs3, vs4, vs5; wire con1; initial begin vs1 = 0; vs2 = 0; vs3 = 0; vs4 = 0; vs5 = 0; end always @(con1) begin while(con1 == 1) begin if(con1 == 1) #5.6 vs1 = ~vs5; if(con1 == 1) #5.6 vs2 = ~vs1; if(con1 == 1) #5.6 vs3 = ~vs2; if(con1 == 1) #5.6 vs4 = ~vs3; if(con1 == 1) #5.6 vs5 = ~vs4; end end endmodule
My goal is to simulate the oscillator (ring topology) for the following scenarios:
- I want it to oscillate when the signal con1 is enable;
- As soon as the signal con1 becames 0, i want it to stop, freezing the state of each "output" (inverter)
Can anyone help me? I can make the oscillation happen, but when the signal con1 arrives, it does extra "oscillations" due to the While loop.
I'm completely new to verilog, so any help is welcome!
I'm sorry for my english.
Thank you all for your attention.
Last edited by a moderator: