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

Abstract out PortList from HWModuleLike #5749

Merged
merged 14 commits into from
Aug 2, 2023
Merged

Conversation

darthscsi
Copy link
Contributor

@darthscsi darthscsi commented Aug 1, 2023

Breaking up #5738

//===------------------------------------------------------------------===//
// PortList Methods
//===------------------------------------------------------------------===//
::circt::hw::ModulePortInfo getPortList();
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this redundant? I would imagine this method is already declared via DeclareOpInterfaceMethods<HWModuleLike>.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not. And if it were, it would be a compile error (duplicate definition).

Copy link
Contributor

Choose a reason for hiding this comment

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

true

Copy link
Contributor

@teqdruid teqdruid left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -29,6 +29,7 @@ include "mlir/Interfaces/SideEffectInterfaces.td"
/// the module-like operations.
class HWModuleOpBase<string mnemonic, list<Trait> traits = []> :
HWOp<mnemonic, traits # [
DeclareOpInterfaceMethods<PortList>,
DeclareOpInterfaceMethods<HWModuleLike>,
DeclareOpInterfaceMethods<HWMutableModuleLike>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok... Having all three of these is redundant, right? HWMutableModuleLike should be enough, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not entirely sure, but it seemed in some tests that interface inheritance didn't obviously connect to the declaring methods. I was also able to get weird (invalid) stuff out of tblgen, so I'm not sure this feature is heavily tested yet.

@darthscsi darthscsi merged commit b8cb1a7 into main Aug 2, 2023
5 checks passed
@darthscsi darthscsi deleted the dev/darthscsi/portlist branch April 11, 2024 17:14
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