1 package net.mograsim.logic.model.verilog.model.signals;
3 import java.util.Objects;
5 public abstract class Signal
7 private final Type type;
8 private final int width;
10 public Signal(Type type, int width)
12 this.type = Objects.requireNonNull(type);
21 throw new IllegalArgumentException("Signal width is negative: " + width);
34 public abstract String toReferenceVerilogCode();
41 result = prime * result + ((type == null) ? 0 : type.hashCode());
42 result = prime * result + width;
47 public boolean equals(Object obj)
53 if (getClass() != obj.getClass())
55 Signal other = (Signal) obj;
56 if (type != other.type)
58 if (width != other.width)
63 public static enum Type
65 WIRE, IO_INPUT, IO_OUTPUT, CONSTANT;