raghavkmr
Junior Member level 2
- Joined
- Nov 26, 2013
- Messages
- 23
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 194
I have used following code to generate clock (whichever value i pass through task it will create that frequency), but the code only works if i use CLKSEL_global = clksel_local (line no. 23)(i.e. blocking assignment) but that creates delta delay.
how do i generate variable clock without creating delta delay
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 36 37 38 39 40 41 42 43 44 45 46 47 `timescale 1ns/1ps module new(CLK,CLK_OUT); input CLK; output CLK_OUT; and(CLK_OUT,1,CLK); endmodule `timescale 1ns/1ps module tb(); real CLKSEL_global; reg clk; reg CLK7; wire clk_out; new dut(clk,clk_out); task task_CLOCK; input real clksel_local; begin CLKSEL_global = clksel_local; end endtask initial begin CLK7 = 0; forever begin #(500.0/CLKSEL_global) CLK7 = 1; #(500.0/CLKSEL_global) CLK7 = 0; end end always @(CLK7) begin clk = CLK7; end initial begin task_CLOCK(340.0); end initial begin #100 $finish ; end endmodule
how do i generate variable clock without creating delta delay