-
Notifications
You must be signed in to change notification settings - Fork 2
PacketStream protocol, converters, UART stuff and async FIFO #51
Conversation
2 setup ci
…nctions (belongs in /Test/.../DownConverter
Create stream down converter
…erter merge interpacket gap inserter into develop
…curious index out of bounds error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments. Furthermore I'd like the commit history to consist of logical chunks of features or "work". It makes pull requests far easier to review allows us to understand the commit history better.
As a guideline also each commit should compile and pass the test-suite.
For this pull request I suggest squashing commits that belong to the same functionality or creating a new branch where you selectively create commits of logical functionalities.
Also, when will CI be re-enabled?
clash-eth.cabal
Outdated
Clash.Lattice.ECP5.Colorlight.TopEntity | ||
Clash.Cores.Ethernet.RGMII | ||
Clash.Cores.Ethernet.PacketStream | ||
Clash.Cores.Ethernet.UpConverter | ||
Clash.Cores.Ethernet.DownConverter | ||
Clash.Cores.Ethernet.Util | ||
Clash.Cores.Ethernet.InterpacketGapInserter | ||
Clash.Cores.Ethernet.AsyncFIFO | ||
Clash.Lattice.ECP5.Prims | ||
Clash.Lattice.ECP5.UART | ||
Clash.Lattice.ECP5.Colorlight.CRG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort
clash-eth.cabal
Outdated
@@ -33,6 +33,7 @@ common common-options | |||
TypeFamilies | |||
TypeOperators | |||
ViewPatterns | |||
ImportQualifiedPost |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort
, _abort = _dcAborted | ||
} | ||
|
||
downConverter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is user API, please add a haddock comment shortly explaining what it does and how it behaves.
Mainly latency and throughput seem relevant.
} | ||
|
||
|
||
downConverterC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also haddock here
=> ( Signal dom (Maybe (PacketStreamM2S dataWidth ())) | ||
, Signal dom PacketStreamS2M | ||
) | ||
-- ^ Input packet stream from the source and backpressure from the sink | ||
-> ( Signal dom PacketStreamS2M | ||
, Signal dom (Maybe (PacketStreamM2S 1 ())) | ||
) | ||
-- ^ Output backpressure to the source |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why no support for meta data routing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, we don't need require this.
{-# language FlexibleContexts #-} | ||
{-# language NamedFieldPuns #-} | ||
|
||
module Clash.Lattice.ECP5.UART |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functions that drive a protocol with backpressure, but don't handle the backpressure should be prefixed with unsafe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that hold for things that use CSignal
? They are not really unsafe imo. They don't handle backpressure but you also can't connect components to them that assert backpressure. There are no function in this module that are unsafe by that definition.
@@ -0,0 +1,66 @@ | |||
{-# LANGUAGE RecordWildCards #-} | |||
{-# LANGUAGE FlexibleContexts #-} | |||
module Test.Cores.Ethernet.Util where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add haddock comments to the functions to briefly explain what they do
tests/Test/Lattice/ECP5/UART.hs
Outdated
genVec :: (C.KnownNat n, 1 <= n) => Gen a -> Gen (C.Vec n a) | ||
genVec gen = sequence (C.repeat gen) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use existing generators?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not using these, because we're getting a dependency conflict between clash-prelude-hedgehog and clash-protocols.
genPackets = | ||
PacketStreamM2S <$> | ||
genVec Gen.enumBounded <*> | ||
pure Nothing <*> | ||
Gen.enumBounded <*> | ||
pure False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make a separate re-usable generator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is quite specific because _last
should always be Nothing
and the _abort
always false.
tests/Test/Lattice/ECP5/UART.hs
Outdated
PacketStreamM2S <$> | ||
genVec Gen.enumBounded <*> | ||
Gen.maybe Gen.enumBounded <*> | ||
Gen.enumBounded <*> | ||
Gen.enumBounded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use re-usable generator
About CI: there's an issue on this sprint to re-enable CI. |
570b730
to
fd33464
Compare
fd33464
to
ae8af02
Compare
Closed. It's way to outdated currently |
I'm reopening #46 here from a new branch, so we can merge code into develop without affecting this PR.