Examples of ModuleInstance


Examples of edu.byu.ece.rapidSmith.design.ModuleInstance

          Attribute attribute = createAttribute(token);
          if(currInstance != null) currInstance.addAttribute(attribute);
          else if(currNet != null){
            currNet.addAttribute(attribute);
            if(attribute.getPhysicalName().equals("_MACRO")){
                ModuleInstance mi = design.getModuleInstance(attribute.getValue());
                currNet.setModuleInstance(mi);
                mi.addNet(currNet);
                Module module = mi.getModule();
                currNet.setModuleTemplate(module);
                currNet.setModuleTemplateNet(module.getNet(currNet.getName().replaceFirst(mi.getName() + "/", "")));
              }
          }
          else if(currModule != null) currModule.addAttribute(attribute);
          else design.addAttribute(attribute);
        }
        break;
      case XDL_STATEMENT:
        if(token.equals(INST)|| token.equals(INSTANCE)){
          currInstance = new Instance();
          state = ParserState.INSTANCE_NAME;
        }
        else if(token.equals(NET)){
          currNet = new Net();
          state = ParserState.NET_NAME;
        }
        else if(token.equals(MODULE)){
          currModule = new Module();
          modPinMap = new HashMap<String, Pin>();
          portNames = new ArrayList<String>();
          portInstanceNames = new ArrayList<String>();
          portPinNames = new ArrayList<String>();
          state = ParserState.MODULE_NAME;
        }
        else if(token.equals(ENDMODULE)){
          state = ParserState.END_MODULE_NAME;
        }
        else{
          expect("inst, net, module or endmodule", token, ParserState.XDL_STATEMENT);
        }
        break;
      case INSTANCE_NAME:
        currInstance.setName(pool.getUnique(token));
        currInstance.setDesign(design);
        if(currModule == null){
          design.addInstance(currInstance);
        }
        else{
          currModule.addInstance(currInstance);
          currInstance.setModuleTemplate(currModule);
          if(currInstance.getName().equals(currModuleAnchorName)){
            currModule.setAnchor(currInstance);
          }
        }
        state = ParserState.INSTANCE_TYPE;
        break;
      case INSTANCE_TYPE:
          PrimitiveType t = Utils.createPrimitiveType(token);
          if(t == null){
            MessageGenerator.briefErrorAndExit("XDL Design Parser Error in file: "+ fileName +", Failed parsing Instance type: \"" + token + "\"");
          }
          currInstance.setType(t);
          state = ParserState.INSTANCE_PLACED;
        break;
      case INSTANCE_PLACED:
        if(token.equals(PLACED)) state = ParserState.INSTANCE_TILE;
        else if(token.equals(UNPLACED)) state = ParserState.INSTANCE_BONDED;
        else expect("placed or unplaced", token, ParserState.INSTANCE_PLACED);
        break;
      case INSTANCE_TILE:
        Tile tile = dev.getTile(token);
        if(tile == null){
          MessageGenerator.briefErrorAndExit("XDL Design Parser Error in file: "+ fileName +", Invalid tile " +
              token + " on line " + lineNumber);
        }
        state = ParserState.INSTANCE_SITE;
        break;
      case INSTANCE_SITE:
        PrimitiveSite site = dev.getPrimitiveSite(token);
        if(site == null){
          MessageGenerator.briefErrorAndExit("XDL Design Parser Error in file: "+ fileName +", Invalid primitive site " +
              token + " on line " + lineNumber);
        }
        if(currModule != null){
          currInstance.setSite(dev.getPrimitiveSite(token));
        }else{
          currInstance.place(dev.getPrimitiveSite(token));         
        }
        state = ParserState.MODULE_INSTANCE_TOKEN;
        break;
      case INSTANCE_BONDED:
        if(token.equals(COMMA)){
          state = ParserState.MODULE_INSTANCE_TOKEN;
        }
        else if(token.equals(CFG)){
          state = ParserState.ATTRIBUTE;
        }
        else if(token.equals(MODULE)){
          state = ParserState.MODULE_INSTANCE_NAME;
        }
        else if(token.equals(BONDED)){
          currInstance.setBonded(true);
          state = ParserState.MODULE_INSTANCE_TOKEN;
        }
        else if(token.equals(UNBONDED)){
          currInstance.setBonded(false);
          state = ParserState.MODULE_INSTANCE_TOKEN;
        }
        else{
          expect("bonded, unbonded or ,", token, ParserState.INSTANCE_BONDED);
        }
        break;
      case MODULE_INSTANCE_TOKEN:
        if(token.equals(CFG)) state = ParserState.ATTRIBUTE;
        else if(token.equals(MODULE)) state = ParserState.MODULE_INSTANCE_NAME;
        else expect("cfg or module", token, ParserState.MODULE_INSTANCE_TOKEN);
        break;
      case MODULE_INSTANCE_NAME:
        currModuleInstanceName = pool.getUnique(token);
        state = ParserState.MODULE_TEMPLATE_NAME;
        break;
      case MODULE_TEMPLATE_NAME:
        currInstance.setModuleTemplate(design.getModule(token));
        state = ParserState.MODULE_TEMPLATE_INSTANCE_NAME;
        break;
      case MODULE_TEMPLATE_INSTANCE_NAME:
        currInstance.setModuleTemplateInstance(currInstance.getModuleTemplate().getInstance(token));
        ModuleInstance moduleInstance = design.addInstanceToModuleInstances(currInstance, currModuleInstanceName);
        if(currInstance.getModuleTemplateInstance().equals(currInstance.getModuleTemplate().getAnchor())){
          moduleInstance.setAnchor(currInstance);
        }
        state = ParserState.CFG_STRING;
        break;
      case NET_NAME:
        currNet.setName(pool.getUnique(token));
View Full Code Here

Examples of net.sf.pipet.api.ModuleInterface.ModuleInstance

    SimulationModuleData data = new SimulationModuleData(atts, input, output, messenger);

    ModuleInterface modif = ModuleLoader.loadModuleInterface(mod_uri, cfg);
    ModuleDefinition mod = ModuleDefinition.create(cfg.getRootModule(), mod_uri, modif, null, null);
   
    ModuleInstance instance = mod.getInterface().createInstance(data, messenger);
    data.close(instance.run());

    Assert.assertEquals(String.format("Exit status of %s.", mod.getInterfaceSpecification()), status, data.getStatus());
    if (test_content)
      data.testModuleOutput();
View Full Code Here

Examples of net.sf.pipet.api.ModuleInterface.ModuleInstance

   
    try
    {
      Messenger modlogger = new PrefixMessenger(mod.getTitle()+": ", reporter);
      ServletModuleData data = new ServletModuleData(mod, cfg.getResourceLoader(), request, modlogger);
      ModuleInstance instance = mod.getCachePolicy().createCachedModuleJob(mod, data, modlogger);
      boolean result = instance.run();
      data.close(result);
     
      if (!result)
      {
        Xhtml.sendInternalServerError(response, reporter);
View Full Code Here

Examples of net.sf.pipet.api.ModuleInterface.ModuleInstance

    return runModule(mod, atts, in, out, DEFAULT_RESOURCE_LOADER, msgr);
  }

  public static boolean runModule(ModuleDefinition mod, Map<String,String> atts, Map<String,Collection<InputStream>> in, Map<String,OutputStream> out, ResourceLoader loader, Messenger msgr) throws Exception
  {
    ModuleInstance job = mod.getInterface().createInstance(new PlainModuleData(createAttributes(atts), in, out, loader), msgr);
    return job.run();
  }
View Full Code Here

Examples of net.sf.pipet.api.ModuleInterface.ModuleInstance

  @Deprecated
  public AbortablePipeline createJob(int interface_type, Messenger reporter)
    throws IOException
  {
    validate(reporter);
    ModuleInstance job = new PipelineJob(this, new DefaultResourceLoader(), interface_type, null, reporter);
    return new AbortablePipeline(job);
  }
View Full Code Here

Examples of net.sf.pipet.api.ModuleInterface.ModuleInstance

 
  public AbortablePipeline createJob(ResourceLoader res, int interface_type, Messenger reporter)
    throws IOException
  {
    validate(reporter);
    ModuleInstance job = new PipelineJob(this, res, interface_type, null, reporter);
    return new AbortablePipeline(job);
  }
View Full Code Here

Examples of net.sf.pipet.api.ModuleInterface.ModuleInstance

    return s.isEmpty() ? "none" : StringUtils.join(s, "; ");
  }
 
  private static int doJob() throws PipetError
  {
    ModuleInstance job = command.getJob();
    if (job == null)
      return 0;
   
    return job.run() ? 0 : -1;
  }
View Full Code Here

Examples of org.jbpm.module.exe.ModuleInstance

    {
      instances = new HashMap<String, ModuleInstance>();
      // loop over each optional definition
      for (ModuleDefinition definition : definitions.values()) {
        // and create the corresponding optional instance
        ModuleInstance instance = definition.createInstance();
        if (instance != null)
        {
          addInstance(instance);
        }       
      }
View Full Code Here

Examples of org.jbpm.module.exe.ModuleInstance

  /**
   * removes the given optional moduleinstance (bidirectional).
   */
  public ModuleInstance removeInstance(ModuleInstance moduleInstance)
  {
    ModuleInstance removedModuleInstance = null;
    if (moduleInstance == null)
      throw new IllegalArgumentException("can't remove a null moduleInstance from a process instance");
    if (instances != null)
    {
      removedModuleInstance = instances.remove(moduleInstance.getClass().getName());
View Full Code Here

Examples of org.jbpm.module.exe.ModuleInstance

      // loop over each optional definition
      Iterator iter = definitions.values().iterator();
      while (iter.hasNext()) {
        ModuleDefinition definition = (ModuleDefinition) iter.next();
        // and create the corresponding optional instance
        ModuleInstance instance = definition.createInstance();
        if (instance != null) {
          addInstance( instance );
        }
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.