Commit Graph

416 Commits

Author SHA1 Message Date
Florent Kermarrec 491c5ab150 frontend/etherbone: Add 1-Slot PacketFIFO on LiteEthEtherboneProbe to prevent deadlock situation.
Based on @Based on @david-sawatzke's analysis:
"Otherwise, depending on the caching in the path, a deadlock might occur due to the rx path being
blocked by the tx path, being blocked by the arp request, for which the answers get dropped in the
rx path."
2021-11-08 11:42:44 +01:00
enjoy-digital 8ba5cf06a6
Merge pull request #90 from david-sawatzke/dev/hybridmac_8bit
mac/init: Add 32 & 64 bit support to hybrid mac (take two)
2021-11-04 14:59:10 +01:00
enjoy-digital b6c5e41097
Merge pull request #88 from lschuermann/dev/wtfverilog
{De,P}acketizer: fix source.last assignment between the two FSMs
2021-11-04 14:58:40 +01:00
David Sawatzke 3550f10fa3 mac: Extend hybrid mac to all dws and skip unneeded-conversion 2021-11-02 00:48:56 +01:00
Florent Kermarrec 9b03fc14de mac/sram: Properly fix length_lsb for dw==8 case. 2021-11-01 08:28:58 +01:00
Florent Kermarrec 2827e9947f mac/sram: Fix length_lsb slicing (+1). 2021-10-31 15:11:08 +01:00
Florent Kermarrec 1b25f7781c mac/sram: Add dw=8, 16 support and simplify logic (let the toolchain unused logic for 8/16/32-bit dw automatically). 2021-10-30 23:28:10 +02:00
Leon Schuermann 856062d9f0 {De,P}acketizer: fix source.last assignment between the two FSMs
This appears to fix some errors encountered during sending and
receiving of packets where sink.valid dropped to zero immediately
after last and the last_be overflowed onto the current bus word.

It turns out that the last_be FSM's changes to source.last are not
respected by the main FSM due to the way assignments to registers in
procedural blocks work on Verilog.

This introduces a selector for which last signal to use, goverened by
the last_be FSM.

Signed-off-by: Leon Schuermann <leon@is.currently.online>
Co-authored-by: David Sawatzke <d-git@sawatzke.dev>
2021-10-28 15:35:12 +02:00
Florent Kermarrec 2ec2669f6b core/frontend/mac: Switch to local versions of Depacketizer/Packetizer. 2021-10-25 11:06:28 +02:00
Florent Kermarrec e11dbe8391 Create a local version of litex.soc.interconnect.packet to ease development of LiteEth specific Packetizer/Depacketizer's features.
Also move test_stream/test_packet.

This allow keeping last_be (that will be replaced in the future) self-contained to LiteEth and will
also simplify the rework on Packetizer/Depacketizer in LiteX, application in LitePCIe and
future rework/application in LiteEth.
2021-10-25 11:05:46 +02:00
enjoy-digital 2a5621474c
Merge pull request #85 from lschuermann/dev/mac-wishbone-dw
liteeth/mac: support SRAM/Wishbone operation with dw > 32 bit
2021-10-23 18:39:54 +02:00
enjoy-digital 9149524623
Merge pull request #84 from lschuermann/dev/core-arp-tx-last_be
core/arp: assert last_be only on the last data word
2021-10-23 18:38:01 +02:00
enjoy-digital 0944783984
Merge pull request #83 from david-sawatzke/dev/etherbone_last_be
frontend/etherbone: Add last_be everywhere
2021-10-23 18:36:55 +02:00
Leon Schuermann 359b024103 liteeth/mac: remove assertion of 32-bit dw for wishbone interface
Signed-off-by: Leon Schuermann <leon@is.currently.online>
2021-10-13 17:51:23 +02:00
Leon Schuermann 540ad8c9dc liteeth/mac: use native dw for LiteEthMACWishboneInterface
This is required to support 64-bit wide data paths using the automatic
Wishbone bus width conversion as discussed in
enjoy-digital/liteeth#75. Otherwise, if the MAC data width deviates
from the 32-bit default set previously, received and transmitted
packets will be broken.

Signed-off-by: Leon Schuermann <leon@is.currently.online>
2021-10-13 17:47:28 +02:00
Leon Schuermann e663668717 core/arp: assert last_be only on the last data word
This is in line with other components of the LiteEth repository using
the `last_be` data qualifier. It is unexpected for last_be to be
asserted on any data word other than the last (i.e. only when `last`
is also asserted). In particular it can confuse the Packetizer and
cause it to pass through `last_be` on words other than the last as
well. This then irritates some parts of the MAC pipeline.

With these changes, ARP works on a 64-bit wide data path (with the
{Dep,P}acketizer changes integrated into LiteX).

Signed-off-by: Leon Schuermann <leon@is.currently.online>
2021-10-13 17:43:53 +02:00
David Sawatzke f20432a2a5 frontend/etherbone: Add last_be everywhere
Needed for a full 32 bit path to work
2021-10-11 17:17:25 +02:00
Florent Kermarrec 8ecc3ca6d9 mac/core: Disable Preamble/CRC with LiteEthPHYModel. 2021-10-05 15:41:44 +02:00
Florent Kermarrec 5276a7543f mac/core: Split add_converter in add_cdc/add_converter/add_last_be. 2021-10-05 15:32:49 +02:00
Florent Kermarrec a4a070af4d mac/core: Introduce TX/RXDatapath modules to simplify code. 2021-10-05 15:13:08 +02:00
Florent Kermarrec 11555d43cb mac/core: Avoid passing core_dw/phy_dw to add_tx/rx_converter. 2021-10-05 14:20:22 +02:00
Florent Kermarrec 6204994bad common: Define eth_min_frame_length, eth_fcs_length and arp_min_length and use them in core/mac/model. 2021-10-05 14:10:41 +02:00
Florent Kermarrec 944849c3cf mac/core: Move CSRs to top and rename dw to datapath_dw. 2021-10-05 13:59:22 +02:00
Florent Kermarrec 821f725d58 mac/core: Improve modules's names: tx_xy/rx_xy everywhere. 2021-10-05 13:48:56 +02:00
Florent Kermarrec 511ba001dc mac/core: Avoid reversed order for TX path now that separated from RX path. 2021-10-05 11:52:11 +02:00
Florent Kermarrec 6901d418b3 mac/core: Split TX/RX parts and cleanup to improve readability/maintenance. 2021-10-05 11:39:56 +02:00
Florent Kermarrec 7ed1c61237 mac/core: Cosmetic cleanups. 2021-10-05 10:33:23 +02:00
Florent Kermarrec ce8523f31b mac: Rename sys_datapath to with_sys_datapath. 2021-10-05 10:23:01 +02:00
Florent Kermarrec a00a200547 mac/sram: Cleanup/Simplify LiteEthMACSRAMReader.
- Improve signal names.
- Use re on memories to simplify addressing (still need to anticipate read by 1 cycle).

Also do minor cleanups to LiteEthMACSRAMWriter.
2021-10-05 09:52:46 +02:00
Florent Kermarrec 89dbf17cb6 mac/sram: Cleanup/Simplify LiteEthMACSRAMWriter.
- Improve signal names.
- Avoid IDLE State.
- Also check for error when length > eth_mtu.
- Use int(math.log2()) instead of log2_int.
2021-10-01 19:56:10 +02:00
Florent Kermarrec 1685c56100 mac/sram: Avoid last_be encoding/decoding generalization.
We now only have to handle 2 cases (32-bit/64-bit) and code is easier to
apprehend with the direct mapping.
2021-10-01 19:12:59 +02:00
Florent Kermarrec e794459946 mac: Move sram dw/sram checks to LiteEthMAC. 2021-10-01 18:30:37 +02:00
Florent Kermarrec 692df29981 mac/sram: Move LastBEDecoder/LastBEEncoder. 2021-10-01 18:27:10 +02:00
Florent Kermarrec 717885eb0a mac: Update copyrights. 2021-10-01 18:18:00 +02:00
Florent Kermarrec cab4e93317 mac/wishbone: Remove internal data-width conversion added by #75 to let LiteX handle it directly.
LiteX integration is already able to automatically convert bus data-width: When adding a 64-bit peripheral
to 32-bit SoC, the adapters will automatically be inserted.

When SRAM dw is 64-bit for a 32-bit SoC, automatic convertion can be seen in the build log:
INFO:SoCBusHandler:ethmac Region allocated at Origin: 0x80000000, Size: 0x00002000, Mode: RW, Cached: False Linker: False.
INFO:SoCBusHandler:ethmac Bus converted from Wishbone 64-bit to Wishbone 32-bit.
INFO:SoCBusHandler:ethmac added as Bus Slave.
INFO:SoCIRQHandler:ethmac IRQ allocated at Location 2.

Also fix copyright order.
2021-10-01 18:11:41 +02:00
Florent Kermarrec aafb7081ff mac: Disable sys_data_path by default since seems to introduce a regression.
netboot no longer works on Arty with sys_data_path set to True:
python3 -m litex_boards.targets.digilent_arty --with-ethernet --build
2021-10-01 16:22:33 +02:00
enjoy-digital f50f6d242c
Merge pull request #82 from david-sawatzke/endianconversion_sram
mac/sram: Handle endianness only in sram
2021-10-01 15:49:43 +02:00
David Sawatzke 71cb365bc5 mac/sram: Handle endianness only in sram 2021-09-29 18:35:19 +02:00
enjoy-digital 40f22569a7
Merge pull request #77 from david-sawatzke/64bitmacpath
Add 64 bit support to mac pipeline
2021-09-27 17:28:03 +02:00
enjoy-digital 6fbb10abfb
Merge pull request #75 from lschuermann/dev/sram-wishbone-adjdw
mac/{sram,wishbone}: remove assumptions about 32-bit dw and add SRAM to Wishbone dw conversion
2021-09-27 17:25:27 +02:00
enjoy-digital 7847f72c6b
Merge pull request #74 from david-sawatzke/32bitmacpath
Add toggleable 32 bit support to mac pipeline
2021-09-27 17:22:51 +02:00
Florent Kermarrec 8733aecf89 liteeth_gen: Minor cleanups/simplifications. 2021-09-27 17:12:14 +02:00
Florent Kermarrec 5358234720 liteth_gen: Remove calls to add_csr (no longed required). 2021-09-27 17:02:23 +02:00
enjoy-digital bdff760128
Merge pull request #81 from ozbenh/gen-py-fixes
gen.py fixes
2021-09-27 17:00:17 +02:00
enjoy-digital 734d948665
Merge pull request #78 from lschuermann/dev/phy-gmii-model
phy/gmii: add model parameter to skip clock buffers & generation
2021-09-27 16:58:26 +02:00
enjoy-digital bcb1946711
Merge pull request #76 from lschuermann/dev/xgmii-phy
Add 64-bit XGMII PHY implementation for 10G Ethernet
2021-09-27 16:53:29 +02:00
Leon Schuermann 62855e14f6 mac/wishbone: support smaller Wishbone data width than SRAM dw
Adds a wishbone.Converter between the SRAM Wishbone slave and the
wishbone.Decoder connected to the SoC bus, to support SRAM data widths
larger than the system bus Wishbone data width. This is important to
be able to run a 32-bit SoC with a 64-bit MAC data path and SRAM
storage.

Signed-off-by: Leon Schuermann <leon@is.currently.online>
2021-09-27 08:26:06 +02:00
Leon Schuermann e6a4c2a2f6 mac/sram: support data widths larger than 32 bit
This removes various assumptions about having a 32 bit data width in
the SRAM module. Especially the last_be encoding and decoding have
been seperated into a module, which generates the one-hot encodings
and decodings on the fly.

Signed-off-by: Leon Schuermann <leon@is.currently.online>
2021-09-27 08:26:06 +02:00
Benjamin Herrenschmidt 63ff6f47e7 gen: Add clock constraints
Otherwise the generated verilog is missing necessary "keep" attributes

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2021-09-24 12:19:10 +10:00
Benjamin Herrenschmidt f2032a4227 Remove clock asserts
They aren't strictly necessary, especially since the MAC can have
a wider data path and thus cope with running slightly slower

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2021-09-23 12:24:58 +10:00