Hi, I need a help in writing a verilog code for some signals like CLK, CKE, and RESET with their delays.
I have written the code according to my knowledge but there are some conflictions in that.
Iam here attatching the related document along with my code please check it out and suggest me. thank you.
Code:
`timescale 1ns / 1ps
module DDR3_Rst(
clk,
Reset,
cke
);
input clk;
output Reset;
output cke;
reg Reset_i;
reg cke_i;
always@(clk)
begin
if(clk)
begin
#0 Reset_i <= 1'b0;
#44 cke_i <= 1'b1;
end
else
if(!clk)
begin
#200655 Reset_i <= 1'b1;
#189985 cke_i <= 1'b0;
#310162 cke_i <= 1'b1;
end
end
assign Reset = Reset_i;
assign cke = cke_i;
endmodule
Dear
Well I cannot get the clear idea what you are trying to do
But for sure the inclusion of # for timing it will not generate any synthesized result for you.
You have to add some timers and counters that will do the timing for you
Like you want to hold reset low for 200us. What is the clock speed of your clock
If let us assume your clock frequency for the design is 100 kHz...i.e. 10us.
Then you need 20 delays for reset to remain low. You can include timer which will count every clock
after the RESET# gets low and as soon as it gets 20 you signal RESET# to be high...
For that case I guess you also need some Master_reset. Other people can help correcting this idea of mine
What I think (only for reset) it will be like that
• Until the power supplies are stable, maintain RESET# LOW to ensure the outputs
remain disabled (High-Z). After the power is stable, RESET# must be LOW for at least
200μs to begin the initialization process.
• CKE must be LOW 10ns prior to RESET# transitioning HIGH.
• After RESET# transitions HIGH, wait 500μs with CKE LOW.
• After the CKE LOW time, CKE may be brought synchronously HIGH while only NOP
or DES commands are issued. The clock must be present and valid for at least 10ns
(and a minimum of 5 clocks) . After CKE is registered HIGH, it must be
continuously registered HIGH until the full initialization process is complete
With fast FPGAs and e.g. DDR3 RAM, the memory clock may be as high as 500 MHz. The core operating frequency will be however lower in most parts, the design needs to work in multiple clock domains.