mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-12 14:26:09 -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) {
|
||||
HDLNodeAssignment assign = (HDLNodeAssignment) node;
|
||||
final HDLNet net = assign.getTargetNet();
|
||||
if (net.getInputs().size() == 1) {
|
||||
if (net != null && net.getInputs().size() == 1) {
|
||||
HDLNode receiver = net.getInputs().get(0).getParent();
|
||||
if (receiver instanceof HDLNodeSplitterManyToOne) {
|
||||
HDLNodeSplitterManyToOne mto = (HDLNodeSplitterManyToOne) receiver;
|
||||
|
@ -61,7 +61,7 @@ public class VerilogCreator {
|
||||
* @return the verilog signal type
|
||||
*/
|
||||
public static String getType(HDLPort.Direction dir, int bits) {
|
||||
String result = (dir == HDLPort.Direction.IN)? "input" : "output";
|
||||
String result = (dir == HDLPort.Direction.IN) ? "input" : "output";
|
||||
|
||||
if (bits > 1) {
|
||||
result += " [" + (bits - 1) + ":0]";
|
||||
@ -265,10 +265,12 @@ public class VerilogCreator {
|
||||
}
|
||||
|
||||
private void printExpression(HDLNodeAssignment node) throws IOException, HDLException {
|
||||
if (node.getTargetNet() != null) {
|
||||
out.print("assign ").print(node.getTargetNet().getName()).print(" = ");
|
||||
printExpression(node.getExpression());
|
||||
out.println(";");
|
||||
}
|
||||
}
|
||||
|
||||
private void printExpression(Expression expression) throws IOException, HDLException {
|
||||
if (expression instanceof ExprVar)
|
||||
|
@ -254,10 +254,12 @@ public class VHDLCreator {
|
||||
}
|
||||
|
||||
private void printExpression(HDLNodeAssignment node) throws IOException, HDLException {
|
||||
if (node.getTargetNet() != null) {
|
||||
out.print(node.getTargetNet().getName()).print(" <= ");
|
||||
printExpression(node.getExpression());
|
||||
out.println(";");
|
||||
}
|
||||
}
|
||||
|
||||
private void printExpression(Expression expression) throws IOException, HDLException {
|
||||
if (expression instanceof ExprVar)
|
||||
|
Loading…
x
Reference in New Issue
Block a user