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

applet.interface.ps2_host: convert to nmigen #232

Merged
merged 1 commit into from Nov 15, 2020

Conversation

attie
Copy link
Member

@attie attie commented Nov 12, 2020

Addresses interface.ps2_host item from #150.

@attie attie force-pushed the ps2-nmigen branch 2 times, most recently from 2fb701c to 81acf3e Compare November 12, 2020 18:32
self.in_fifo.w_en.eq(1),
self.in_fifo.w_data.eq(error),
]
with m.If(self.in_fifo.w_rdy):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added this check on w_rdy before advancing state... it wasn't in before, but I figured we'd stand a chance of missing the error counter if it was left out.

If that's wrong, I'll remove it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the very least it should be in a separate commit--there's nothing worse than a "no functional change" commit turning out to introduce a functional change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very true!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I went through the logic again and I think you aren't really fixing it--none of the other FIFO writes check readiness either. IIRC this choice is deliberate on my part (but is definitely sketchy); if you wanted to fix it, you could add a new FSM state (reached when the FIFO is full) that hangs the FSM while inhibiting any bus activity.

Copy link
Member Author

@attie attie Nov 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

none of the other FIFO writes check readiness either

You're quite right... whoops.

I've had a look, and I'm not sure I know enough about the protocol to cleanly implement something safer (e.g: does inhibiting the bus kill off the current request / response, or will it continue after releasing the bus).

I'll drop this patch for the moment, and it can be re-visited if it causes an issue later.

Copy link
Member

@whitequark whitequark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM other than the comment.

@whitequark whitequark merged commit 99fde95 into GlasgowEmbedded:master Nov 15, 2020
@whitequark
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

3 participants