HasTypeAlias

chisel3.experimental.HasTypeAlias
trait HasTypeAlias

Attributes

Source
HasTypeAlias.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Abstract methods

An optional FIRRTL type alias name to give to this Record. If overrided with an instance of a RecordAlias, such as RecordAlias("UserBundle"), this causes emission of circuit-level FIRRTL statements that declare that name for this bundle type:

An optional FIRRTL type alias name to give to this Record. If overrided with an instance of a RecordAlias, such as RecordAlias("UserBundle"), this causes emission of circuit-level FIRRTL statements that declare that name for this bundle type:

Attributes

Example
class MyBundle extends Bundle with HasTypeAlias {
 override def aliasName = RecordAlias("UserBundle")
}
circuit Top :
 type UserBundle = { ... }
 module Top :
   // ...

This is used as a strong hint for the generated type alias: steps like sanitization and disambiguation may change the resulting alias by necessity, so there is no certain guarantee that the desired name will show up in the generated FIRRTL. In case of coercion with Input and Output, which inherently modifies the structure of Records, an additional suffix is appended to any such Records which contain flipped values subsequently 'stripped' by Input/Output.

class MyBundle extends Bundle with HasTypeAlias {
 override def aliasName = RecordAlias("UserBundle")
 val foo = Flipped(UInt(8.W))
}
class Top extends Module {
 val in = IO(Input(new MyBundle)) // Note that this strips flipped-ness from in.foo
}
circuit Top :
 type UserBundle_stripped = { foo : UInt<8>}
 module Top :
   flip in : UserBundle_stripped
   // ...

This suffix can be modified by providing a secondary string when instantiating RecordAlias.

Source
HasTypeAlias.scala