Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

PacketStream protocol, converters, UART stuff and async FIFO #51

Closed
wants to merge 152 commits into from

Conversation

Akribes
Copy link
Contributor

@Akribes Akribes commented Mar 29, 2024

I'm reopening #46 here from a new branch, so we can merge code into develop without affecting this PR.

We have made some progress that we think is ready for review.

This PR also includes CI, but it disabled for now, because it sometimes takes a lot of GiPHouse's CI minutes.

Copy link
Collaborator

@lmbollen lmbollen left a 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
Comment on lines 92 to 102
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
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort

, _abort = _dcAborted
}

downConverter
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also haddock here

Comment on lines +62 to +69
=> ( 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
Copy link
Collaborator

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?

Copy link
Contributor Author

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
Copy link
Collaborator

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

Copy link
Contributor

@rowanG077 rowanG077 Apr 3, 2024

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
Copy link
Collaborator

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

Comment on lines 37 to 38
genVec :: (C.KnownNat n, 1 <= n) => Gen a -> Gen (C.Vec n a)
genVec gen = sequence (C.repeat gen)
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Comment on lines +54 to +59
genPackets =
PacketStreamM2S <$>
genVec Gen.enumBounded <*>
pure Nothing <*>
Gen.enumBounded <*>
pure False
Copy link
Collaborator

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

Copy link
Contributor Author

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.

Comment on lines 86 to 90
PacketStreamM2S <$>
genVec Gen.enumBounded <*>
Gen.maybe Gen.enumBounded <*>
Gen.enumBounded <*>
Gen.enumBounded
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use re-usable generator

@rowanG077 rowanG077 mentioned this pull request Apr 4, 2024
@Akribes
Copy link
Contributor Author

Akribes commented Apr 11, 2024

About CI: there's an issue on this sprint to re-enable CI.

@Akribes Akribes requested a review from lmbollen April 11, 2024 14:11
@Akribes Akribes force-pushed the packetstream-converters-uart-async-fifo branch from 570b730 to fd33464 Compare April 11, 2024 14:13
@Akribes Akribes force-pushed the packetstream-converters-uart-async-fifo branch from fd33464 to ae8af02 Compare April 11, 2024 14:15
@rowanG077
Copy link
Contributor

Closed. It's way to outdated currently

@rowanG077 rowanG077 closed this May 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants