7

When I run example chisel design from the learning-journey project, I am seeing error as following:

    $ ./run-examples.sh SimpleALU
    ...
    [info] Set current project to chisel-tutorial (in build file:/home/fchen/work/learning-journey/)
    [error] Expected ';'
    [error] test:run-main examples.Launcher SimpleALU
    [error]                                          ^

Does anyone know what might have gone wrong?

Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420
Fei Chen
  • 91
  • 2
  • The following link gives a solution: https://stackoverflow.com/questions/61944441/error-expected-when-running-sbt-command-in-terminal – Fei Chen Aug 16 '20 at 17:51

2 Answers2

2

tl;dr Edit run-examples.sh to use sbt runMain instead.


learning-journey/run-examples.sh looks as follows:

#!/usr/bin/env bash
args=$@
sbt -v "test:run-main examples.Launcher $args"

That basically boils down to executing run-main command. That's no longer available in the recent sbt versions.

$ sbt -V
sbt version in this project: 1.3.13
sbt script version: 1.3.13

$ sbt run-main whatever
...
[error] Expected ';'
[error] Not a valid command: run-main
[error] Not a valid project ID: run-main
[error] Expected ':'
[error] Not a valid key: run-main (similar: runMain, bgRunMain, fgRunMain)
[error] run-main
[error]         ^

That's exactly the error, isn't it?

Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420
1

Instead of run-main, one should use runMain. run-main was deprecated and removed from SBT several years ago.

Just as a mild warning, that repo is a little dated, using Chisel 3.1.8 when the latest release is 3.3.2 with 3.4.0 set to be released soon. Technically 3.1.8 is only a year old but the last year has seen a lot of development.

Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420
Jack Koenig
  • 5,840
  • 15
  • 21