GithubHelp home page GithubHelp logo

Comments (5)

eruanno123 avatar eruanno123 commented on July 2, 2024

Btw. "vexriscv.custom.Risky" is a copy of "Briey" with my customization to the peripherals. As I mentioned, I will try to provide an example of the issue, once I strip it down from many things unrelated to the main issue.

from vexriscv.

eruanno123 avatar eruanno123 commented on July 2, 2024

The reasonable workaround I just found is enabling the traces during the first pass by providing debugComponents to the SpinalConfig:

val debugComponents = HashSet[Class[_]]()
debugComponents += this.getClass()

val config =
  SpinalConfig(
    /*... */,
    debugComponents = debugComponents
  )

config.generateVerilog({
  val toplevel = new Risky(riskyConfig.copy(sdramLayout = IS42x160G.layout))
  toplevel
})

Now, I get correct elaboration failure results

[info] [Progress] at 1.721 : Checks and transforms
[error] Exception in thread "main" spinal.core.SpinalExit: 
[error]  Error detected in phase PhaseCheck_noLatchNoOverride
[error] ********************************************************************************
[error] ********************************************************************************
[error] NO DRIVER ON (toplevel/axi_bootManager/aclk : in Bool), defined at
[error] ???
[error] ********************************************************************************
[error] ********************************************************************************
[error] NO DRIVER ON (toplevel/axi_bootManager/aresetn : in Bool), defined at
[error] ???

from vexriscv.

Dolu1990 avatar Dolu1990 commented on July 2, 2024

Hi,

The reasonable workaround I just found is enabling the traces during the first pass by providing debugComponents to the SpinalConfig:

How was your scala main which was generating the hardware before ?
The issue you had will happen if you define the VexRiscv config outside the generateVerilog block.

Was it the case ?

from vexriscv.

eruanno123 avatar eruanno123 commented on July 2, 2024

Thanks for the quick response.

I think this might be the case, although I am not sure if making a copy of the configuration counts. I am building the configuration starting from defaults and 'injecting' modifications passed through the command line. I will check if it helps to refactor the code, so that things happen under the generateVerilog block.

class CommandLineConf(arguments: Seq[String]) extends ScallopConf(arguments) {
  val outputDir = opt[String]("output", short = 'O', default = Some("_build"))
  val hwJtag = toggle("hw-jtag")
  val coreFrequency = opt[Int](
    "core-frequency",
    default = Some(100000000),
    validate = (0 to 300000000).contains
  )

  val makeIntRangeArg =
    (name: String, default: Some[Int], minVal: Int, maxVal: Int) =>
      opt[Int](name, default = default, validate = (minVal to maxVal).contains)

  val makeApbAddressArg = (id: Int) =>
    makeIntRangeArg(s"apb${id}-address-width", Some(21), 12, 32)

  val apb1AddressWidth = makeApbAddressArg(1)
  val apb2AddressWidth = makeApbAddressArg(2)

  val noDma = toggle("no-dma")

  verify()

  def propagateRiskyConfig(baseConfig: RiskyConfig): RiskyConfig = {
    baseConfig.copy(
      useHardwareJtag = hwJtag.toOption.getOrElse(false),
      axiFrequency = coreFrequency.toOption.getOrElse(100000000) Hz,
      apb1BusConfig = RiskyConfig.default.apb1BusConfig
        .copy(addressWidth = apb1AddressWidth.toOption.getOrElse(21)),
      apb2BusConfig = RiskyConfig.default.apb2BusConfig
        .copy(addressWidth = apb2AddressWidth.toOption.getOrElse(21)),
      saxi1BusPresent = !noDma.toOption.getOrElse(false)
    )
  }

  def getOutputBuildDirectory(): String = outputDir.toOption.get
}

// Implementation for Terasic DE0-Nano board
object RiskyDe0Nano {
  def main(args: Array[String]) {
    val cmdLineConfig = new CommandLineConf(args)
    val riskyConfig = cmdLineConfig.propagateRiskyConfig(RiskyConfig.default)
 
   // ... here is some irrelevant SDRAM stuff

    val debugComponents = HashSet[Class[_]]()
    debugComponents += this.getClass()

    val config =
      SpinalConfig(
        targetDirectory = cmdLineConfig.getOutputBuildDirectory(),
        debugComponents = debugComponents
      )

    config.generateVerilog({
      val toplevel =
        new Risky(riskyConfig.copy(sdramLayout = IS42x160G.layout))
      toplevel
    })
  }
}

from vexriscv.

eruanno123 avatar eruanno123 commented on July 2, 2024

I am confirming this is indeed the reason I am observing the issue. The following modification works as intended:

    config.generateVerilog({
      // moved riskyConfig here:
      val riskyConfig = cmdLineConfig.propagateRiskyConfig(RiskyConfig.default)
      val toplevel =
        new Risky(riskyConfig.copy(sdramLayout = IS42x160G.layout))
      toplevel
    })

Many thanks for help!

from vexriscv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.