question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect Error Message in Data.connect(...)

See original GitHub issue

In https://github.com/freechipsproject/chisel3/blob/master/chiselFrontend/src/main/scala/chisel3/Data.scala#L377:

      requireIsHardware(this, "data to be connected")
      requireIsHardware(that, "data to be connected")

The first error message is incorrect. It should be something like left hand side of the connection.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mwachs5commented, Aug 27, 2021

@Onyinye91-ctrl thanks for looking into this! I think @ekiwi was suggesting to add a new “property” to that ConnectSpec, something like:

  property("non-hardware := hardware should fail") {
    intercept[ChiselException]{
      extractCause[ChiselException] {
        ChiselStage.elaborate { new ??? } } }
  }

but since we are especially interested in intercepting the error message and seeing that it is your new message, not sure this is exactly right and I’m not sure what to put for the ??? from that file… looking to see if there is a better example in the codebase.

EDIT: Perhaps you could add a new circuit at the top of the file:

// Existing code
class CrossConnects(inType: Data, outType: Data) extends Module {
  val io = IO(new Bundle {
    val in = Input(inType)
    val out = Output(outType)
  })
  io.out := io.in
}

// New Circuit that shows the bad behavior
class BadConnectLeft(inType: Data, outType: Data) extends Module {
  val io = IO(new Bundle {
    val in = Input(inType)
    val out = Output(outType)
  })
  io.out := io.in
  val foo = inType // This is not hardware since we did not use `Wire(...)` or `Reg(...)`
  foo := io.in // should trigger your new error message about the left-hand side not being hardware
}

Then your property could be:

  property("non-hardware := hardware should fail") {
    intercept[ChiselException]{
      extractCause[ChiselException] {
        ChiselStage.elaborate { new BadConnectLeft(inType = Bool(), outType = Bool() )} } }
  }

Here is a scastie link that shows the error message that we currently get “data to be connected…” when trying to build my BadConnectLeft example:

https://scastie.scala-lang.org/sYbi2GJQRqG0WOaH0y4l6g

Screen Shot 2021-08-27 at 8 41 26 AM
1reaction
mwachs5commented, Aug 26, 2021

Something like:

requireIsHardware(this, "left hand side of the connection")

The usage is that if user does something wrong, they would get an error like “The left hand side of the connection must be hardware, but it is not”.

The link is outdated, here is an update one:

https://github.com/chipsalliance/chisel3/blob/1ceb974c55c6785c21ab3934fa750ade0702e276/core/src/main/scala/chisel3/Data.scala#L469

There may be some unit tests that will fail if they were checking for that exact message, and if so the task would also need to update what those tests are checking for (but I don’t know if there are any tests for this error message).

EDIT: @ekiwi said it better!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting
Unable to launch DataConnect or displays an error while creating or opening artifacts. Solution: Eclipse may persist its state during installations.
Read more >
Connecting to your data: Error messages - Klipfolio Help Center
When you connect to your data using Klipfolio's REST/URL connector, you may encounter an error message. To help find a solution to the......
Read more >
Handling data source errors (Power Query) - Microsoft Support
Advice on how to identify, deal with, and resolve errors from externals data sources and Power Query when you refresh data.
Read more >
Data Source Connection Error - IBM
1. The data source credentials are invalid in the server configuration. Contact the administrator. 2. The connection test failed 3. The data ...
Read more >
Common error messages you receive when trying to connect ...
The error “proxy host not found” indicates that the proxy server is incorrectly specified in the Internet Preferences for Stata. Contact your network ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found