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

Provide suggestName to Queue(and other Chisel Library Moduels) #4055

Open
sequencer opened this issue May 5, 2024 · 1 comment
Open

Provide suggestName to Queue(and other Chisel Library Moduels) #4055

sequencer opened this issue May 5, 2024 · 1 comment

Comments

@sequencer
Copy link
Member

Type of issue: Feature Request

Describe the solution you'd like
Queue API doesn't return the Instance of Queue, which makes user impossible to access the Queue instance to suggestName. This makes queue with an unstable and ugly name.
e.g. https://shz.al/iccR

Queue2_AW_ID4_DATA32_ADDR39 view__aw_deq_q (
  ...
);

Describe alternatives you've considered

Additional context
What is the use case for implementing this feature?

@jackkoenig
Copy link
Contributor

It seems to name the instance okay if you assign the result of the Queue.apply call to a val, eg:

  val q = Queue(in, 4)

Gives

inst q_q of Queue4_UInt8

(Scastie: https://scastie.scala-lang.org/kJHzJhOWT7WsHGFIxNkd7g)

But if you immediately connect the output to a view, it prefixes based on the name of the view and you end up with that nasty name...

  val in = IO(Flipped(Decoupled(UInt(8.W))))
  val out = IO(Decoupled(UInt(8.W)))
  val viewOfOut = out.viewAs

  viewOfOut :<>= Queue(in, 4)

Gives

inst view__q of Queue4_UInt8

(Scastie: https://scastie.scala-lang.org/xINQireDTK23N2QYIpuYjA)

So there are potentially 2 issues here:

  1. Improve naming when views are used as prefixes
  2. Make it possible to influence the _q suffix for Queue instances, perhaps we could expose a String argument that defaults to "q".

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

No branches or pull requests

2 participants