Skip to content
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

[WIP] An applet for communicating using an Ethernet RGMII PHY #562

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions software/glasgow/access/direct/demultiplexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ async def _out_task(self, data):
self._out_tasks.submit(self._out_task(self._out_slice()))

async def write(self, data):
await self.writev([data])

async def writev(self, datav):
if self._write_buffer_size is not None:
# If write buffer is bounded, and we have more inflight requests than the configured
# write buffer size, then wait until the inflight requests arrive before continuing.
Expand All @@ -313,8 +316,9 @@ async def write(self, data):
# Eagerly check if any of our previous queued writes errored out.
await self._out_tasks.poll()

self.logger.trace("FIFO: write <%s>", dump_hex(data))
self._out_buffer.write(data)
for data in datav:
self.logger.trace("FIFO: write <%s>", dump_hex(data))
self._out_buffer.write(data)

# The write scheduling algorithm attempts to satisfy several partially conflicting goals:
# * We want to schedule writes as early as possible, because this reduces buffer bloat and
Expand Down
12 changes: 12 additions & 0 deletions software/glasgow/access/direct/multiplexer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import logging
from amaranth import *
from amaranth.lib import wiring

from ...gateware import stream
from .. import AccessMultiplexer, AccessMultiplexerInterface


Expand Down Expand Up @@ -31,6 +33,11 @@ def __init__(self, fifo):
self.r_rdy = Signal()
self.r_data = fifo.r_data

self.r_stream = stream.Signature(8).create()
self.r_stream.payload = self.r_data
self.r_stream.valid = self.r_rdy
self.r_stream.ready = self.r_en

def elaborate(self, platform):
fifo = self._fifo

Expand Down Expand Up @@ -70,6 +77,11 @@ def __init__(self, fifo):
self.w_data = fifo.w_data
self.flush = fifo.flush

self.w_stream = stream.Signature(8).flip().create()
self.w_stream.payload = self.w_data
self.w_stream.valid = self.w_en
self.w_stream.ready = self.w_rdy

def elaborate(self, platform):
fifo = self._fifo

Expand Down
Loading