Commit Graph

755 Commits

Author SHA1 Message Date
Jędrzej Boczar dbc0b75178 phy/s7rgmii: add configurable iodelay_clk_freq 2021-04-27 10:59:27 +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
enjoy-digital 9ac5c592d0
Merge pull request #59 from lschuermann/dev/mac-hw-timestamp
MAC: implement TX return channel & hardware timestamping
2021-04-08 13:04:03 +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
enjoy-digital 694cc81d77
Merge pull request #65 from shuffle2/master
Revert "phy/ecp5rgmii: remove p_DEL_MODE (not required since we speci…
2021-03-30 10:35:12 +02:00
Shawn Hoffman 17f6dca544 Revert "phy/ecp5rgmii: remove p_DEL_MODE (not required since we specify DEL_VALUE)."
This reverts commit 5247a2008a.
2021-03-29 11:31:54 -07:00
enjoy-digital adf63f3fc0
Merge pull request #64 from mczerski/different_rx_tx_slots
allow for different nrxslots and ntxslots
2021-03-19 08:56:39 +01: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
enjoy-digital 89b197d1a0
Merge pull request #61 from shenki/is-not
Fix "is not" literal SyntaxWarning
2021-02-16 15:14:39 +01:00
Joel Stanley 6daff12f50 Fix "is not" literal SyntaxWarning
Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-02-16 21:57:53 +10:30
Florent Kermarrec 0c003c8ee7 liteeth/core: handle last_be. 2021-02-10 19:18:55 +01:00
Florent Kermarrec 497d4d6501 liteeth/common: add last_be signal on layouts (required for 32/64-bit datapath support). 2021-02-10 18:43:03 +01:00
Florent Kermarrec 01328813ff liteeth/common: cleanup, add separators. 2021-02-10 18:38:12 +01:00
Florent Kermarrec 9edf5d393f liteeth/gen: remove semi-colon (thanks @davidcorrigan714). 2021-01-27 08:35:38 +01:00
Florent Kermarrec 7448170390 liteth/phy/rmii: add support for ref_clk as input.
In some hardware, ref_clk can be input for both the MAC and the PHY. In this
case, setting refclk_cd to None will make the CRG use ref_clk as the RMII
input reference clock:

Pads:
# RMII Ethernet
("eth_clocks", 0,
    Subsignal("ref_clk", Pins("D17")),
    IOStandard("LVCMOS33"),
),
("eth", 0,
    Subsignal("rst_n",   Pins("F16")),
    Subsignal("rx_data", Pins("A20 B18")),
    Subsignal("crs_dv",  Pins("C20")),
    Subsignal("tx_en",   Pins("A19")),
    Subsignal("tx_data", Pins("C18 C19")),
    Subsignal("mdc",     Pins("F14")),
    Subsignal("mdio",    Pins("F13")),
    Subsignal("rx_er",   Pins("B20")),
    Subsignal("int_n",   Pins("D21")),
    IOStandard("LVCMOS33")
),


PHY:

self.submodules.ethphy = LiteEthPHYRMII(
    clock_pads = self.platform.request("eth_clocks"),
    pads       = self.platform.request("eth"),
    refclk_cd  = None)

Thanks @mwick83 for reporting the use case and for the initial implementation.
2020-12-28 11:32:11 +01:00
Florent Kermarrec dea35908c9 phy/rmii: add refclk_cd parameter (to select reference eth clock domain) and make clock_pads optional. 2020-12-23 11:00:25 +01:00
Florent Kermarrec 617400fe9e test/test_etherbone: disable for now (hanging). 2020-12-17 19:06:11 +01:00
Florent Kermarrec e270956d2d test/test_model: fix test_etherbone. 2020-12-17 18:37:47 +01:00
Florent Kermarrec d901027e5c bench/test_etherbone/speed_test: use burst_size of 255. 2020-11-26 11:36:12 +01:00
Florent Kermarrec d3788cd2bb frontend/etherbone: use new LiteX's PacketFIFO in LiteEthEtherboneRecordSender.
This ensures the full Etherbone packet is available before starting the transmission
and fixes transmission issues with larges bursts or slow sys_clk_freq.
2020-11-26 11:35:51 +01:00
Florent Kermarrec d3ae361748 bench/sim: fix sim ethernet tap ip address. 2020-11-26 11:29:50 +01:00
Florent Kermarrec 3afd62e2e9 bench: add sim (with similar features than hardware targets). 2020-11-25 19:45:22 +01:00
Florent Kermarrec faf78965dd bench/test_etherbone: allow direct CommUDP use with --udp.
Useful to compare performance with RemoteClient and CommUDP.
2020-11-25 15:15:08 +01:00
Florent Kermarrec 5abf44d89a bench/targets: set buffer_depth to 255 (max). 2020-11-25 15:13:55 +01:00
Florent Kermarrec c3e1dad289 bench: reduce buffer_depth/burst_size to 128 (maximum supported by Etherbone protocol is 255). 2020-11-25 09:13:23 +01:00
Florent Kermarrec f97f6b0635 bench/test_etherbone/test_speeed: use bursts. 2020-11-24 19:46:43 +01:00
Florent Kermarrec d1571ad1df software/dissector: merge bit.lua/etherbone.lua in a single script and enable dissector on UDP port 1234 (LiteX's default). 2020-11-24 19:40:18 +01:00
Florent Kermarrec 5737aaa67c ci: migrate from Travis-CI to Github Actions. 2020-11-24 13:36:06 +01:00
Florent Kermarrec b1fd3e8092 bench/targets: increase buffer_depth to 256. 2020-11-24 10:19:52 +01:00
Florent Kermarrec ca4284f977 bench: add colorlight_5a_75b test target. 2020-11-24 10:19:23 +01:00
Florent Kermarrec c6cfed6294 frontend/etherbone: expose buffer_depth to user. 2020-11-23 17:44:47 +01:00
Florent Kermarrec 47100c5c4e bench/test_etherbone: add initial speed_test. 2020-11-23 17:36:54 +01:00
Florent Kermarrec 3645d2f85f bench: add initial test_etherbone. 2020-11-23 17:11:52 +01:00
Florent Kermarrec c7d7561a38 bench/targets: add identifier and SRAM. 2020-11-23 17:11:36 +01:00
Florent Kermarrec 291b257eb4 phy/crg: make rst_n optional on all PHYs and minor cleanup. 2020-11-23 16:24:44 +01:00
enjoy-digital 75495dd6ec
Merge pull request #54 from rprinz08/master
Fix syntax and load error in Wireshark etherbone dissector
2020-11-23 13:44:57 +01:00
Florent Kermarrec 41b0f0c774 add initial bench directory with minimal arty/genesys2 test targets. 2020-11-23 13:40:54 +01:00
Florent Kermarrec 53057121e7 examples: remove old examples and update README (new benches/examples will be added). 2020-11-23 12:54:09 +01:00
Florent Kermarrec 5247a2008a phy/ecp5rgmii: remove p_DEL_MODE (not required since we specify DEL_VALUE). 2020-11-23 12:16:07 +01:00
rprinz08 d3bbd506ba Fix syntax and load error in Wireshark etherbone dissector 2020-11-07 10:55:21 +01:00
Florent Kermarrec 06242564f7 frontend/etherbone: simplify LiteEthEtherboneRecordReceiver. 2020-11-06 19:49:07 +01:00
Florent Kermarrec d96fdfc5e5 frontend/etherbone: simplify LiteEthEtherboneRecordSender using combinatorial logic and fix #52. 2020-11-06 19:43:57 +01:00
enjoy-digital 0c287d07f8
Merge pull request #51 from gregdavill/ecp5rgmii_delay_fix
phy/ecp5rgmii: Fix io delay blocks
2020-10-12 09:17:02 +02:00
enjoy-digital 7fa06adf78
Merge pull request #48 from kbeckmann/fix_test
test_etherbone: Fix import of etherbone module
2020-10-12 09:05:05 +02:00
enjoy-digital 317154f68f
Merge pull request #49 from gregdavill/ecp5_timing_fix
mac/core: Improve timing closure of core
2020-10-12 09:04:34 +02:00
Greg Davill 6ee11edb87 phy/ecp5rgmii: Fix io delay blocks
For correct io delays in nextpnr the DEL_VALUE parameter needs to
be an integer, instead of the "DELAY{}" string.

The use of a "DELAY{}" string appears in the Lattice primitive
manual, but appears to be incorrect. At least based of the current
nextpnr.

Because we are not making use of dynamic io delays here we can
also use the simpler DELAYG block instead of DELAYF.

Fixes #50
2020-10-11 15:16:58 +10:30
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