⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 genschedulerstats.java

📁 一种将c高级语言转化给VHDL的编译器
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
      blockAveWriteDataPCycle /= blockCycleCount;            for (Iterator iIt = schedule.keySet().iterator();              iIt.hasNext();) {        Integer cycle = (Integer) iIt.next();               int opCntTmp = ((Integer)schedule.get(cycle)).intValue();	blockMaxOpsPCycle = Math.max(blockMaxOpsPCycle, opCntTmp);	blockMinOpsPCycle = Math.min(blockMinOpsPCycle, opCntTmp);             }      //blockMaxOpsPCycle /= blockCycleCount;      //blockMinOpsPCycle /= blockCycleCount;      for (Iterator iIt = rSchedule.keySet().iterator();              iIt.hasNext();) {        Integer cycle = (Integer) iIt.next();               int readCntTmp = ((Integer)rSchedule.get(cycle)).intValue();	blockMaxReadsPCycle = Math.max(blockMaxReadsPCycle, readCntTmp);	blockMinReadsPCycle = Math.min(blockMinReadsPCycle, readCntTmp);             }      if(rSchedule.size()<blockCycleCount) {	blockMinReadsPCycle = 0;      }      if(rSchedule.size()==0) {	blockMaxReadsPCycle = 0;	blockMinReadsPCycle = 0;      }      //blockMaxReadsPCycle /= blockCycleCount;      //blockMinReadsPCycle /= blockCycleCount;      for (Iterator iIt = rDSchedule.keySet().iterator();              iIt.hasNext();) {        Integer cycle = (Integer) iIt.next();               int rDCntTmp = ((Integer)rDSchedule.get(cycle)).intValue();	blockMaxReadDataPCycle = Math.max(blockMaxReadDataPCycle, rDCntTmp);	blockMinReadDataPCycle = Math.min(blockMinReadDataPCycle, rDCntTmp);             }      if(rDSchedule.size()<blockCycleCount) {	blockMinReadDataPCycle = 0;      }      if(rDSchedule.size()==0) {	blockMaxReadDataPCycle = 0;	blockMinReadDataPCycle = 0;      }      //blockMaxReadDataPCycle /= blockCycleCount;      //blockMinReadDataPCycle /= blockCycleCount;      for (Iterator iIt = wSchedule.keySet().iterator();              iIt.hasNext();) {        Integer cycle = (Integer) iIt.next();               int writeCntTmp = ((Integer)wSchedule.get(cycle)).intValue();	blockMaxWritesPCycle = Math.max(blockMaxWritesPCycle, writeCntTmp);	blockMinWritesPCycle = Math.min(blockMinWritesPCycle, writeCntTmp);             }      if(wSchedule.size()<blockCycleCount) {	blockMinWritesPCycle = 0;      }      if(wSchedule.size()==0) {	blockMaxWritesPCycle = 0;	blockMinWritesPCycle = 0;      }      //blockMaxWritesPCycle /= blockCycleCount;      //blockMinWritesPCycle /= blockCycleCount;      for (Iterator iIt = wDSchedule.keySet().iterator();              iIt.hasNext();) {        Integer cycle = (Integer) iIt.next();               int wDCntTmp = ((Integer)wDSchedule.get(cycle)).intValue();	blockMaxWriteDataPCycle = Math.max(blockMaxWriteDataPCycle, wDCntTmp);	blockMinWriteDataPCycle = Math.min(blockMinWriteDataPCycle, wDCntTmp);             }      if(wDSchedule.size()<blockCycleCount) {	blockMinWriteDataPCycle = 0;      }      if(wDSchedule.size()==0) {	blockMaxWriteDataPCycle = 0;	blockMinWriteDataPCycle = 0;      }      //blockMaxWriteDataPCycle /= blockCycleCount;      //blockMinWriteDataPCycle /= blockCycleCount;            blockAveRDPercentPCycle = blockAveReadDataPCycle / totPossReadData;      blockMaxRDPercentPCycle = blockMaxReadDataPCycle / totPossReadData;      blockMinRDPercentPCycle = blockMinReadDataPCycle / totPossReadData;      blockAveWDPercentPCycle = blockAveWriteDataPCycle / totPossReadData;      blockMaxWDPercentPCycle = blockMaxWriteDataPCycle / totPossReadData;      blockMinWDPercentPCycle = blockMinWriteDataPCycle / totPossReadData;            designAveRDPercentPCycle += blockAveRDPercentPCycle;      designAveWDPercentPCycle += blockAveWDPercentPCycle;            designMaxOpsPCycle = Math.max(designMaxOpsPCycle, blockMaxOpsPCycle);      designMinOpsPCycle = Math.min(designMinOpsPCycle, blockMinOpsPCycle);      designMaxReadsPCycle = Math.max(designMaxReadsPCycle, blockMaxReadsPCycle);      designMinReadsPCycle = Math.min(designMinReadsPCycle, blockMinReadsPCycle);      designMaxWritesPCycle = Math.max(designMaxWritesPCycle,                                        blockMaxWritesPCycle);      designMinWritesPCycle = Math.min(designMinWritesPCycle,                                        blockMinWritesPCycle);      designMaxReadDataPCycle = Math.max(designMaxReadDataPCycle,                                          blockMaxReadDataPCycle);      designMinReadDataPCycle = Math.min(designMinReadDataPCycle,                                          blockMinReadDataPCycle);      designMaxWriteDataPCycle = Math.max(designMaxWriteDataPCycle,                                           blockMaxWriteDataPCycle);      designMinWriteDataPCycle = Math.min(designMinWriteDataPCycle,                                           blockMinWriteDataPCycle);      designMaxRDPercentPCycle = Math.max(designMaxRDPercentPCycle,                                           blockMaxRDPercentPCycle);      designMinRDPercentPCycle = Math.min(designMinRDPercentPCycle,                                           blockMinRDPercentPCycle);      designMaxWDPercentPCycle = Math.max(designMaxWDPercentPCycle,                                           blockMaxWDPercentPCycle);      designMinWDPercentPCycle = Math.min(designMinWDPercentPCycle,                                           blockMinWDPercentPCycle);            node.setAveOpsPCycle(blockAveOpsPCycle);      node.setMaxOpsPCycle(blockMaxOpsPCycle);      node.setMinOpsPCycle(blockMinOpsPCycle);      node.setTotOps(blockTotOps);      node.setCycleCount(blockCycleCount);      node.setOperatorCounts(blockOperatorCounts);          System.out.println("Block Stats:");      System.out.println("Block:" + node.getLabel());      //read stats      System.err.println("Average Reads/Cycle:" + blockAveReadsPCycle);      System.err.println("Max Reads/Cycle:" + blockMaxReadsPCycle);      System.err.println("Min Reads/Cycle:" + blockMinReadsPCycle);      System.err.println("Average # bits read/Cycle:" + blockAveReadDataPCycle);      System.err.println("Max # bits read/Cycle:" + blockMaxReadDataPCycle);      System.err.println("Min # bits read/Cycle:" + blockMinReadDataPCycle);      System.err.println("Average % of possible read/Cycle:" + blockAveRDPercentPCycle);      System.err.println("Max % of possible read/Cycle:" + blockMaxRDPercentPCycle);      System.err.println("Min % of possible read/Cycle:" + blockMinRDPercentPCycle);            //write stats      System.err.println("Average Writes/Cycle:" + blockAveWritesPCycle);      System.err.println("Max Writes/Cycle:" + blockMaxWritesPCycle);      System.err.println("Min Writes/Cycle:" + blockMinWritesPCycle);      System.err.println("Average # bits written/Cycle:" + blockAveWriteDataPCycle);      System.err.println("Max # bits written/Cycle:" + blockMaxWriteDataPCycle);      System.err.println("Min # bits written/Cycle:" + blockMinWriteDataPCycle);      System.err.println("Average % of possible write/Cycle:" + blockAveWDPercentPCycle);      System.err.println("Max % of possible write/Cycle:" + blockMaxWDPercentPCycle);      System.err.println("Min % of possible write/Cycle:" + blockMinWDPercentPCycle);      System.err.println("============================================");         }    cyclesPerBlock = ((float)designCycleCount) /                     ((float)graph.getAllNodes().size());    designAveOpsPCycle = ((float)designTotOps) / ((float)designCycleCount);    designAveReadsPCycle = ((float)designAveReadsPCycle) /                            ((float)designCycleCount);    designAveWritesPCycle = ((float)designAveWritesPCycle) /                             ((float)designCycleCount);    designAveReadDataPCycle = ((float)designAveReadDataPCycle) /                               ((float)designCycleCount);    designAveWriteDataPCycle = ((float)designAveWriteDataPCycle) /                                ((float)designCycleCount);    designAveRDPercentPCycle = ((float)designAveRDPercentPCycle) /                                ((float)designCycleCount);    designAveWDPercentPCycle = ((float)designAveWDPercentPCycle) /                                ((float)designCycleCount);    			       opsPerBlock = ((float)designTotOps) / ((float)graph.getAllNodes().size());        graph.setAveOpsPCycle(designAveOpsPCycle);    graph.setMaxOpsPCycle(designMaxOpsPCycle);    graph.setMinOpsPCycle(designMinOpsPCycle);    graph.setCyclesPerBlock(cyclesPerBlock);    graph.setOpsPerBlock(opsPerBlock);    graph.setTotOps(designTotOps);    graph.setCycleCount(designCycleCount);    graph.setOperatorCounts(designOperatorCounts);        System.out.println("Block Stats:");    for (Iterator vIt = graph.getAllNodes().iterator();              vIt.hasNext();) {      BlockNode node = (BlockNode) vIt.next();      System.out.println("Block:" + node.getLabel());            System.out.println("Average Ops/Cycle:" + node.getAveOpsPCycle());      System.out.println("Max Ops/Cycle:" + node.getMaxOpsPCycle());      System.out.println("Min Ops/Cycle:" + node.getMinOpsPCycle());      System.out.println("Total Ops:" + node.getTotOps());      System.out.println("Cycle Count:" + node.getCycleCount());      HashMap opCnts = node.getOperatorCounts();      for (Iterator oIt = opCnts.keySet().iterator();              oIt.hasNext();) {        String operator = (String) oIt.next();        	int opCnt = ((Integer)opCnts.get(operator)).intValue();	System.out.println("operator " + operator + " Count:" + opCnt);	      }      System.out.println("============================================");        }    System.err.println("Design Stats:");          System.out.println("Average Ops/Cycle:" + graph.getAveOpsPCycle());    System.out.println("Max Ops/Cycle:" + graph.getMaxOpsPCycle());    System.out.println("Min Ops/Cycle:" + graph.getMinOpsPCycle());    System.out.println("Ops/Block:" + graph.getOpsPerBlock());    System.out.println("Cycle/Block:" + graph.getCyclesPerBlock());    System.out.println("Total Ops:" + graph.getTotOps());    System.out.println("Cycle Count:" + graph.getCycleCount());    System.out.println("block Count:" + graph.getAllNodes().size());    HashMap opCnts = graph.getOperatorCounts();    for (Iterator oIt = opCnts.keySet().iterator();     	   oIt.hasNext();) {      String operator = (String) oIt.next();            int opCnt = ((Integer)opCnts.get(operator)).intValue();      System.out.println("operator " + operator + " Usage Count:" + opCnt);    }    HashMap opCnts2 = GlobalOptions.chipDef.getOpCntsAvailable();    for (Iterator oIt = opCnts2.keySet().iterator();     	   oIt.hasNext();) {      Operator operator = (Operator) oIt.next();            String opName= new String();      for(int i = 0; i<operatorTypes.length-1;i++)      {	if(operator.toString().indexOf(operatorTypes[i]) >= 0)        {          String type = "";          if(operator.getInputClass() == Operator.FP)            type = "fp_";          if(operator.getInputClass() == Operator.INT)            type = "int_";	  opName = type + operatorTypes[i];        }      }      int opCnt = ((Integer)opCnts2.get(operator)).intValue();      System.out.println("operator " + opName + " Count:" + opCnt);    }    //read stats    System.err.println("Average Reads/Cycle:" + designAveReadsPCycle);    System.err.println("Max Reads/Cycle:" + designMaxReadsPCycle);    System.err.println("Min Reads/Cycle:" + designMinReadsPCycle);    System.err.println("Average # bits read/Cycle:" + designAveReadDataPCycle);    System.err.println("Max # bits read/Cycle:" + designMaxReadDataPCycle);    System.err.println("Min # bits read/Cycle:" + designMinReadDataPCycle);    System.err.println("Average % of possible read/Cycle:" + designAveRDPercentPCycle);    System.err.println("Max % of possible read/Cycle:" + designMaxRDPercentPCycle);    System.err.println("Min % of possible read/Cycle:" + designMinRDPercentPCycle);        //write stats    System.err.println("Average Writes/Cycle:" + designAveWritesPCycle);    System.err.println("Max Writes/Cycle:" + designMaxWritesPCycle);    System.err.println("Min Writes/Cycle:" + designMinWritesPCycle);    System.err.println("Average # bits written/Cycle:" + designAveWriteDataPCycle);    System.err.println("Max # bits written/Cycle:" + designMaxWriteDataPCycle);    System.err.println("Min # bits written/Cycle:" + designMinWriteDataPCycle);    System.err.println("Average % of possible write/Cycle:" + designAveWDPercentPCycle);    System.err.println("Max % of possible write/Cycle:" + designMaxWDPercentPCycle);    System.err.println("Min % of possible write/Cycle:" + designMinWDPercentPCycle);    System.out.println("============================================");                     return true;  }           public String name() {     return "GenSchedulerStats";  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -