Search in sources :

Example 6 with ConnectionEnd

use of com.bfh.logisim.designrulecheck.ConnectionEnd in project logisim-evolution by reds-heig.

the class AbstractHDLGeneratorFactory method GetClockNetName.

public static String GetClockNetName(NetlistComponent comp, int EndIndex, Netlist TheNets) {
    StringBuffer Contents = new StringBuffer();
    if ((TheNets.GetCurrentHierarchyLevel() != null) && (EndIndex >= 0) && (EndIndex < comp.NrOfEnds())) {
        ConnectionEnd EndData = comp.getEnd(EndIndex);
        if (EndData.NrOfBits() == 1) {
            Net ConnectedNet = EndData.GetConnection((byte) 0).GetParrentNet();
            byte ConnectedNetBitIndex = EndData.GetConnection((byte) 0).GetParrentNetBitIndex();
            /* Here we search for a clock net Match */
            int clocksourceid = TheNets.GetClockSourceId(TheNets.GetCurrentHierarchyLevel(), ConnectedNet, ConnectedNetBitIndex);
            if (clocksourceid >= 0) {
                Contents.append(ClockTreeName + Integer.toString(clocksourceid));
            }
        }
    }
    return Contents.toString();
}
Also used : ConnectionEnd(com.bfh.logisim.designrulecheck.ConnectionEnd) Net(com.bfh.logisim.designrulecheck.Net) ConnectionPoint(com.bfh.logisim.designrulecheck.ConnectionPoint)

Aggregations

ConnectionEnd (com.bfh.logisim.designrulecheck.ConnectionEnd)6 ConnectionPoint (com.bfh.logisim.designrulecheck.ConnectionPoint)6 Net (com.bfh.logisim.designrulecheck.Net)3 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1