Grouping Modules

21 views
Skip to first unread message

Kartik Prabhu

unread,
May 26, 2022, 7:44:47 PM5/26/22
to chisel-users
Hello,

I have a question regarding grouping of modules into a submodule. 

If I have the following:
class Block extends Module {
   ...
}
class Top extends Module {
   val blockA = Module(new Block)
   val blockB = Module(new Block)
   val blockC = Module(new Block)
}
This will generate a hierarchy like the following:
Top
   Top.blockA
   Top.blockB
   Top.blockC


Suppose I want to group blockA and blockB into a new Module, and instead want a hierarchy like:
Top
   Top.subblock
     Top.subblock.blockA
     Top.subblock.blockB
   Top.blockC


Is there an easy way to accomplish this without having to manually create new classes for each grouping that I want? I looked at group() but this only works with Data, not with Module.


 

Martin Schoeberl

unread,
May 31, 2022, 6:30:58 AM5/31/22
to chisel...@googlegroups.com
Modules, which are Scala classes, are the tool to structure your circuit in modules/components. This is very much the same as you use classes in Java/Scala to structure your program. What else would you like to do?

Cheers,
Martin

--
You received this message because you are subscribed to the Google Groups "chisel-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chisel-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chisel-users/5a4d923f-6ce1-4820-bfc9-6938c32c48c1n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages