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 combStage() to rename returned Stream #749

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft

Conversation

pwang7
Copy link
Contributor

@pwang7 pwang7 commented May 24, 2022

No description provided.

@kleinai
Copy link
Collaborator

kleinai commented May 24, 2022

What's the rationale for this?

Also it's best not to reformat a bunch of code you're not adding anything to. It makes the diff much larger than it needs to be.

@Dolu1990
Copy link
Member

Is it about preserving as much as possible naming ?

@pwang7
Copy link
Contributor Author

pwang7 commented May 25, 2022

What's the rationale for this?

Also it's best not to reformat a bunch of code you're not adding anything to. It makes the diff much larger than it needs to be.

Sorry this PR is not done yet.
It's for renaming the returned Stream from the Stream utility functions, such as:

val myStreamName = StreamMux(...) // the generated Verilog use myStreamName as prefix

@pwang7
Copy link
Contributor Author

pwang7 commented May 25, 2022

Is it about preserving as much as possible naming ?

Yes.
I'm not sure whether this PR covers all the Stream utility function that returned Streams can be renamed?

@Dolu1990
Copy link
Member

Yes.
I'm not sure whether this PR covers all the Stream utility function that returned Streams can be renamed?

Normaly it should be possible.

But one question is :

  1. Do we want both a composite named stream + a returned stream for each function
    Ex def translateWith[T2 <: Data](that: T2): Stream[T2] = { in your pr
  2. Else, is it good enough if the function return the composite Stream, allowing for a val xx = myStreamFunc to rename it to xx

So far, i was more for 2) in order to avoid generating "duplicated" signals"

@pwang7
Copy link
Contributor Author

pwang7 commented May 28, 2022

Yes.
I'm not sure whether this PR covers all the Stream utility function that returned Streams can be renamed?

Normaly it should be possible.

But one question is :

  1. Do we want both a composite named stream + a returned stream for each function
    Ex def translateWith[T2 <: Data](that: T2): Stream[T2] = { in your pr
  2. Else, is it good enough if the function return the composite Stream, allowing for a val xx = myStreamFunc to rename it to xx

So far, i was more for 2) in order to avoid generating "duplicated" signals"

What about this case:

val someQueue = StreamFifo(...)
val queuePop = someQueue.io.pop

Will 2) keep the name prefix of queuePop instead of someQueue_io_pop?

By stick to the name explicitly defined, it's easier to debug. But like you mentioned, it might have duplicate signals.

@Dolu1990
Copy link
Member

So, the case of the

val someQueue = StreamFifo(...)
val queuePop = someQueue.io.pop

Is one where a .combStage is good to do, as the someQueue.io.pop is already strongly named by the fifo (will not be renamed by futher val xxx = yyy
(so it keep someQueue_io_pop)

@pwang7
Copy link
Contributor Author

pwang7 commented May 31, 2022

So, the case of the

val someQueue = StreamFifo(...)
val queuePop = someQueue.io.pop

Is one where a .combStage is good to do, as the someQueue.io.pop is already strongly named by the fifo (will not be renamed by futher val xxx = yyy (so it keep someQueue_io_pop)

OK, let me update my PR.

@numero-744 numero-744 marked this pull request as draft October 26, 2022 12:03
@numero-744
Copy link
Collaborator

Hi @pwang7

What is the status of this PR?

@Dolu1990
Copy link
Member

Hmm i think when there is patterns like :

def xxx() : Stream[T] = {
   val ret = Stream(T())
   ...
   ret  //Should not use combStage on ret, as that Stream can be named by val zzz = stream.xxx()
}

For all things where the returned value is a stream from a sub component, then yes, combStage is 100 % good. (i think)

@numero-744
Copy link
Collaborator

@Dolu1990 I don't understand, what should we do with this PR?

@Dolu1990
Copy link
Member

@numero-744
Copy link
Collaborator

Ping @pwang7

@pwang7
Copy link
Contributor Author

pwang7 commented Nov 17, 2022

Ping @pwang7

Let me fix this PR later.

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.

None yet

4 participants