SpinalHDL / SpinalTemplateSbt

A basic SpinalHDL project
77 stars 64 forks source link

Structure suggestion #23

Closed numero-744 closed 1 year ago

numero-744 commented 1 year ago

Draft structure suggestion according to SpinalHDL/SpinalDoc-RTD#147

There are no unit / regression tests yet; I won't add anything for that before SpinalHDL/SpinalHDL#965 is merged and released (feedback welcome btw), or closed.

Don't merge before:

numero-744 commented 1 year ago

@Dolu1990 you started a review, so do I assume agreement on the structure?

So:

Dolu1990 commented 1 year ago

One issue is the MyTopLevel folder :

So it realy has to be removed Which also kind of trash the xxx.scala structure you have. In someway, i think it need to be reverted back to something more similar to the original structure MyTopLevelGen.scala and so on

numero-744 commented 1 year ago

Wilco for MyTopLevelGen.scala-like names with no MyTopLevel folder. It is a little bit less structured but that's not a big deal as it is compliant with lexical order so all is fine :+1:

Other things to change? Can I start documenting?

numero-744 commented 1 year ago

For MyTopLevelVerilog and MyTopLevelVhdl they are not in a MyTopLevelXxx file, isn't it an issue there too?

Maybe we should have this, which generates all by default, and depending on the synthesis tool used the users can remove the ones they don't need?

object MyTopLevelGen extends App {
  config.spinal.generateVerilog(MyTopLevel())
  config.spinal.generateVhdl(MyTopLevel())
}
Dolu1990 commented 1 year ago

Other things to change? Can I start documenting?

So this and the other topics which were already opened, that's all ^^

For MyTopLevelVerilog and MyTopLevelVhdl they are not in a MyTopLevelXxx file, isn't it an issue there too?

Not an issue they can be both into MyTopLevelGen.scala

object MyTopLevelGen

Hmmm i think the best is to keep a Verilog and a Vhdl object instead of running two time the generation (which is something that normaly nobody do)

numero-744 commented 1 year ago

Tested with mill running:

mill projectname.runMain projectname.MyTopLevelSim
numero-744 commented 1 year ago

Rebased to clean history.

@Dolu1990 for merging

numero-744 commented 1 year ago

@Dolu1990 I added two little commits as the PR is still open, but it can be merged I think

Dolu1990 commented 1 year ago

Nice, thanks :)