Giter Club home page Giter Club logo

Comments (6)

Dolu1990 avatar Dolu1990 commented on June 2, 2024

Hi,

SpinalHDL can't realy be used in console mode in this way. You have to provide a toplevel component :

SpinalVerilog(new MyTopLevel)

And have all your hardware statements in that toplevel herarchy

Reason is that SpinalHDL has a lot of hidden stuff happening under the hood which require some setup (done by the SpinalVerilog function)

from spinalhdl.

andreasWallner avatar andreasWallner commented on June 2, 2024

FYI in case the sbt startup time is annoying you and that's the reason why you want to use the REPL: you can just start sbt once and repeatedly run runMain, etc. in there - that makes it much quicker to use. (sorry in case you already knew)

from spinalhdl.

soartang avatar soartang commented on June 2, 2024

FYI in case the sbt startup time is annoying you and that's the reason why you want to use the REPL: you can just start sbt once and repeatedly run runMain, etc. in there - that makes it much quicker to use. (sorry in case you already knew)

Thanks for pointing out this. Personally I prefer the console way (works like python console which I use a lot). Though '~runMain' produces immediate results, it runs the whole code and print everything all at once.

With console, it seems to be more newbie-friendly. For example, to find out the difference between 'd := a |<< c' and 'd := a << c', I can put them in console and see the difference.

from spinalhdl.

soartang avatar soartang commented on June 2, 2024

Hi,

SpinalHDL can't realy be used in console mode in this way. You have to provide a toplevel component :

SpinalVerilog(new MyTopLevel)

And have all your hardware statements in that toplevel herarchy

Reason is that SpinalHDL has a lot of hidden stuff happening under the hood which require some setup (done by the SpinalVerilog function)

Go it. Assume I'd like to learn the difference of '##' and '@@', as a newbie, the preferable way to do so is to type the following code (Pardon me if it has errors):

val a = U"8'h5"
val b = U"8'hA"
println( a @@ b )
println( a ## b)

Is there a way?

from spinalhdl.

Dolu1990 avatar Dolu1990 commented on June 2, 2024

Personnaly, i'm using Intellij Idea and that template project :
https://github.com/SpinalHDL/SpinalTemplateSbt

Else you can use sbt to generate some verilog, see the readme of that template project.

Else you can do some one liner as :
SpinalVerilog(new Component{val a = U"8'h5"; val b = U"8'hA"}).printRtl()

But the thing is that you need your repl to have the SpinalHDL compiler plugin in. i never tried.

from spinalhdl.

soartang avatar soartang commented on June 2, 2024

Personnaly, i'm using Intellij Idea and that template project : https://github.com/SpinalHDL/SpinalTemplateSbt

Else you can use sbt to generate some verilog, see the readme of that template project.

Else you can do some one liner as : SpinalVerilog(new Component{val a = U"8'h5"; val b = U"8'hA"}).printRtl()

But the thing is that you need your repl to have the SpinalHDL compiler plugin in. i never tried.

OK, i'll figure it out. Thank you Dolu.

from spinalhdl.

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.