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

Update coreir backend to support arrays of mixed direction #274

Merged
merged 1 commit into from Sep 6, 2018

Conversation

leonardt
Copy link
Collaborator

@leonardt leonardt commented Sep 6, 2018

Addresses #241 (comment)

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1068

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 70.459%

Totals Coverage Status
Change from base Build 1066: -0.01%
Covered Lines: 3344
Relevant Lines: 4746

💛 - Coveralls

@@ -275,7 +269,7 @@ def compile_definition_to_module_definition(self, definition, module_definition)
def connect_input(self, module_definition, port,
output_ports):
if not port.isinput():
if isinstance(port, TupleType):
if isinstance(port, (TupleType, ArrayType)):
Copy link
Collaborator

Choose a reason for hiding this comment

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

good for now, but is there some more general way of doing this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Any ideas? The idea here is that if a type has mixed directions, we need to descend to its children to check whether there are any inputs that need to be wired. In this case, we just have a tuple of types that have mixed direction children. Maybe we could add a field marking these special types? I think this covers the desired functionality though so I'm not sure what benefit making this more general would provide, or in fact what making it more general even means? Does that mean if we add another type with mixed directionality that it will still work?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good point. I think the key thing is for new types with mixed direction (if such a use case even exists). The most right way to do it is require all types to implement some methods which provide some information about mixed types (or expose some tree like structure so we can generically explore the type hierarchy and reach the leaves). Again, for now it covers our cases. We could say that all such new types are not supported directly in CoreIR anyway so our backend doesn't support them unless you special case it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

One thing is to consider whether these mixed directional types are built on top of array/tuple. If so, this should just work. If not, then I think we should consider this API for determining directionality that types will need to implement.

@rsetaluri rsetaluri merged commit a971efe into master Sep 6, 2018
@rsetaluri rsetaluri deleted the mixed-direction-array branch September 6, 2018 17:02
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