use of de.neemann.digital.hdl.model2.expression.ExprVar 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;
}
use of de.neemann.digital.hdl.model2.expression.ExprVar in project Digital by hneemann.
the class HDLNodeAssignment method replaceNet.
@Override
public void replaceNet(HDLNet oldNet, HDLNet newNet) {
super.replaceNet(oldNet, newNet);
expression.replace(oldNet, new ExprVar(newNet));
}
Aggregations