use of de.neemann.digital.hdl.model2.expression.ExprNot in project Digital by hneemann.
the class HDLCircuit method createNot.
private HDLNode createNot(HDLPort p, HDLNode node) throws HDLException, NodeException, PinException {
final ElementAttributes attr = new ElementAttributes().setBits(p.getBits());
HDLNodeAssignment n = new HDLNodeAssignment(Not.DESCRIPTION.getName(), attr, name -> p.getBits());
HDLNet outNet = new HDLNet(null);
listOfNets.add(outNet);
HDLNet inNet = p.getNet();
inNet.remove(p);
n.addPort(new HDLPort(Not.DESCRIPTION.getInputDescription(attr).get(0).getName(), inNet, HDLPort.Direction.IN, p.getBits()));
n.addPort(new HDLPort(Not.DESCRIPTION.getOutputDescriptions(attr).get(0).getName(), outNet, HDLPort.Direction.OUT, p.getBits()));
p.setNet(outNet);
node.replaceNet(inNet, outNet);
n.setExpression(new ExprNot(new ExprVar(n.getInputs().get(0).getNet())));
return n;
}
Aggregations