Commit Graph

5 Commits

Author SHA1 Message Date
Sean Anderson a75b77d8e5 Add OHL license option
The AGPL was mostly a placeholder until I determined a better license to
use. TBH I wasn't expecting that anyone would find this repo.

Closes: #1
Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-03-17 20:38:08 -04:00
Sean Anderson 8887f774d0 rtl: Document calculation of LFSRs
Document how the LFSR initial values are generated. Also fix several
off-by-one errors (where the documented cycles was not quite right).

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-03-15 13:44:20 -04:00
Sean Anderson f82fd2cac3 hub/phy_core: Export some status signals
Export some status signals which can be used for LEDs. Hopefully this
will deliver an authentic blinkenlights experience.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-02-20 23:34:10 -05:00
Sean Anderson 040016bd44 phy_core: Simplify collision logic
This mildly simplifies the collision logic.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-11-30 18:14:23 -05:00
Sean Anderson f6f3f024e4 Add phy_core
This module integrates the PCS with the descrambler, implements the PMA
(which is just the link monitor), and implements loopback and coltest
functions. This is more of the PCS/PMA, but the descrambler is
technically part of the PMD, so it's the "core" instead.

We deviate from the standard in one important way: the link doesn't come
up until the descambler is locked. I think this makes sense, since if
the descrambler isn't locked, then the incoming data will be gibberish.
I suspect this isn't part of the standard because the descrambler
doesn't have a locked output in X3.263, so IEEE would have had to
specify it.

Loopback is actually implemented in the PMD, but it modifies the
behavior in several places. It disables collisions (unless
coltest is enabled). Additionally, we need to force the link up (to
avoid the lengthy stabilization timer), but ensure it is down for at
least once cycle (to ensure the descrambler desynchronizes).

On the test side, we just go through the "happy path," as many of the
edge conditions are tested for in the submodule tests. Several of those
tests are modified so that their helper functions can be reused in this
test. In particular, the rx path is now async so that we can feed it
rx_data.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-11-05 12:37:18 -04:00