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

Add AXI4 #22

Merged
merged 12 commits into from
Jan 28, 2022
Merged

Add AXI4 #22

merged 12 commits into from
Jan 28, 2022

Conversation

martijnbastiaan
Copy link
Member

@martijnbastiaan martijnbastiaan commented Jan 4, 2021

TODO:

  • Convenience functions defined for DfLike should be exposed for the various AXI channels. This should be pretty straight-forward. It'd basically be the same as Df.
  • I think I made a mistake defining the Payloads (see review comments)
  • It would still needs some examples (like a FIFO) on how to use it. clash-protocols is (for good reasons) a maze of type families unfortunately.
  • Build an interconnect component.
  • Build data generators and verifiers for functional verification.

src/Protocols/Axi4.hs Outdated Show resolved Hide resolved
@martijnbastiaan martijnbastiaan force-pushed the axi4 branch 3 times, most recently from 57012f0 to ea5c5aa Compare January 5, 2021 15:44
@jeehoonkang
Copy link

@martijnbastiaan Hi Martijn! Thank you for working on this wonderful project. I wonder if this PR is going to be merged. I really wish to use Clash for a project with AXI4 and AXI4-Stream.

(Unrelatedly, I also wonder if there is any documentation for this project. It seems the link in the README.md is broken.)

type Data (Axi4ReadAddress dom kb ksz lw iw aw kr kbl kl kc kp kq) userType =
M2S_ReadAddress kb ksz lw iw aw kr kbl kl kc kp kq userType

type Payload userType = userType
Copy link
Member Author

Choose a reason for hiding this comment

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

After working some more with AXI, I don't think exposing userType as the payload is a good idea. Perhaps we should define the address as the payload, so functions like map operate on that instead.

type Data (Axi4ReadData dom kr iw dataType) userType =
S2M_ReadData kr iw dataType userType

type Payload userType = userType
Copy link
Member Author

Choose a reason for hiding this comment

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

Same comments as for ReadAddress. dataType probably makes more sense.

@martijnbastiaan
Copy link
Member Author

Hi @jeehoonkang, thanks for the kind words :).

There's still some things missing in this PR:

  • Convenience functions defined for DfLike should be exposed for the various Axi channels. This should be pretty straight-forward. It'd basically be the same as Df:

-- | Like 'P.map', but over payload (/a/) of a Df stream.
map :: (a -> b) -> Circuit (Df dom a) (Df dom b)
map = DfLike.map Proxy Proxy

  • I think I made a mistake defining the Payloads (see review comments)
  • It would still needs some examples on how to use it. clash-protocols is (for good reasons) a maze of type families unfortunately.

@martijnbastiaan
Copy link
Member Author

(Unrelatedly, I also wonder if there is any documentation for this project. It seems the link in the README.md is broken.)

I haven't uploaded the package to Hackage yet as I feel it isn't ready yet. The documentation is built on CI though, but it takes a bit of clicking (click green tick next to commit => details => haddock => browse job artifacts => docs => index.html). The rendered documentation for this PR can be found here.

@martijnbastiaan
Copy link
Member Author

martijnbastiaan commented May 30, 2021

Also, AXI-Stream and AXI-Lite should definitely be added! Full-blown AXI is almost always overkill! :)

I'm on another project that's draining all my energy for the next couple of months, so I doubt I'm going to have the energy to finish the PR :(. If you'd like to help finish this PR I'd be more than happy to help!

@PietPtr PietPtr marked this pull request as ready for review January 14, 2022 09:19
@PietPtr
Copy link
Contributor

PietPtr commented Jan 14, 2022

Convenience functions have only been defined for the read data channel, as that is the only channel for which a field of kind Type is available (other channels do have the field userType, but the specification actively discourages using that field).

Designing the FIFO is left as issue #23.

Designing the interconnect is left as issue #24.

@martijnbastiaan martijnbastiaan force-pushed the axi4 branch 7 times, most recently from 71ef2ff to c45e0c3 Compare January 14, 2022 16:07
@martijnbastiaan
Copy link
Member Author

Thanks @PietPtr !

@martijnbastiaan martijnbastiaan merged commit 0b174c7 into main Jan 28, 2022
@martijnbastiaan martijnbastiaan deleted the axi4 branch January 28, 2022 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants