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

[PyCDE] Add fork, join, and merge channel functions #8011

Merged
merged 3 commits into from
Dec 20, 2024

Conversation

teqdruid
Copy link
Contributor

  • .fork creates two new channels, waits until they are both available, then accepts an input. Also buffer the output channels to avoid combinational loops.
  • Channel.join waits on two channels then creates a message on the one output channel containing a struct with field 'a' equal to input channel A's content and likewise for channel B.
  • Channel.merge funnels two channels together into a single output stream.

This is functionality which really should be handled by the DC dialect but it's not ready for primetime.

@teqdruid teqdruid added the PyCDE Python CIRCT Design Entry API label Dec 19, 2024
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

frontends/PyCDE/src/pycde/types.py:601

  • [nitpick] The parameter name 'validOrEmpty' is unclear. Consider renaming it to 'valid_or_empty' for better readability.
validOrEmpty) -> typing.Tuple["ChannelSignal", "BitsSignal"]:

frontends/PyCDE/src/pycde/signals.py:765

  • The valid_gate signal should be assigned before the unwrap method to ensure that both_ready is properly initialized before being used.
valid_gate = both_ready & valid

frontends/PyCDE/src/pycde/types.py Outdated Show resolved Hide resolved
- <ChannelSignal>.fork creates two new channels, waits until they are
both available, then accepts an input. Also buffer the output channels
to avoid combinational loops.
- Channel.join waits on two channels then creates a message on the one
output channel containing a struct with field 'a' equal to input channel
A's content and likewise for channel B.
- Channel.merge funnels two channels together into a single output
stream.

This is functionality which really should be handled by the DC dialect
but it's not ready for primetime.
@teqdruid teqdruid force-pushed the teqdruid/pycde/esi-advanced branch from 411d6fe to de995b9 Compare December 20, 2024 23:52
@teqdruid teqdruid merged commit 40c2014 into main Dec 20, 2024
2 checks passed
@teqdruid teqdruid deleted the teqdruid/pycde/esi-advanced branch December 20, 2024 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PyCDE Python CIRCT Design Entry API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants