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

getResources Bug #549

Closed
shunshou opened this issue Mar 12, 2017 · 4 comments
Closed

getResources Bug #549

shunshou opened this issue Mar 12, 2017 · 4 comments
Assignees

Comments

@shunshou
Copy link
Contributor

shunshou commented Mar 12, 2017

I'm trying to port over some of my previous work from Chisel2 to Chisel3. I was hoping to have one project depending on both Chisel2 and Chisel3 so I could incrementally port some stuff over (not running both at the same time). I ran into a really nasty issue when trying to get Verilator tests to work where (chisel-testers) VerilatorBackend's getResources (or w/e it's called) was pulling in the sim_api.h from chisel2 instead of the sim_api.h in chisel-testers.

If your top-level project depends on multiple sbt-projects whose src/main/resource directory contains files of the same name, it's painful to figure out how to get the precedence to be right.

The directory structure should be src/main/resource/package_name or something to disambiguate and all of your getResourceAsStream args should reflect the package_name. i.e. /packageName/file

I know this doesn't immediately affect 99% of users, but wasting time debugging this without understanding how Scala/sbt works can be a huge time sink, so please fix this!

@ucbjrl
Copy link
Contributor

ucbjrl commented Mar 12, 2017

This is related to chipsalliance/firrtl#398 (which is still waiting for review).

@shunshou
Copy link
Contributor Author

@ucbjrl how can we move this along so other people don't run into weird problems?

@ucbjrl
Copy link
Contributor

ucbjrl commented Mar 16, 2017

I propose we ensure resources are explicitly scoped in ucb-bar jars - there should be a top-level resource directory with the name of the project/jar - i.e., firrtl resources should live in src/{main,test}/resources/firrtl/..., chisel2 resources in src/{main,test}/resources/chisel2/... etc. We can discuss this at the next chisel meeting.

@chick
Copy link
Contributor

chick commented Apr 10, 2017

added this to chisel action items

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

3 participants