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

Source Locators Are Absolute, but Missing Leading Slash #3206

Open
seldridge opened this issue Apr 25, 2023 · 0 comments
Open

Source Locators Are Absolute, but Missing Leading Slash #3206

seldridge opened this issue Apr 25, 2023 · 0 comments
Labels

Comments

@seldridge
Copy link
Member

I noticed that the firtool-produced error messages coming out of scala-cli are not showing up. I think this is due to the source locators being emitted kind of strangely. Consider:

//> using scala "2.13.10"
//> using lib "org.chipsalliance::chisel::5.0.0-RC1"
//> using plugin "org.chipsalliance:::chisel-plugin::5.0.0-RC1"
//> using options "-unchecked", "-deprecation", "-language:reflectiveCalls", "-feature", "-Xcheckinit", "-Xfatal-warnings", "-Ywarn-dead-code", "-Ywarn-unused", "-Ymacro-annotations"

import chisel3._
import circt.stage.ChiselStage

class Foo extends Module {
  val x = IO(Output(Reset()))
}

object Main extends App {
  println(ChiselStage.emitCHIRRTL(new Foo))
  println(
    ChiselStage.emitSystemVerilog(
      gen = new Foo,
      firtoolOpts = Array("-disable-all-randomization", "-strip-debug-info")
    )
  )
}

The CHIRRTL is:

FIRRTL version 2.0.0
circuit Foo :
  module Foo :
    input clock : Clock
    input reset : UInt<1>
    output x : Reset @[Users/schuylere/repos/github.com/llvm/circt/build/scala-cli/Foo.scala 10:13]

    skip

Note that the source locator is Users/schuylere/.... I.e., this is a relative path, but is actually absolute.

The error (top-level module uninferred reset port) is then reported as:

Users/schuylere/repos/github.com/llvm/circt/build/scala-cli/Foo.scala:10:13: error: a port "x" with abstract reset type was unable to be inferred by InferResets (is this a top-level port?)
<stdin>:3:10: note: the module with this uninferred reset port was defined here
  module Foo :
         ^

If I manually change the source locator to be absolute, I get:

/Users/schuylere/repos/github.com/llvm/circt/build/scala-cli/Foo.scala:10:13: error: a port "x" with abstract reset type was unable to be inferred by InferResets (is this a top-level port?)
  val x = IO(Output(Reset()))
            ^
Foo.fir:3:10: note: the module with this uninferred reset port was defined here
  module Foo :
         ^
@seldridge seldridge added the bug label May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant