public class TileColumnPattern extends ArrayList<TileTypeEnum> implements Comparable<TileColumnPattern>
Modifier and Type | Field and Description |
---|---|
static int |
MAX_PATTERN_LENGTH |
static int |
NULL_COLUMN_BREAK_SIZE
The number of consecutive NULL columns for a pattern not to cross
|
Constructor and Description |
---|
TileColumnPattern() |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(TileColumnPattern o) |
static TileColumnPattern |
createTileColumnPattern(List<TileTypeEnum> types) |
static TileColumnPattern |
createTileColumnPattern(List<TileTypeEnum> filteredTypes,
int start,
int end)
Creates a TileColumnPattern from an existing list of tile types and uses the start and end
as indicies to get a sublist of filteredTypes.
|
static HashMap<TileColumnPattern,TreeSet<Integer>> |
genColumnPatternMap(Device dev)
Creates a map where the keys are all tile column patterns for the given device and
the values are sets of occurrences/instances of those tile column patterns (represented
by the the column index of the start of the pattern).
|
static HashMap<TileColumnPattern,TreeSet<Integer>> |
genColumnPatternMap(Device dev,
boolean wantLaguna)
Creates a map where the keys are all tile column patterns for the given device and
the values are sets of occurrences/instances of those tile column patterns (represented
by the the column index of the start of the pattern).
|
static int |
getCommonRow(Device dev)
Finds the first row that has populated BRAM, DSP, URAM, and CLB tiles but no Laguna tiles to help identify
tile column types.
|
static int |
getCommonRow(Device dev,
boolean wantLaguna)
Finds the first row that has populated BRAM, DSP, URAM, and CLB tiles to help identify
tile column types.
|
int |
getNumInstances() |
static TileColumnPattern[] |
getSortedMostCommonPatterns(HashMap<TileColumnPattern,TreeSet<Integer>> map)
Gets an array of all tile column pattersn sorted by those with the most number of instances.
|
static char |
getTileCharacter(TileTypeEnum type,
FamilyType arch)
Helper function to help visualize tile column patterns by assigning an ASCII charcter
to certain tile types.
|
String |
getTilePatternString(FamilyType arch)
Gets the short-hand ASCII tile column pattern.
|
boolean |
hasBRAM() |
boolean |
hasDSP() |
boolean |
hasSLICEL() |
boolean |
hasSLICEM() |
boolean |
hasURAM() |
static void |
main(String[] args) |
void |
setNumInstances(int numInstances) |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
public static int MAX_PATTERN_LENGTH
public static final int NULL_COLUMN_BREAK_SIZE
public static TileColumnPattern createTileColumnPattern(List<TileTypeEnum> types)
public static TileColumnPattern createTileColumnPattern(List<TileTypeEnum> filteredTypes, int start, int end)
filteredTypes
- The list of tile types to turn into a patternstart
- The start index to use to build a subList of filteredTypesend
- The end index to use to build a subList of filteredTypespublic boolean hasSLICEL()
public boolean hasSLICEM()
public boolean hasBRAM()
public boolean hasDSP()
public boolean hasURAM()
public int getNumInstances()
public void setNumInstances(int numInstances)
numInstances
- the numInstances to setpublic static int getCommonRow(Device dev, boolean wantLaguna)
dev
- The device of interestwantLaguna
- true if we are interested in a row with laguna tiles, false if interested in one withoutpublic static int getCommonRow(Device dev)
dev
- The device of interestpublic static HashMap<TileColumnPattern,TreeSet<Integer>> genColumnPatternMap(Device dev, boolean wantLaguna)
dev
- The device of interestwantLaguna
- true if we are interested in a row with laguna tiles, false if interested in one withoutpublic static HashMap<TileColumnPattern,TreeSet<Integer>> genColumnPatternMap(Device dev)
dev
- The device of interestpublic static TileColumnPattern[] getSortedMostCommonPatterns(HashMap<TileColumnPattern,TreeSet<Integer>> map)
map
- A tile column pattern map such as one generated in genColumnPatternMap().public static char getTileCharacter(TileTypeEnum type, FamilyType arch)
type
- The tile type of interest.arch
- The device familypublic String getTilePatternString(FamilyType arch)
arch
- Family of the device of interest.public static void main(String[] args)
public int compareTo(TileColumnPattern o)
compareTo
in interface Comparable<TileColumnPattern>