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 AvalonST basic support #791

Merged
merged 13 commits into from
Aug 11, 2022
Merged

Add AvalonST basic support #791

merged 13 commits into from
Aug 11, 2022

Conversation

kleinai
Copy link
Collaborator

@kleinai kleinai commented Jul 9, 2022

Avalon Streaming has special timing requirements and allowances which make it incompatible with Spinal streams. This PR will provide a way to model and adapt Avalon-ST between IP and Spinal streams.

@Dolu1990
Copy link
Member

Cool ^^
What is errorDescriptor: Array[String] = Array(), ?

@kleinai
Copy link
Collaborator Author

kleinai commented Jul 12, 2022

Error bits are user defined so that cares the bit descriptions with the bus. Although maybe it's best not to do that for simplicity.

}

case class AvalonSTPayload(config: AvalonSTConfig) extends Bundle {
val data: Bits = if (config.useData) Bits(config.dataWidth bit) else null
Copy link
Member

Choose a reason for hiding this comment

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

An shorter way is :

val data = config.useData generate Bits(config.dataWidth bits) //:)

val valid: Bool = if (config.useValid) Bool() else null
val payload: AvalonSTPayload = AvalonSTPayload(config)

lazy val latencyDelay: Bool = Delay(this.ready, config.readyLatency)
Copy link
Member

Choose a reason for hiding this comment

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

Hmm lazy val in a bundle, i'm realy not sure SpinalHDL will like it.
The goal of those signals is just to cache some values if used right ? Not realy to carry them along the bundle right ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Missed this. Yeah those are internal for ready tracking. Avalon as some weird timing relationships. I can un-lazy them if you think there might be problems.
Completely forgot up to now that I was working in a Bundle. XP

Copy link
Member

Choose a reason for hiding this comment

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

Hi ^^
There is still some lazy val, can you un-lazy them ?
If you want, there is the "signalCache" API.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Finally done. Let me know if I'm using signalCache right.

@kleinai kleinai marked this pull request as ready for review July 24, 2022 20:56
@kleinai
Copy link
Collaborator Author

kleinai commented Jul 24, 2022

I think this is ready. I don't personally use Avalon streams but Intel IP prefers Avalon so I think this is a nice to have as a start.

@Dolu1990
Copy link
Member

Good to me ^^
you can merge when you feel it.

@kleinai
Copy link
Collaborator Author

kleinai commented Aug 11, 2022

Will do. Thanks!

@kleinai kleinai merged commit bc5554a into SpinalHDL:dev Aug 11, 2022
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.

2 participants