Help needed for understanding chisel compile error after submodule update

243 views
Skip to first unread message

Ronan BARZIC

unread,
Jun 28, 2016, 5:08:33 PM6/28/16
to chisel-users
Hello,

A few months ago, I wrote a small program that used chisel, 
ucb-bar/junctions and ucb-bar/context-dependent-environments to generate an AHB multilayer interconnect in Verilog by using the verilog generation from Chisel.

The project is here  rbarzic/ml-ahb-gen and worked well until I found a potential issue in the generated code - so I decided to try to update the submodules.

The problem comes when I tried to update the junction and context-dependent-environements to the latest version on their respective master branch  :

cd junctions/
git checkout master
git pull
git log -1

commit d39a2045c6ab975f8ae52d08861f19573400bd2a
Author: Wesley W. Terpstra <wes...@sifive.com>
Date:   Wed Jun 8 14:35:22 2016 -0700

    hasti: correct fix to locking


cd ../context-dependent-environments/
git checkout master
git pull
git log -1

commit dc0537b4a3c486d10cad6d0cf33547aef8bfbbbb
Author: Colin Schmidt <col...@eecs.berkeley.edu>
Date:   Mon Jun 6 10:20:33 2016 -0700

    also catch CDEMatch errors fixes #3


* make all

make all
python ml_ahb_gen.py --json=example.json  --outdir=chisel
-I- Reading JSON file example.json
cd chisel && sbt "run --genHarness --backend v"
[info] Set current project to ahb-mli (in build file:/home/ronan/perso/github/ml-ahb-gen/chisel/)
[info] Compiling 16 Scala sources to /home/ronan/perso/github/ml-ahb-gen/chisel/target/scala-2.11/classes...
[error] /home/ronan/perso/github/ml-ahb-gen/chisel/../junctions/src/main/scala/addrmap.scala:92: type mismatch;
[error]  found   : BigInt
[error]  required: Int
[error]         val align = BigInt(1) << log2Ceil(r.size)
[error]                                             ^
[error] /home/ronan/perso/github/ml-ahb-gen/chisel/../junctions/src/main/scala/hasti.scala:206: not enough arguments for method assert: (cond: Chisel.Bool, message: String)Unit.
[error] Unspecified value parameter message.
[error]     assert (!p || !v)
[error]            ^
[error] /home/ronan/perso/github/ml-ahb-gen/chisel/../junctions/src/main/scala/hasti.scala:269: ambiguous reference to overloaded definition,
[error] both method apply in object Vec of type [T <: Chisel.Data](elt0: T, elts: T*)Chisel.Vec[T]
[error] and  method apply in object Vec of type [T <: Chisel.Data](elts: Iterable[T])Chisel.Vec[T]
[error] match argument types (Chisel.Vec[Chisel.Bool])
[error]   val selectedRequestSM = Vec(requestSM map { m => Vec(PriorityEncoderOH(m)) })
[error]                                                    ^
[error] /home/ronan/perso/github/ml-ahb-gen/chisel/../junctions/src/main/scala/hasti.scala:467: overloaded method value apply with alternatives:
[error]   (range: (Int, Int))Chisel.UInt <and>
[error]   (hi: Chisel.UInt,lo: Chisel.UInt)Chisel.UInt <and>
[error]   (hi: Int,lo: Int)Chisel.UInt <and>
[error]   (bit: Chisel.UInt)Chisel.Bool <and>
[error]   (bit: Int)Chisel.Bool <and>
[error]   (name: String)Chisel.Data
[error]  cannot be applied to ()
[error]                     mask_wide.toBits().asUInt() << io.haddr(hastiAlignment-1,0)
[error]                                        ^
[error] four errors found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 6 s, completed Jun 28, 2016 10:17:47 PM
Makefile:7: recipe for target 'gen_v' failed
make: *** [gen_v] Error 1



I have checkout  the rocket-chip project and check the version used for junctions and context-dependent-environments submodules and they are the same so I guess their chisel  code  is corrrect. 
And I can run successfully verilog generation (cd fsim ; make verilog)

So I guess my problem is coming from some issue with project setup files :

but I can't find where.

Any help would be appreciate

Best regards

Ronan






Jim Lawson

unread,
Jun 28, 2016, 5:27:07 PM6/28/16
to chisel...@googlegroups.com
Unfortunately, you need a more recent release of Chisel, which will include the changes required by current repo versions of junction.

We haven't released that version of Chisel yet, but expect to do so before the weekend. In the meantime, I would revert your version of junctions to the one you last were able to use successfully.

Alternatively, you could grab the chisel repo from GitHub and do a:

% make publishLocal

then when you build your code, explicitly set the Chisel version to 2.3-SNAPSHOT:

% make chiselVersion="2.3-SNAPSHOT" all
> --
> You received this message because you are subscribed to the Google Groups "chisel-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to chisel-users...@googlegroups.com.
> To post to this group, send email to chisel...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/chisel-users/dd7a9b3a-6de1-4c05-a581-4011de7bc58c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Ronan BARZIC

unread,
Jun 29, 2016, 2:21:39 AM6/29/16
to chisel-users
Thank you for your help. I mangaged to build the lastest version of chisel following your indications.
(I had to do a rm -Rf  ~/.ivy2/cache/edu.berkeley.cs/ first)

I got a different error now, but I guess it is due to some changes in the Hasti related code :

[error] (run-main-0) cde.ParameterUndefinedException: Parameter HastiId undefined.
cde.ParameterUndefinedException: Parameter HastiId undefined.
at cde.Parameters$$anonfun$empty$1.apply(Parameters.scala:266)
at cde.Parameters$$anonfun$empty$1.apply(Parameters.scala:266)
at cde.World$TopLookup$1.apply(Parameters.scala:152)
at cde.Parameters.apply(Parameters.scala:318)
at junctions.HasHastiParameters$class.$init$(hasti.scala:53)
at junctions.HastiBundle.<init>(hasti.scala:62)
at junctions.HastiMasterIO.<init>(hasti.scala:65)
at Ahbmli.Ahbmli$$anon$1.<init>(Ahbmli.scala:11)
at Ahbmli.Ahbmli.<init>(Ahbmli.scala:10)
at Ahbmli.Ahbmli$$anonfun$main$1$$anonfun$apply$1.apply(Ahbmli.scala:46)
at Ahbmli.Ahbmli$$anonfun$main$1$$anonfun$apply$1.apply(Ahbmli.scala:46)
at Chisel.Module$.Chisel$Module$$init(Module.scala:65)
at Chisel.Module$.apply(Module.scala:50)
at Ahbmli.Ahbmli$$anonfun$main$1.apply(Ahbmli.scala:46)
at Ahbmli.Ahbmli$$anonfun$main$1.apply(Ahbmli.scala:46)
at Chisel.Driver$.execute(Driver.scala:107)
at Chisel.Driver$.apply(Driver.scala:41)
at Chisel.Driver$.apply(Driver.scala:64)
at Chisel.chiselMain$.apply(hcl.scala:62)
at Chisel.chiselMainTest$.apply(hcl.scala:75)
at Ahbmli.Ahbmli$.main(Ahbmli.scala:46)
at Ahbmli.Ahbmli.main(Ahbmli.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
[trace] Stack trace suppressed: run last compile:run for the full output.
java.lang.RuntimeException: Nonzero exit code: 1
at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run last compile:run for the full output.
[error] (compile:run) Nonzero exit code: 1
[error] Total time: 19 s, completed Jun 29, 2016 8:16:07 AM

Ronan BARZIC

unread,
Jun 29, 2016, 5:23:11 AM6/29/16
to chisel-users
I've tried to add the required parameters as follow :


class Ahbmli extends Module {

  implicit val p = Parameters.empty
  val ahbmli_params = p.alter(
    (pname,site,here,up) => pname match {

      case HastiKey("TL") =>
        HastiParameters(
          addrBits = 12,
          dataBits = 12)

      case HastiId => "TL"
  }
  )

....

without success.

Any idea  how to pass correctly the configuration ? I looked into the rockect chip but it is really difficult to understand

Ronan BARZIC

unread,
Jun 29, 2016, 7:11:08 AM6/29/16
to chisel-users
I finally got it to work (I forgot to pass the implicit parameters)

Jim Lawson

unread,
Jun 29, 2016, 9:45:06 AM6/29/16
to chisel...@googlegroups.com
Thanks for the feedback. This means it's time to bump our SNAPSHOT version.
> To view this discussion on the web visit https://groups.google.com/d/msgid/chisel-users/12f606cb-37d3-42d7-b8f0-afaa8067a857%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages