Esempio n. 1
0
 private OutputPin connectOutputPin(Design design, Call call, Bus bus, String name) {
   OutputPin pin = new OutputPin(bus);
   pin.setIDSourceInfo(call.getIDSourceInfo().deriveField(name, -1, -1));
   pin.getPort().setBus(bus);
   design.addOutputPin(pin, bus);
   return pin;
 }
Esempio n. 2
0
    Output(OutputPin opin, int nodeCount, int fontSize) {
      super(ID.showLogical(opin), nodeCount, fontSize);
      _graph.ln("Output Pin: " + opin);
      graph(opin, nodeCount++);
      Port p = opin.getPort();
      Bus b = p.getBus();
      graph(b.getOwner().getOwner(), nodeCount++);

      graphEdges(opin);
    }
Esempio n. 3
0
  /**
   * Creates Pins on the design to connect each task's I/O.
   *
   * @param design the Design to be connected
   */
  @SuppressWarnings("deprecation")
  private void connectTasks(Design design) {
    // Map kickers = new HashMap();

    for (Task task : design.getTasks()) {
      Call call = task.getCall();

      // Note: when creating the InputPins, they are based on the related
      // procedure port instead of the call port, because the InputPin
      // needs
      // the Port's peer bus to get sizing information

      // might have a this port
      if (task.getCall().getThisPort() != null) {
        int width = task.getCall().getThisPort().getValue().getSize();

        /*
         * The base address of the top level object reference is always
         * 0, since it isn't actually stored in memory.
         */
        Constant constant = new SimpleConstant(0, width, false);
        task.setHiddenConstant(constant);
      }

      // If module_builder, then publish the ports, and don't use a kicker
      if (EngineThread.getGenericJob()
          .getUnscopedBooleanOptionValue(OptionRegistry.MODULE_BUILDER)) {
        // get the entry method
        EntryMethod em = call.getProcedure().getEntryMethod();

        Port go = call.getGoPort();
        if (go.isUsed()) {
          Pin p = connectInputPin(design, call, go, call.getGoName());
          if (em != null) {
            p.setApiPin(em.getGoPin());
          }
        }

        List<Port> dataPorts = new ArrayList<Port>(call.getDataPorts());

        // 'this' port is handled specially.
        dataPorts.remove(call.getThisPort());
        int index = 0;
        for (Port port : dataPorts) {
          if (port.getTag().equals(Component.NORMAL)) {
            if (port.isUsed()) {
              Pin p = connectInputPin(design, call, port, null);
              if (em != null) {
                p.setApiPin(em.getArgPin(index));
              }
            }
          }

          index++;
        }

        Exit exit = call.getExit(Exit.DONE);
        Bus done = exit.getDoneBus();
        if (done.isUsed()) {
          OutputPin pin = connectOutputPin(design, call, done, call.getProcedure().getDoneName());
          if (em != null) {
            pin.setApiPin(em.getDonePin());
          }
        }

        for (Bus bus : exit.getDataBuses()) {
          if (bus.getTag().equals(Component.NORMAL)) {
            if (bus.isUsed()) {
              OutputPin pin =
                  connectOutputPin(design, call, bus, call.getProcedure().getResultName());
              if (em != null) {
                pin.setApiPin(em.getResultPin());
              }
            }
          }
        }
      }
    }
  }