LogicNet.port constructor

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

Constructs a new LogicNet with some additional validation for ports of Modules.

Useful for Interface definitions.

Implementation

factory LogicNet.port(String name, [int width = 1]) {
  if (!Sanitizer.isSanitary(name)) {
    throw InvalidPortNameException(name);
  }

  return LogicNet(
    name: name,
    width: width,

    // make port names mergeable so we don't duplicate the ports
    // when calling connectIO
    naming: Naming.mergeable,
  );
}