Port constructor

Port(
  1. String name, [
  2. int width = 1
])

Constructs a Logic intended to be used for ports of a Module or in an Interface.

Implementation

Port(String name, [int width = 1])
    : super(
        name: name,
        width: width,

        // make port names mergeable so we don't duplicate the ports
        // when calling connectIO
        naming: Naming.mergeable,
      ) {
  if (!Sanitizer.isSanitary(name)) {
    throw InvalidPortNameException(name);
  }
}