1 package net.mograsim.logic.model.verilog.converter;
3 import java.util.Objects;
5 import net.mograsim.logic.model.model.wires.Pin;
10 private final int bit;
12 public PinBit(Pin pin, int bit)
14 this.pin = Objects.requireNonNull(pin);
22 if (bit < 0 || bit >= pin.logicWidth)
23 throw new IllegalArgumentException("Bit out of range for pin " + pin + ": " + bit);
36 public PinNameBit toPinNameBit()
38 return new PinNameBit(pin.name, bit);
42 public String toString()
44 return pin + "[" + bit + "]";
52 result = prime * result + bit;
53 result = prime * result + ((pin == null) ? 0 : pin.hashCode());
58 public boolean equals(Object obj)
64 if (getClass() != obj.getClass())
66 PinBit other = (PinBit) obj;
71 if (other.pin != null)
73 } else if (!pin.equals(other.pin))