Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ahbl read write fsm missing default and runs 1 timer more than intended #2

Open
M0stafaRady opened this issue Sep 17, 2023 · 0 comments

Comments

@M0stafaRady
Copy link
Contributor

The following FSM misses a default condition and it read and write 1 time after the done signal asserted.

always @*
case(state)
IDLE_STATE: if(TRIG_REG & CTRL_REG_EN)
nstate = RA_STATE;
else
nstate = IDLE_STATE;
RA_STATE: if(M_HREADY) nstate = RD_STATE; else nstate = RA_STATE;
RD_STATE: if(M_HREADY) nstate = WA_STATE; else nstate = RD_STATE;
WA_STATE: if(M_HREADY) nstate = WD_STATE; else nstate = WA_STATE;
WD_STATE: if(M_HREADY) begin
if(done)
nstate = IDLE_STATE;
else
nstate = RA_STATE;
end else nstate = WA_STATE;
endcase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant