mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-12 22:36:02 -04:00
fixes #387
This commit is contained in:
parent
8d1defdfe0
commit
a624fb4adb
@ -21,7 +21,7 @@ public class InlineManyToOne implements Optimization {
|
|||||||
if (node instanceof HDLNodeAssignment) {
|
if (node instanceof HDLNodeAssignment) {
|
||||||
HDLNodeAssignment assign = (HDLNodeAssignment) node;
|
HDLNodeAssignment assign = (HDLNodeAssignment) node;
|
||||||
final HDLNet net = assign.getTargetNet();
|
final HDLNet net = assign.getTargetNet();
|
||||||
if (net.getInputs().size() == 1) {
|
if (net != null && net.getInputs().size() == 1) {
|
||||||
HDLNode receiver = net.getInputs().get(0).getParent();
|
HDLNode receiver = net.getInputs().get(0).getParent();
|
||||||
if (receiver instanceof HDLNodeSplitterManyToOne) {
|
if (receiver instanceof HDLNodeSplitterManyToOne) {
|
||||||
HDLNodeSplitterManyToOne mto = (HDLNodeSplitterManyToOne) receiver;
|
HDLNodeSplitterManyToOne mto = (HDLNodeSplitterManyToOne) receiver;
|
||||||
|
@ -265,10 +265,12 @@ public class VerilogCreator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void printExpression(HDLNodeAssignment node) throws IOException, HDLException {
|
private void printExpression(HDLNodeAssignment node) throws IOException, HDLException {
|
||||||
|
if (node.getTargetNet() != null) {
|
||||||
out.print("assign ").print(node.getTargetNet().getName()).print(" = ");
|
out.print("assign ").print(node.getTargetNet().getName()).print(" = ");
|
||||||
printExpression(node.getExpression());
|
printExpression(node.getExpression());
|
||||||
out.println(";");
|
out.println(";");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void printExpression(Expression expression) throws IOException, HDLException {
|
private void printExpression(Expression expression) throws IOException, HDLException {
|
||||||
if (expression instanceof ExprVar)
|
if (expression instanceof ExprVar)
|
||||||
|
@ -254,10 +254,12 @@ public class VHDLCreator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void printExpression(HDLNodeAssignment node) throws IOException, HDLException {
|
private void printExpression(HDLNodeAssignment node) throws IOException, HDLException {
|
||||||
|
if (node.getTargetNet() != null) {
|
||||||
out.print(node.getTargetNet().getName()).print(" <= ");
|
out.print(node.getTargetNet().getName()).print(" <= ");
|
||||||
printExpression(node.getExpression());
|
printExpression(node.getExpression());
|
||||||
out.println(";");
|
out.println(";");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void printExpression(Expression expression) throws IOException, HDLException {
|
private void printExpression(Expression expression) throws IOException, HDLException {
|
||||||
if (expression instanceof ExprVar)
|
if (expression instanceof ExprVar)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user