Commit graph

35 commits

Author SHA1 Message Date
David Sawatzke
3e7979920a mac/padding: Add 32 bit support to inserter
*Should* also work for 16/64 bit
2021-08-11 12:30:49 +02:00
David Sawatzke
0fb14d3c3f mac/core: Extract data path converter into separate function
Allows it to be easily movable later on, as we move more into the sys
clk & dw path
2021-08-11 12:30:49 +02:00
David Sawatzke
e14c90dbc3 mac: Allow configuring usage of FullMemoryWE (fixes #70)
On ecp5 `FullMemoryWE` leads to an increase of DP16KD block mem, while
it works better on Intel/Altera devices according to
6c3af746e2.

Simple solution: Make it configurable
2021-08-10 13:13:46 +02:00
Florent Kermarrec
72dd7bf283 mac/core/LiteEthMACCore: Switch CDC to ClockDomainCrossing and reduce buffering. 2021-07-16 14:51:25 +02:00
Florent Kermarrec
57e018354c mac/sram: Cosmetic cleanups. 2021-05-07 14:39:38 +02:00
Leon Schuermann
d2ef10fc03 mac/sram/timestamping: Fix stat_fifo refactoring typo.
Fixes: 392414eef8 ("mac: Review Timestamping, simplify and...")
Signed-off-by: Leon Schuermann <leon@is.currently.online>
2021-05-07 09:39:03 +02:00
Leon Schuermann
af29c09ac0 mac/sram/timestamping: Fix stat_fifo.sink.valid refactoring typo.
Fixes a bug which would fill the TX return channel FIFO whenever the
SRAM Reader FSM is in the IDLE state. Instead, the FIFO should be
filled when the FSM reaches the END state, in which it will remain for
exactly a single clock cycle.

Fixes: 392414eef8 ("mac: Review Timestamping, simplify and...")
Signed-off-by: Leon Schuermann <leon@is.currently.online>
2021-05-07 09:34:23 +02:00
Florent Kermarrec
6febb1aaab mac/last_be: Simplify LiteEthMACTXLastBE using an FSM, fix sink.ready corner case. 2021-04-27 18:33:29 +02:00
Florent Kermarrec
ca82b03e35 mac/LiteEthMACCoreCrossbar: Simplify. 2021-04-27 18:04:06 +02:00
Florent Kermarrec
392414eef8 mac: Review Timestamping, simplify and make sure CSR mapping is unchanged when Timestamp is disabled.
- Simplify names (timestamp_source --> timestamp, tx/tx_timestamp CSR/Layouts --> timestamp, etc...)
- Simplify the logic a bit.
- Use consistent names for FIFO between Writer and Reader (cmd_fifo and stat_fifo).
- Avoid stat_fifo on Reader when Timestamp is disabled.
- Use EventSourceLevel() on Reader only when Timestamp is enabled.
2021-04-08 14:07:35 +02:00
Leon Schuermann
2b206b8f7f liteeth MAC: implement TX hardware packet timestamping
This implements optional packet timestamping based on a hardware
timestamp source for outgoing Ethernet packets, as required by
applications such as IEEE 1588 (Precision Time Protocol).
2021-04-01 13:42:57 +02:00
Leon Schuermann
e5f713f5a0 liteeth MAC: add a TX return channel
This changes the liteeth SRAM reader to utilize a feedback channel
returning the slot of which a packet has been sent.

The event source is changed from a pulse to a level-based trigger,
such that it will continue asserted if a single packet has been
acknowledged, but additional packets have been sent.

This infrastructure allows to convey additional information about
transmitted packets, such as timestamps or errors.
2021-04-01 13:42:57 +02:00
Leon Schuermann
7ce1085b68 liteeth MAC: implement RX hardware packet timestamping
This implements optional packet timestamping based on a hardware
timestamp source for incoming Ethernet packets, as required by
applications such as IEEE 1588 (Precision Time Protocol).

When a timestamp source is given as an argument, an additonal CSR is
generated containing the packet timestamp.
2021-04-01 13:42:56 +02:00
Marek Czerski
017b457bfc allow for different nrxslots and ntxslots
Background:
When there is a lot of broadcasts in the network, receive buffers
may overflow easly. Especially having onlu 2 of them.
To prevent that you can enlarge nrxslots, but because
nrxslots + ntxslots must be the power of two, you must also
inrease ntxslots. But there is no need to have more than 2 tx
buffers (they work as ping-pong buffer), the CPU will not use
more than two buffers.

So being able to set for example nrxslots=8 and ntxslots=2
is quite reasonable.
2021-03-12 15:03:30 +01:00
Florent Kermarrec
6c3af746e2 mac: Use FullMemoryWE on LiteEthMACWishboneInterface to allow correct block ram inteference on Intel/Altera decices. 2021-03-11 11:55:50 +01:00
Greg Davill
9aee36939f mac/core: Improve timing closure of core
On ECP5 targets the core struggles to meet timing closure. This
change adds buffers to the CRC module on tx/rx paths.
This results in 20-30MHz gain to max clock rate.

This fixes #47
2020-10-11 14:46:16 +10:30
Florent Kermarrec
64b85e621e add SPDX License identifier to header and specify file is part or LiteEth.
Artix7/Ultrascale 1000BaseX is reused from MiSoC/LiteEthMini, specify it.
2020-08-23 16:07:12 +02:00
Florent Kermarrec
792013a175 mac/sram: avoid asynchronous read port on LiteEthMACSRAMReader (fix the resource usage issue identified in #43). 2020-07-13 11:27:25 +02:00
Shawn Hoffman
d66d302567 mac padding: fix counter reset value 2020-06-25 03:26:37 -07:00
Florent Kermarrec
b1bcfb2073 mac/LiteEthMACCoreCrossbar: remove unnecessary fifos. 2020-06-22 14:54:26 +02:00
Florent Kermarrec
8e1185711b common: remove Port.connect and use 2 separate Record.connect. 2020-06-22 14:36:44 +02:00
Florent Kermarrec
17caf17c9e mac/LiteEthMACCoreCrossbar: remove cpu_dw. 2020-06-19 22:06:53 +02:00
Florent Kermarrec
23b420a2dd mac/LiteEthMAC: simplify hybrid mode and avoid some duplication. 2020-06-19 22:01:22 +02:00
Florent Kermarrec
51cd54602b core/mac: add missing separators, fix typos. 2020-06-19 19:59:53 +02:00
Florent Kermarrec
59d3336bec mac: add separators, improve indent, minor simplifications. 2020-06-19 19:42:25 +02:00
Florent Kermarrec
ab55304ab7 mac/sram: use reset_less on datapath/configuration CSRStorages. 2020-04-06 13:17:30 +02:00
Piotr Binkowski
ac9f6d9f05 mac: add crossbar for sharing PHY between HW ethernet cores and Wishbone 2020-03-13 15:30:36 +01:00
Florent Kermarrec
081bf46ca6 mac/sram: simplify code and improve SRAM read speed using async_read on Memory. 2020-02-07 11:40:14 +01:00
Florent Kermarrec
bf4a11ab30 mac/sram: simplify counter (use NextValue in FSM) 2020-02-07 10:57:25 +01:00
Florent Kermarrec
721238b7a8 mac/sram: cosmetic changes 2020-02-07 10:53:05 +01:00
Florent Kermarrec
5a789570be mac/wishbone: remove FullMemoryWE (prevent simulation and should no longer be useful) 2019-11-23 00:12:46 +01:00
Vamsi K Vytla
57be29e68a global: pass data_width(dw) parameter to modules to prepare for 10Gbps/25Gbps links
To support 10Gbps/25Gbps, the hardware stack will need to handle multiple bytes/clock cycle.
Pass dw to all modules to allow making use of it in the future. For now dw=8.
2019-11-21 11:01:55 +01:00
Florent Kermarrec
6b0a9251c0 global: keep up to date with LiteX (update stream_packet import to packet)
Retro-compatibily was ensure by LiteX but update it.
2019-11-21 11:01:50 +01:00
Florent Kermarrec
ad187d35f2 add CONTRIBUTORS file and add copyright header to all files 2019-06-24 11:43:10 +02:00
Florent Kermarrec
a170acda0f change MAC location (next to phy/core/frontend), keep import retro-compatibility 2019-06-24 11:20:46 +02:00