Search in sources :

Example 1 with IOComponentTypes

use of com.bfh.logisim.fpgaboardeditor.FPGAIOInformationContainer.IOComponentTypes in project logisim-evolution by reds-heig.

the class BoardInformation method GetComponents.

@SuppressWarnings("unchecked")
public Map<String, ArrayList<Integer>> GetComponents() {
    Map<String, ArrayList<Integer>> result = new HashMap<>();
    ArrayList<Integer> list = new ArrayList<>();
    int count = 0;
    for (IOComponentTypes type : IOComponentTypes.KnownComponentSet) {
        count = 0;
        for (FPGAIOInformationContainer comp : MyComponents) {
            if (comp.GetType().equals(type)) {
                list.add(count, comp.getNrOfPins());
                count++;
            }
        }
        if (count > 0) {
            result.put(type.toString(), (ArrayList<Integer>) list.clone());
        }
        list.clear();
    }
    return result;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) IOComponentTypes(com.bfh.logisim.fpgaboardeditor.FPGAIOInformationContainer.IOComponentTypes)

Example 2 with IOComponentTypes

use of com.bfh.logisim.fpgaboardeditor.FPGAIOInformationContainer.IOComponentTypes in project logisim-evolution by reds-heig.

the class MappableResourcesContainer method GetSelectableItemsList.

public ArrayList<BoardRectangle> GetSelectableItemsList(String DisplayName, BoardInformation BoardInfo) {
    ArrayList<BoardRectangle> List;
    ArrayList<String> key = GetHierarchyKey(DisplayName);
    NetlistComponent comp = myMappableResources.get(key);
    int pinNeeded = comp.GetIOInformationContainer().GetNrOfInOutports() + comp.GetIOInformationContainer().GetNrOfInports() + comp.GetIOInformationContainer().GetNrOfOutports();
    /* first check main map type */
    if (!comp.AlternateMappingEnabled(key)) {
        List = BoardInfo.GetIoComponentsOfType(comp.GetIOInformationContainer().GetMainMapType(), pinNeeded);
        if (!List.isEmpty()) {
            return RemoveUsedItems(List, 0);
        }
    }
    List = new ArrayList<BoardRectangle>();
    int MapId = 0;
    IOComponentTypes MapType;
    do {
        MapType = comp.GetIOInformationContainer().GetAlternateMapType(MapId);
        List.addAll(BoardInfo.GetIoComponentsOfType(MapType, 0));
        MapId++;
    } while (MapType != IOComponentTypes.Unknown);
    return RemoveUsedItems(List, pinNeeded);
}
Also used : BoardRectangle(com.bfh.logisim.fpgaboardeditor.BoardRectangle) NetlistComponent(com.bfh.logisim.designrulecheck.NetlistComponent) IOComponentTypes(com.bfh.logisim.fpgaboardeditor.FPGAIOInformationContainer.IOComponentTypes)

Aggregations

IOComponentTypes (com.bfh.logisim.fpgaboardeditor.FPGAIOInformationContainer.IOComponentTypes)2 NetlistComponent (com.bfh.logisim.designrulecheck.NetlistComponent)1 BoardRectangle (com.bfh.logisim.fpgaboardeditor.BoardRectangle)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1