{"action":"created","issue":{"url":"https://api.github.com/repos/freechipsproject/chisel3/issues/800","repository_url":"https://api.github.com/repos/freechipsproject/chisel3","labels_url":"https://api.github.com/repos/freechipsproject/chisel3/issues/800/labels{/name}","comments_url":"https://api.github.com/repos/freechipsproject/chisel3/issues/800/comments","events_url":"https://api.github.com/repos/freechipsproject/chisel3/issues/800/events","html_url":"https://github.com/freechipsproject/chisel3/issues/800","id":306095173,"number":800,"title":"[RFC] define Module to be MultiIOModule? and unifying the Module type hierarchy","user":{"login":"ducky64","id":1069863,"avatar_url":"https://avatars0.githubusercontent.com/u/1069863?v=4","gravatar_id":"","url":"https://api.github.com/users/ducky64","html_url":"https://github.com/ducky64","followers_url":"https://api.github.com/users/ducky64/followers","following_url":"https://api.github.com/users/ducky64/following{/other_user}","gists_url":"https://api.github.com/users/ducky64/gists{/gist_id}","starred_url":"https://api.github.com/users/ducky64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ducky64/subscriptions","organizations_url":"https://api.github.com/users/ducky64/orgs","repos_url":"https://api.github.com/users/ducky64/repos","events_url":"https://api.github.com/users/ducky64/events{/privacy}","received_events_url":"https://api.github.com/users/ducky64/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-16T22:29:07Z","updated_at":"2018-03-24T18:30:20Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Currently, the type hierarchy for modules is:\r\n(superclasses upwards)\r\n`BaseModule` (block with ports, blackbox-type modules also extend this)\r\n`chisel3.experimental.RawModule` = `chisel3.frontend.UserModule` (contains user RTL with no IOs defined by default)\r\n`chisel3.experimentalMultiIOModule` = `chisel3.frontend.ImplicitModule` (defines IOs `clock` and `reset` with mechanism to automatically connect those by clock and reset scopes)\r\n`chisel3.Module` = `chisel3.frontend.LegacyModule` (additionally defines IO `io`, and enforces no other IOs are defined)\r\n(subclasses downwards)\r\n\r\n(note: `chisel3.frontend._` is an internal name for these classes, `chisel3._` or `chisel3.experimental._` is the name exposed to the public API in `package.scala`)\r\n\r\nSo there's several points to this proposal:\r\n\r\n## Does Module extending MultiIOModule make sense?\r\nCurrently, `chisel3.Module` is defined as a LegacyModule, which is actually a subclass of `chisel3.experimental.MultiIOModule`. However, IMO, a plain reading of the names would imply the opposite relationship - MultiIOModule **is-a** Module, not the other way around (unless you know the details of implementation).\r\n\r\nPossible solutions are to change the naming so the relationship is more obvious, or:\r\n\r\n## Does it make sense to redefine Module to MultiIOModule?\r\nSince `chisel3.Module` **is-a** MultiIOModule, redefining `chisel3.Module` to be MultiIOModule should be safe. However, from way back when, there were also concerns about whether allowing multiple top-level IOs was a good idea. Now that MultiIOModule has been in experimental for a significant time, it might be worth discussing this again based on people's experiences.\r\n\r\nA second question would be whether to keep LegacyModule at all, either exposed under a different name in `chisel3._` (maybe `chisel3.SingleIOModule`?) or in compatibility `Chisel._`. Are there any advantages to restricting modules to a single IO such that we shouldn't remove that feature?\r\n\r\n## Can we unify internal and external (interface / API) names?\r\nThe idea here would be to rename the internal names to match the external names. I don't expect this to be too controversial, this will mostly affect implementation details.\r\n\r\n\r\n<!-- Note: for support questions, you are strongly advised to use [Stack Overflow](https://stackoverflow.com/questions/tagged/chisel). -->\r\n<!--\r\nThis repository's issues are reserved for feature requests and bug reports.\r\nPlease select the item best describing the issue in each category and delete the other items.\r\n-->\r\n<!-- choose all that apply -->\r\n**Type of issue**: feature request\r\n\r\n<!-- choose one -->\r\n**Impact**: API addition (no impact on existing code)\r\n\r\n<!-- choose one -->\r\n**Development Phase**: proposal\r\n\r\n**Other information**\r\n <!-- include detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. Stack Overflow, gitter, etc -->\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce the problem:**\r\n\r\n**What is the current behavior?**\r\n\r\n**What is the expected behavior?**\r\n\r\n**Please tell us about your environment:**\r\n<!--    (examples)\r\n    - version: `3.0-SNAPSHOT`\r\n    - OS: `Linux knight 4.4.0-92-generic #115-Ubuntu SMP Thu Aug 10 09:04:33 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux`\r\n-->\r\n**What is the use case for changing the behavior?**\r\n"},"comment":{"url":"https://api.github.com/repos/freechipsproject/chisel3/issues/comments/375914658","html_url":"https://github.com/freechipsproject/chisel3/issues/800#issuecomment-375914658","issue_url":"https://api.github.com/repos/freechipsproject/chisel3/issues/800","id":375914658,"user":{"login":"edwardcwang","id":10752510,"avatar_url":"https://avatars2.githubusercontent.com/u/10752510?v=4","gravatar_id":"","url":"https://api.github.com/users/edwardcwang","html_url":"https://github.com/edwardcwang","followers_url":"https://api.github.com/users/edwardcwang/followers","following_url":"https://api.github.com/users/edwardcwang/following{/other_user}","gists_url":"https://api.github.com/users/edwardcwang/gists{/gist_id}","starred_url":"https://api.github.com/users/edwardcwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edwardcwang/subscriptions","organizations_url":"https://api.github.com/users/edwardcwang/orgs","repos_url":"https://api.github.com/users/edwardcwang/repos","events_url":"https://api.github.com/users/edwardcwang/events{/privacy}","received_events_url":"https://api.github.com/users/edwardcwang/received_events","type":"User","site_admin":false},"created_at":"2018-03-24T18:30:20Z","updated_at":"2018-03-24T18:30:20Z","author_association":"CONTRIBUTOR","body":"So would `import chisel3._; class foo extends Module` still pull in the single IO module?"}}
{"actor":{"display_login":"edwardcwang"}}