Пример #1
0
  /**
   * Method to examine an output entry and prints out the condition that it represents. It is
   * possible for an output entry operand to represent a logic value, integer value, or another node
   * address.
   *
   * <p>Calling Arguments: rowHead = pointer to the row being printed
   */
  private void printOutEntry(ALS.Row rowHead) {
    boolean flag = false;
    StringBuffer infstr = new StringBuffer();
    infstr.append("  Output: ");

    for (Object obj : rowHead.outList) {
      ALS.IO ioHead = (ALS.IO) obj;
      if (flag) infstr.append("& ");
      flag = true;

      ALS.Stat statHead = (ALS.Stat) ioHead.nodePtr;
      ALS.Node nodeHead = statHead.nodePtr;
      infstr.append("N" + nodeHead.getIndex());

      if (ioHead.operatr > 127) {
        int operatr = ioHead.operatr - 128;
        nodeHead = (ALS.Node) ioHead.operand;
        infstr.append(
            operatr + "N" + nodeHead.getIndex() + "@" + ((ioHead.strength + 1) / 2) + " ");
        continue;
      }

      infstr.append(ioHead.operatr);

      Integer num = (Integer) ioHead.operand;
      String s2 = Stimuli.describeLevel(num.intValue());
      infstr.append(s2 + "@" + ((ioHead.strength + 1) / 2) + " ");
    }
    System.out.println(infstr.toString());
  }
Пример #2
0
  /**
   * Method to call a series of routines which convert the hierarchical network description into a
   * flattened database representation. The actual simulation must take place on the flattened
   * network. Returns true on error.
   */
  boolean flattenNetwork(Cell cell) {
    /*
     * create a "dummy" level to use as a mixed signal destination for plotting and
     * screen display.  This level should be bypassed for structure checking and general
     * simulation, however, so in the following code, references to "als.cellRoot"
     * have been changed to als.cellRoot.next (pointing to mainCell).
     * Peter Gallant July 16, 1990
     */
    als.cellRoot = new ALS.Connect();
    als.cellRoot.instName = "[MIXED_SIGNAL_LEVEL]";
    als.cellRoot.modelName = als.cellRoot.instName;
    als.cellRoot.exList = new ArrayList<ALS.ALSExport>();
    als.cellRoot.parent = null;
    als.cellRoot.child = null;
    als.cellRoot.next = null;
    ALS.Connect tempRoot = als.cellRoot;

    // get upper-case version of main proto
    String mainName = cell.getName().toUpperCase();

    als.cellRoot = new ALS.Connect();
    als.cellRoot.instName = mainName;
    als.cellRoot.modelName = als.cellRoot.instName;
    als.cellRoot.exList = new ArrayList<ALS.ALSExport>();
    als.cellRoot.parent = null;
    als.cellRoot.child = null;
    als.cellRoot.next = null;

    // these lines link the mixed level as the head followed by mainCell PJG
    tempRoot.next = als.cellRoot; // shouldn't this be null? ... smr
    tempRoot.child = als.cellRoot;
    als.cellRoot = tempRoot;

    // this code checks to see if model mainCell is present in the netlist PJG
    ALS.Model modHead = findModel(mainName);
    if (modHead == null) return true;
    for (ALS.ALSExport exHead : modHead.exList) {
      findXRefEntry(als.cellRoot.next, (String) exHead.nodeName);
    }

    if (flattenModel(als.cellRoot.next)) return true;

    for (ALS.Node nodeHead : als.nodeList) {
      if (nodeHead.load < 1) nodeHead.load = 1;
    }
    return false;
  }
Пример #3
0
 /**
  * Method to make an entry into the primitive input table for the specified node. This table keeps
  * track of the primitives which use this node as an input for event driven simulation. Returns
  * true on error.
  *
  * <p>Calling Arguments: modHead = pointer to the model structure from which the primitive is
  * being created nodeName = pointer to a char string containing the name of the node whose input
  * list is being updated nodeHead = pointer to the node data structure allocated for this node
  */
 private void createPinEntry(ALS.Model modHead, String nodeName, ALS.Node nodeHead) {
   for (ALS.Load pinPtr1 : nodeHead.pinList) {
     if (pinPtr1.ptr == primPtr2) return;
   }
   ALS.Load pinPtr2 = new ALS.Load();
   pinPtr2.ptr = primPtr2;
   nodeHead.pinList.add(pinPtr2);
   nodeHead.load += findLoadValue(modHead, nodeName);
 }
Пример #4
0
 /**
  * Method to make an entry into the database for an output which is connected to the specified
  * node. Statistics are maintained for each output that is connected to a node. Returns zero on
  * error.
  *
  * <p>Calling Arguments: modHead = pointer to the model structure from which the primitive is
  * being created nodeName = pointer to a char string containing the name of the node whose output
  * list is being updated nodeHead = pointer to the node data structure allocated for this node
  */
 private ALS.Stat createStatEntry(ALS.Model modHead, String nodeName, ALS.Node nodeHead) {
   for (Stat statPtr1 : nodeHead.statList) {
     if (statPtr1.primPtr == primPtr2) return statPtr1;
   }
   ALS.Stat statPtr2 = new ALS.Stat();
   statPtr2.primPtr = primPtr2;
   statPtr2.nodePtr = nodeHead;
   nodeHead.statList.add(statPtr2);
   nodeHead.load += findLoadValue(modHead, nodeName);
   return statPtr2;
 }
Пример #5
0
  /**
   * Method to return the flattened database node number for the specified model and node name.
   *
   * <p>Calling Arguments: cellHead = pointer to the xref table for the model being processed name =
   * pointer to a char string containing the node name
   */
  private ALS.ALSExport findXRefEntry(ALS.Connect cellHead, String name) {
    for (ALS.ALSExport xRefPtr1 : cellHead.exList) {
      if (xRefPtr1.nodeName.equals(name)) return xRefPtr1;
    }
    ALS.ALSExport xRefPtr2 = new ALS.ALSExport();
    xRefPtr2.nodeName = name;
    cellHead.exList.add(xRefPtr2);

    ALS.Node nodePtr2 = new ALS.Node();
    nodePtr2.cellPtr = cellHead;
    nodePtr2.statList = new ArrayList<Stat>();
    nodePtr2.pinList = new ArrayList<ALS.Load>();
    nodePtr2.load = -1;
    nodePtr2.visit = 0;
    nodePtr2.traceNode = false;
    als.nodeList.add(nodePtr2);
    xRefPtr2.nodePtr = nodePtr2;
    return xRefPtr2;
  }
Пример #6
0
  /** Method to print out the display screen status and information */
  void printCommand(String[] par) {
    if (par.length < 1) {
      System.out.println("telltool simulation als print OPTION");
      return;
    }

    if (par[0].equals("vector")) {
      ALS.Link linkHead = als.setRoot;
      System.out.println("** VECTOR LINKLIST **");
      while (linkHead != null) {
        switch (linkHead.type) {
          case 'N':
            ALS.Node nodeHead = (ALS.Node) linkHead.ptr;
            String s1 = Stimuli.describeLevel(((Integer) linkHead.state).intValue());
            System.out.println(
                "***** vector: $N"
                    + nodeHead.getIndex()
                    + ", state = "
                    + s1
                    + ", strength = "
                    + Stimuli.describeStrength(linkHead.strength)
                    + ", time = "
                    + linkHead.time
                    + ", priority = "
                    + linkHead.priority);
            break;
          case 'F':
            ALS.Stat statHead = (ALS.Stat) linkHead.ptr;
            nodeHead = statHead.nodePtr;
            s1 = Stimuli.describeLevel(((Integer) linkHead.state).intValue());
            System.out.println(
                "***** function: $N"
                    + nodeHead.getIndex()
                    + ", state = "
                    + s1
                    + ", strength = "
                    + Stimuli.describeStrength(linkHead.strength)
                    + ", time = "
                    + linkHead.time
                    + ", priority = "
                    + linkHead.priority);
            break;
          case 'R':
            System.out.println(
                "***** rowptr = "
                    + linkHead.ptr
                    + ", time = "
                    + linkHead.time
                    + ", priority = "
                    + linkHead.priority);
            break;
          case 'C':
            System.out.println(
                "***** clokptr = "
                    + linkHead.ptr
                    + ", time = "
                    + linkHead.time
                    + ", priority = "
                    + linkHead.priority);
        }
        linkHead = linkHead.right;
      }
      return;
    }

    if (par[0].equals("netlist")) {
      System.out.println("** NETWORK DESCRIPTION **");
      for (Model primHead : als.primList) {
        switch (primHead.type) {
          case 'F':
            StringBuffer infstr = new StringBuffer();
            infstr.append(
                "FUNCTION: "
                    + primHead.name
                    + " (instance "
                    + (primHead.level == null ? "null" : primHead.level)
                    + ") [");
            boolean first = true;
            for (ALS.ALSExport exHead : primHead.exList) {
              if (first) first = false;
              else infstr.append(", ");
              infstr.append("N" + exHead.nodePtr.getIndex());
            }
            infstr.append("]");
            System.out.println(infstr.toString());
            infstr = new StringBuffer();
            infstr.append("  Event Driving Inputs:");
            ALS.Func funcHead = (ALS.Func) primHead.ptr;
            for (ALS.ALSExport exHead : funcHead.inList) {
              infstr.append(" N" + exHead.nodePtr.getIndex());
            }
            System.out.println(infstr.toString());
            infstr = new StringBuffer();
            infstr.append("  Output Ports:");
            for (ALS.ALSExport exHead : primHead.exList) {
              if (exHead.nodeName != null)
                infstr.append(" N" + ((ALS.Stat) exHead.nodeName).nodePtr.getIndex());
            }
            System.out.println(infstr.toString());
            System.out.println(
                "  Timing: D="
                    + funcHead.delta
                    + ", L="
                    + funcHead.linear
                    + ", E="
                    + funcHead.exp
                    + ", R="
                    + funcHead.random
                    + ", A="
                    + funcHead.abs);
            System.out.println("  Firing Priority = " + primHead.priority);
            break;
          case 'G':
            System.out.println(
                "GATE: "
                    + primHead.name
                    + " (instance "
                    + (primHead.level == null ? "null" : primHead.level)
                    + ")");
            for (ALS.Row rowHead = (ALS.Row) primHead.ptr;
                rowHead != null;
                rowHead = rowHead.next) {
              System.out.println(
                  "  Timing: D="
                      + rowHead.delta
                      + ", L="
                      + rowHead.linear
                      + ", E="
                      + rowHead.exp
                      + ", R="
                      + rowHead.random
                      + ", A="
                      + rowHead.abs);
              System.out.println(
                  "  Delay type: " + (rowHead.delay == null ? "null" : rowHead.delay));
              printInEntry(rowHead);
              printOutEntry(rowHead);
            }
            System.out.println("  Firing Priority = " + primHead.priority);
            break;
          default:
            System.out.println("Illegal primitive type '" + primHead.type + "', database is bad");
            break;
        }
      }
      return;
    }
    System.out.println("telltool simulation als print");
  }