Skip to content

Add the programmable mux#1221

Open
hiddemoll wants to merge 4 commits intomainfrom
hidde/add-programmable-mux
Open

Add the programmable mux#1221
hiddemoll wants to merge 4 commits intomainfrom
hidde/add-programmable-mux

Conversation

@hiddemoll
Copy link
Contributor

What (what did you do)
Add the programmable mux

Why (context, issues, etc.)
Part of #1109

Dear reviewer (anything you'd like the reviewer to pay close attention to?)

AI disclaimer (heads-up for more than inline autocomplete)

TODO

Cross-out any that do not apply

  • Write (regression) test
  • Update documentation, including docs/ -> Will update the docs when I add the Wire Demo
  • Link to existing issue

@hiddemoll hiddemoll force-pushed the hidde/add-programmable-mux branch from e1448d9 to 0aa7c96 Compare March 20, 2026 09:15
Copy link
Contributor

@martijnbastiaan martijnbastiaan left a comment

Choose a reason for hiding this comment

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

Nice work!

I'll work on the endianness!

Comment on lines +22 to +25
{- | A mux which switches its output from input 'A' to input 'B' when the local counter is
'cycle_to_switch' and the device is armed. Once switched the mux cannot switched back
using the registers, but requires a reset.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, this sentence isn't clear to me. Is "switching to" something that takes a cycle? I think I know the answer (no), but perhaps it is less ambiguous to call it first_b_cycle.

, "A" ::: CSignal dom a
, "B" ::: CSignal dom a
)
( "B_RESET" ::: CSignal dom Bool
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
( "B_RESET" ::: CSignal dom Bool
( "B_RESET" ::: Reset dom

or

Suggested change
( "B_RESET" ::: CSignal dom Bool
( "B_ACTIVE" ::: Enable dom

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reset or Enable as a Protocol? That's unheard of. It does make more sense, but I discarded the idea before because I didn't think we'd have Protocol implementations of either of those.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe so!

Copy link
Contributor

Choose a reason for hiding this comment

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

registerWbI
(registerConfig "arm")
{ access = WriteOnly
, description = "Arm the mux to switch on cycle_to_switch. Prevents atomicity issues."
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
, description = "Arm the mux to switch on cycle_to_switch. Prevents atomicity issues."
, description = "Arm the mux to switch on cycle_to_switch. Prevents atomicity issues when writing to cycle_to_switch."

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.

2 participants