Dedup WAUSED features. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
diff --git a/dump_features.java b/dump_features.java index e25e78c..260a3b2 100644 --- a/dump_features.java +++ b/dump_features.java
@@ -148,6 +148,7 @@ boolean[] haveff = {false, false}; boolean[] srused = {false, false, false, false}; boolean[] ceused = {false, false, false, false}; + boolean[] waused = {false, false, false}; for (BEL b : si.getBELs()) { String belName = b.getName(); @@ -171,8 +172,9 @@ tfeat.add(belName.replaceAll("[56]", "") + ".SRL.LARGE"); for (int i = 6; i <= 8; i++) { - if (c.getPhysicalPinMapping("WADR" + i) != null) - tfeat.add("WA" + (i+1) + "USED"); + if (c.getPhysicalPinMapping("WADR" + i) != null) { + waused[i-6] = true; + } } if (c.getType().contains("SRLC32") && c.getEDIFCellInst() != null) { EDIFPortInst epi = c.getEDIFCellInst().getPortInst("D"); @@ -229,7 +231,6 @@ tfeat.add(belName.replaceAll("[56]", "") + ".INIT[" + i + "]"); } } - } else if (belName.contains("FF")) { boolean is_latch = false, is_sync = false, srval = false; String clkpin, srpin, cepin; @@ -360,6 +361,15 @@ } tfeat.add(sp.getBELName() + "." + sp.getInputPinName()); } + if (si.getSiteTypeEnum() == SiteTypeEnum.SLICEM) { + for (int i = 0; i < 3; i++) { + if(waused[i]) { + tfeat.add("WA" + (i+7) + "USED.1"); + } else { + tfeat.add("WA" + (i+7) + "USED.0"); + } + } + } } else if (si.getSiteTypeEnum() == SiteTypeEnum.BUFCE_LEAF) { String name = site_index_in_tile(si.getTile(), si.getSite()); for (Cell c : si.getCells()) {