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.

clock with varying phase in verilog

Status
Not open for further replies.

vivek

Member level 4
Joined
May 19, 2005
Messages
69
Helped
10
Reputation
20
Reaction score
1
Trophy points
1,288
Activity points
2,040
verilog phase shift

hi
i have a clock in my design, from which i should get another clock with varying phase diference with the original one. how can i do this in verilog. code need not be synthesisable since this is for a model. the resulting clock should have different phase difference at each cycle compared with the original clock.
thanks in advance
 

verilog phase delay

As you are saying that it need not be synthesizable u can add intra or inter assignment delays with few combinational logic and sequential logic (a flip flop feedbacking it with xor and the original clock
 

how to generate phase shifted clock in verilog

for phase shift, you will need a high frequency clk to generate your original clk and phase-shift clk.
 

clock shifting in verilog

Here it is what ur looking for!
Hope this helps!

Code:
module clk_delay(/*AUTOARG*/
   // Outputs
   clk_out, 
   // Inputs
   clk, delay
   );
   input clk;
   input [31:0] delay;
   output      clk_out;
   reg         clk_out;
   
   always @(clk)
      clk_out <= #(delay) clk;
   
endmodule // clk_delay

module test();
   reg                  clk;                    
   reg [31:0]           delay;               
   wire                 clk_out;              
   clk_delay clk_delay(/*AUTOINST*/
                       // Outputs
                       .clk_out         (clk_out),
                       // Inputs
                       .clk             (clk),
                       .delay           (delay[31:0]));   
   initial begin
      $shm_open("WAVEFORM");
      $shm_probe(test, "AS");
      
      clk = 0;
      delay = 0;
      #1000  delay = 0;
      #1000  delay = 1;
      #1000  delay = 2;
      #1000  delay = 3;
      #1000  delay = 4;
      #1000  delay = 5;
      #1000  delay = 6;
      #1000  $finish;
   end
   always #5 clk = ~clk;
   
endmodule // test
 

phase shift clock generator + verilog

hi nand gates
that method works. i also tried another way. i generated another clock(higher freq) and muxed the two clocks. the results were good
 

Re: phase shift clock generator + verilog

hi nand gates
that method works. i also tried another way. i generated another clock(higher freq) and muxed the two clocks. the results were good


ok, so if we want to generate a clock with parameters like phase, duty high, duty low and which synthetisable, what can we do ?
Any suggestion plz ?
Thank you !
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top