コード例 #1
0
 private ArrayList<String> GetXilinxUCFStrings(String direction, int StartId) {
   ArrayList<String> Contents = new ArrayList<String>();
   StringBuffer Temp = new StringBuffer();
   Integer start = 0;
   Integer end = NrOfPins;
   ArrayList<String> labels = null;
   if (MyType.equals(IOComponentTypes.PortIO)) {
     labels = PortIO.GetLabels(IOComponentTypes.GetNrOfFPGAPins(MyType));
   } else if (MyType.equals(IOComponentTypes.LocalBus)) {
     labels = ReptarLocalBus.GetLabels();
     if (direction.equals("in")) {
       end = IOComponentTypes.GetFPGAInputRequirement(MyType);
     } else if (direction.equals("out")) {
       // TODO: YSY
       Contents.add(
           "NET \"FPGA_LB_OUT_0\" LOC = \"R24\" | IOSTANDARD = LVCMOS18 ; # SP6_LB_WAIT3_o");
       Contents.add("NET \"FPGA_LB_OUT_1\" LOC = \"AB30\" | IOSTANDARD = LVCMOS18 ; # IRQ_o");
       return Contents;
       // start = IOComponentTypes.GetFPGAInputRequirement(MyType);
       // end = start +
       // IOComponentTypes.GetFPGAOutputRequirement(MyType);
     } else if (direction.equals("inout")) {
       start =
           IOComponentTypes.GetFPGAInputRequirement(MyType)
               + IOComponentTypes.GetFPGAOutputRequirement(MyType);
       end = start + IOComponentTypes.GetFPGAInOutRequirement(MyType);
     }
   } else if (MyType.equals(IOComponentTypes.DIPSwitch)) {
     labels = DipSwitch.GetLabels(IOComponentTypes.GetNrOfFPGAPins(MyType));
   } else if (MyType.equals(IOComponentTypes.SevenSegment)) {
     labels = SevenSegment.GetLabels();
   } else if (MyType.equals(IOComponentTypes.RGBLED)) {
     labels = RGBLed.GetLabels();
   }
   for (int i = start; i < end; i++) {
     Temp.setLength(0);
     Temp.append("LOC = \"" + MyPinLocations.get(i) + "\" ");
     if (MyPullBehavior != PullBehaviors.Unknown && MyPullBehavior != PullBehaviors.Float) {
       Temp.append("| " + PullBehaviors.getContraintedPullString(MyPullBehavior) + " ");
     }
     if (MyDriveStrength != DriveStrength.Unknown
         && MyDriveStrength != DriveStrength.DefaulStength) {
       Temp.append(
           "| DRIVE = " + DriveStrength.GetContraintedDriveStrength(MyDriveStrength) + " ");
     }
     if (MyIOStandard != IoStandards.Unknown && MyIOStandard != IoStandards.DefaulStandard) {
       Temp.append("| IOSTANDARD = " + IoStandards.GetConstraintedIoStandard(MyIOStandard) + " ");
     }
     Temp.append(";");
     if (labels != null) {
       Temp.append(" # " + labels.get(i));
     }
     String NetName = "";
     if (direction == "in") {
       NetName =
           HDLGeneratorFactory.FPGAInputPinName + "_" + Integer.toString(StartId + i - start);
     } else if (direction == "inout") {
       NetName =
           HDLGeneratorFactory.FPGAInOutPinName + "_" + Integer.toString(StartId + i - start);
     } else {
       NetName =
           HDLGeneratorFactory.FPGAOutputPinName + "_" + Integer.toString(StartId + i - start);
     }
     // String NetName = (InputPins) ?
     // HDLGeneratorFactory.FPGAInputPinName + "_" +
     // Integer.toString(StartId + i)
     // : HDLGeneratorFactory.FPGAOutputPinName + "_" +
     // Integer.toString(StartId + i);
     Contents.add("NET \"" + NetName + "\" " + Temp.toString());
   }
   return Contents;
 }