Search code examples
chisel

Module is an object or a class?


In chisel, we should always extend from 'Module' to define our own module, right?

But, I can only find the definition of 'Module' at 'core/src/main/scala/chisel3/Module.scala' - it's a 'object'! We extend from an object? Or sth I've missed?


Solution

  • When you extend Module the class hierarchy looks like Module <= abstract class LegacyModule. So it is a class. There is also a object Module that has apply methods that are used differently. BTW, having a good IDE like IntelliJ can make it much easier to navigate class hierarchies and figure out where things are coming from.