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

Private vals #407

Merged
merged 2 commits into from
Jan 27, 2017
Merged

Private vals #407

merged 2 commits into from
Jan 27, 2017

Conversation

jackkoenig
Copy link
Contributor

After looking at the public API for Queue (see all of the public vals https://chisel.eecs.berkeley.edu/api/index.html#chisel3.util.Queue), I wanted to clean it up a little bit.

So it turns out that Chisel already names private vals, Scala just gives them really crazy names (like chisel3$util$Queue$$ram) so I wrote a function to clean these names up. I have not been able to figure out a way to detect if something is a private val via java reflection so this cleanup is my hacky alternative. Suggestions welcome.

I also changed all of the public fields in util that I could find that have no business being public (since accessing them externally would result in invalid Firrtl)

Copy link
Member

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

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

Nice.

* without $$ unchanged
*/
def cleanName(name: String): String = {
val split = name.split("\\$\\$")
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be single lined as

name.split("""\$\$""").lastOption.getOrElse(name)

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.

3 participants