-
Notifications
You must be signed in to change notification settings - Fork 151
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
Add gmiiSgmiiBridge
based on gig_ethernet_pcs_pma
#2712
Conversation
2430468
to
b5b84e7
Compare
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.
Nice job figuring out the primitive!
But I do think there's room for improvement. CI has some errors for you as well.
changelog/2024-04-22T11_08_17+02_00_add_gig_ethernet_pcs_pma_wrapper
Outdated
Show resolved
Hide resolved
93b8d16
to
10dc37e
Compare
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.
First, it occurred to me you don't provide a VHDL primitive. If this isn't a simple oversight, it should be documented.
I was thinking about the module structure. Clash.Cores.Xilinx.Ethernet.Gmii
is almost empty; it's just two definitions. If people want to do anything with the core other than just passing through inputs and outputs literally, they need to import Clash.Cores.Xilinx.Ethernet.Gmii.Types
.
Maybe you are accomodating the module name for future additions of other cores that could be considered GMII?
I wonder if this even needs to be more than one module. We could have the Clash.Cores.Xilinx.Ethernet.Gmii
module as follows:
gmiiSgmiiBridge
Gmii
DuplexMode
LinkSpeed
Pause
AutoNegConfig
Config
Status
BridgeOutput
And then a section Internal in the Haddock with the following:
gmiiSgmiiBridgePrim
AutoNegConfigVector
toAutoNegConfigVector
(ifpack
is insufficient)ConfigVector
toConfigVector
(ifpack
is insufficient)StatusVector
fromStatusVector
(ifunpack
is insufficient)tclTemplateFunction
tclTemplate
In this configuration, you'd just put the InlineYamlPrimitive
implementation directly inside the annotation as the GHC staging restriction prevents you from using a function defined in the same module.
Also, this is just in the order that it is currently in the Haddock; I'm not proposing an ordering here. Do that as you think makes sense to the reader.
Alternatively, all the things that are marked Internal above could go into a separate module Clash.Cores.Xilinx.Ethernet.Gmii.Internal
that is hidden from Haddock (but still exposed in the library! We like giving everybody all functions to do with as they please, as long as they understand it's all internal.)
I'm also wondering a bit about the very generic name of the module. What if some day we want to add another thing that is GMII, but has a different definition for Config
, Status
, LinkSpeed
, ...? Maybe the module name should be GmiiSgmiiBridge
. It's a bit long, but it does enable adding other cores later without getting them all mixed up. Ah, no, wait, this specific core can be configured as other things as well. Ugh. Naming things is hard.
10dc37e
to
848bc28
Compare
7af30f7
to
5641e04
Compare
16327a6
to
a8cdb95
Compare
a107535
to
f0b668f
Compare
f0b668f
to
85f0ac8
Compare
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.
I think this concludes my review, but mostly I just want to go home now :-).
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.
Christiaans very first review comment was
The module documentation header should be at the very top, before the LANGUAGE and OPTIONS_GHC pragmas
but I suddenly realise that the fix for that evidently did not survive the reorganisation of the files...
Also, you forgot to hide the |
85f0ac8
to
df31bf7
Compare
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.
You didn't apply all my suggestions. If you disagree with them, could you please discuss instead of simply presenting it again for review?
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.
LGTM!
3d33da4
to
e422efa
Compare
1efa346
to
20c1749
Compare
Changes implemented
@lmbollen Could you open a PR with this change over on clash-lang/clash-cores so we can merge it there? This PR hit in an unfortunate time of limbo where this code still exists in |
@DigitalBrains1 clash-lang/clash-cores#11 :) Which is the only commit that touches the code. |
This pull requests adds a wrapper to generate the LogiCORE IP Ethernet 1000BASE-X PCS/PMA or SGMII as a GMII to SGMII bridge.
It generates a
.tcl
file to be used by theclashConnector
based infra structure.For now the configuration is minimal and static.