These verilog codes are robust enough?

Status
Not open for further replies.

malfunction

Newbie level 6
Joined
Sep 30, 2004
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
110
Hi all,
I have some problem about asynchronization
I want to know if the signal LatchedRxStartFrm in the below codes will work well.

Many thanks


always @ (posedge MRxClk or negedge hresetn)
begin
if(hresetn == 1'b0)
LatchedRxStartFrm <=#Tp 0;
else
//Here, RxStartFrm is triggered by MRxClk and SyncRxStartFrm_q is triggered by hclk
if(RxStartFrm & ~SyncRxStartFrm_q)
LatchedRxStartFrm <=#Tp 1;
else
if(SyncRxStartFrm_q)
LatchedRxStartFrm <=#Tp 0;
end


always @ (posedge hclk or negedge hresetn)
begin
if(hresetn == 1'b0)
SyncRxStartFrm <=#Tp 0;
else
if(LatchedRxStartFrm)
SyncRxStartFrm <=#Tp 1;
else
SyncRxStartFrm <=#Tp 0;
end


always @ (posedge hclk or negedge hresetn)
begin
if(hresetn == 1'b0)
SyncRxStartFrm_q <=#Tp 0;
else
SyncRxStartFrm_q <=#Tp SyncRxStartFrm;
end

always @ (posedge hclk or negedge hresetn)
begin
if(hresetn == 1'b0)
SyncRxStartFrm_q2 <=#Tp 0;
else
SyncRxStartFrm_q2 <=#Tp SyncRxStartFrm_q;
end
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…