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

Allow specification of multiple pack patterns #75

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mkurc-ant
Copy link
Contributor

This PR enhances the PACK attribute support so that multiple pack patterns can be assigned to a wire.

@mkurc-ant
Copy link
Contributor Author

Requires #76 for the CI to pass.

Copy link
Collaborator

@mithro mithro left a comment

Choose a reason for hiding this comment

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

Please rebase and add a test.

@mkurc-ant mkurc-ant force-pushed the multi-pack-pattern branch 2 times, most recently from 98cea53 to d35c699 Compare September 14, 2020 08:34
@mithro
Copy link
Collaborator

mithro commented Sep 23, 2020

@mkurc-ant - I think we can merge this after the doc update?

@mkurc-ant
Copy link
Contributor Author

@mithro Yes. Once docs update is merged I'll add docs to this one.

@mkurc-ant
Copy link
Contributor Author

@mithro I've rebased and updated docs.

@@ -0,0 +1,36 @@
Pack pattern annotation example
Copy link
Collaborator

Choose a reason for hiding this comment

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

Your test examples makes sense. However, I think v2x should be automatically detecting the requirement for a pack-pattern here and then generate these pack pattern names automatically.

A pack pattern is needed anytime there is an "internal pathway" which isn't connected to a top level port. IE
[ ]->A->B->[ ] - the internal signal A->B requires a pack pattern to be generated. I'm pretty sure we should be able to detect these internal only pathways?

In your example we have;

[ ] --> LUT --> MUX ------> [ ]
                 \
                  \-> FF -> [ ]

There are two "internal pathways", they are;

  • LUT -> MUX pathway.
  • LUT -> MUX -> FF pathway.

The names of the pack patterns can easily be generated as <name_of_lut>_<name of mux> and <name_of_lut>_<name of mux>_<name of ff>. (Or some other name.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea is sound. I'm trying to picture a scenario where it wouldn't be applicable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mithro So I've done some thinking and I think that automatic pack-pattern inference won't work in general. I got some corner cases:

First of all V2X is not aware of the whole hierarchy of pb_types. It operates only on a given level at a time. This makes impossible to infer a pack pattern that would span multiple layers of the hierarchy. Such pack patterns will be required when modelling complex architectures like eg. IOB and I/OLOGIC in 7-series. Moreover V2X won't be able to generate a name for it as the name has to be unique throughout the hierarchy.

My second thought: What if there are multiple connections between cells? Specifying pack pattern on both of them would make it effective only when both connections are used. What if it is not the case?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you post actual examples of these?

@mithro
Copy link
Collaborator

mithro commented Nov 19, 2020

@mkurc-ant -- Where are we at with this pull request? Can you rebase?

@mkurc-ant
Copy link
Contributor Author

@mithro I've rebased and re-arranged pack pattern examples/tests.

Copy link
Collaborator

@mithro mithro left a comment

Choose a reason for hiding this comment

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

The forking example @ https://python-symbiflow-v2x--75.org.readthedocs.build/en/75/examples/pack_pattern/forking/README.html shouldn't need (* pack *) attribute right? We can auto-detect that case?

);

// LUT
(* PACK="lut_mux_ff" *)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought we agreed to auto-generate the names?

Copy link
Contributor

@acomodi acomodi Dec 22, 2020

Choose a reason for hiding this comment

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

@mithro I think that the pack feature should have two different ways of working:

  • fully-automated: this would be as you suggested in Rework pack pattern annotation generation #89, and still needs to be implemented. This would be triggered with the (* pack *) attribute and the pack_pattern attribute will be inferred to be equal to the combined names of the cells the net traverses.
  • manual: this is already implemented and enhanced in this PR (which allows to manually define mutliple pack patterns for spefic connections). This would be allowed with the explicit (* PACK=... *) attribute, giving more control to the designer.

Having only a fully-automated way of generating the pack patterns might lead to adding pack patterns where they are not needed. For instance, if the (* pack *) attribute is added to a wire in the top-level module, and the hierarchy spans for multiple levels, we would likely lose the possibility to control the generated-pack patterns.

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.

3 participants