chisel icon indicating copy to clipboard operation
chisel copied to clipboard

Mill Blackbox Resource Loading Doesn't Work

Open seldridge opened this issue 1 year ago • 0 comments

When running tests with mill, tests involving reading from resources do not work. I think this is because mill will, by default, use a different project structure (https://stackoverflow.com/questions/73370982/cannot-load-resource-files-using-scala-mill).

This can be reproduced with the following command:

./mill 'chiselut[2.13.14].testOnly' chiselTests.simulator.SimulatorSpec -- -z "runs a design that includes an external module"

This produces:

- runs a design that includes an external module *** FAILED ***
  os.ResourceNotFoundException: jdk.internal.loader.ClassLoaders$AppClassLoader@200a570f/chisel3/simulator/Baz.sv
  at os.ResourcePath.getInputStream(ResourcePath.scala:21)
  at os.read$bytes$.apply(ReadWriteOps.scala:272)
  at os.read$.apply(ReadWriteOps.scala:229)
  at os.read$.apply(ReadWriteOps.scala:227)
  at chisel3.util.HasExtModuleResource.addResource(ExtModuleUtils.scala:26)
  at chisel3.util.HasExtModuleResource.addResource$(ExtModuleUtils.scala:21)
  at chiselTests.simulator.SimulatorSpec$Baz$1.addResource(SimulatorSpec.scala:114)
  at chiselTests.simulator.SimulatorSpec$Baz$1.<init>(SimulatorSpec.scala:116)
  at chiselTests.simulator.SimulatorSpec$Foo$1.$anonfun$new$19(SimulatorSpec.scala:127)
  at chisel3.Module$.evaluate(Module.scala:94)

This is the same resource path that exists when running with sbt, but mill can't load it.

seldridge avatar Aug 15 '24 21:08 seldridge