-
Notifications
You must be signed in to change notification settings - Fork 77
Cloning and matching #614
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
Cloning and matching #614
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and I tried it on FPConverter which dramatically simplified the IO handling of a LogicStructure. This will apply to FPAdder FPMultiplier, the two square root components, and the Fixed2Float, Float2Fixed.
Thank you for reviewing, @desmonddak ! |
This looks like a major cleanup. I even see a LogicStructure naming change that will help SV output (I noticed with Fixed2Float, I think I can verify it and remove a named in the component). |
So I notice a change from |
Ahh. This is where a clone function is passed. |
New changes look good. |
Description & Motivation
This PR introduces a couple ideas:
clone
to be included onLogic
s andInterface
sModule
that take advantage of those capabilitiesThe
addTyped*
functions onModule
are parameterized and return the same datatype as was received. Additionally,Module
now supportsLogicStructure
s of any type as ports, though the SV still packs them on the interface. These functions are also useful for creating ports when you want the widths/dimensions to match the original argument.There's also some
add*InterfacePorts
functions forInterfaces
, which basically just wrap the more common way to create interfaces by callingclone
andconnectIO
. There's one for arbitraryInterface
s and one forPairInterface
s.Also, this adds
packed
to baseLogic
as a no-op so that you can safely useaddTyped*
functions but force a simple logic as the input (rather than an arbitrary structure).Also, this PR adjusts naming of (non-reserved)
LogicStructure
elements in generated SystemVerilog to prefix with the name of the structure, which makes the generated SV more readable.Related Issue(s)
N/A
Partially addresses #609 by exposing
original
inBusSubset
Fix #578
Close #519 -- we're deprecating
PairInterface.clone
.Testing
Added new testing for new functionality.
Backwards-compatibility
No, though there's new expectations for any implemented
Interface
s andLogicStructure
s if they wish to properly handle these APIs.Deprecated
PairInterface.clone
(the constructor, not the method)Documentation
Yes, API docs included and updated user guide.