Commit bee49a3f authored by Andrey Filippov's avatar Andrey Filippov
Browse files

fixed 'enebled' for report tools, modified tool sequencing

parent be2ad110
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -139,7 +139,7 @@ public class XMLConfig extends Config {
    static final String CONTEXT_TOOL_LOG_DIRECTORY =  "log-dir"; // folder to store the tool log files
    static final String CONTEXT_TOOL_LOG_DIRECTORY =  "log-dir"; // folder to store the tool log files
    static final String CONTEXT_TOOL_STATE_DIRECTORY = "state-dir"; // folder to store the tool state (snapshot) files
    static final String CONTEXT_TOOL_STATE_DIRECTORY = "state-dir"; // folder to store the tool state (snapshot) files
    
    
    static final String CONTEXT_TOOL_DISABLED =       "disabled"; // Parameter name that disables the tool if true
    static final String CONTEXT_TOOL_DISABLED =       "disable"; // Parameter name that disables the tool if true
    static final String CONTEXT_TOOL_RESULT =         "result";   // Parameter name keeps the filename representing result (snapshot)
    static final String CONTEXT_TOOL_RESULT =         "result";   // Parameter name keeps the filename representing result (snapshot)
    static final String CONTEXT_TOOL_RESTORE =        "restore";  // tool name that restores the state from result (shapshot)
    static final String CONTEXT_TOOL_RESTORE =        "restore";  // tool name that restores the state from result (shapshot)
    static final String CONTEXT_TOOL_SAVE =           "save";     // tool name that saves the state to result file (snapshot)
    static final String CONTEXT_TOOL_SAVE =           "save";     // tool name that saves the state to result file (snapshot)
+13 −6
Original line number Original line Diff line number Diff line
@@ -46,7 +46,7 @@ import com.elphel.vdt.core.tools.params.types.ParamTypeBool;
import com.elphel.vdt.core.tools.params.types.ParamTypeString;
import com.elphel.vdt.core.tools.params.types.ParamTypeString;
import com.elphel.vdt.core.tools.params.types.ParamTypeString.KIND;
import com.elphel.vdt.core.tools.params.types.ParamTypeString.KIND;
import com.elphel.vdt.core.tools.params.types.RunFor;
import com.elphel.vdt.core.tools.params.types.RunFor;
import com.elphel.vdt.ui.MessageUI;
//import com.elphel.vdt.ui.MessageUI;
import com.elphel.vdt.ui.VDTPluginImages;
import com.elphel.vdt.ui.VDTPluginImages;
import com.elphel.vdt.ui.views.DesignFlowView;
import com.elphel.vdt.ui.views.DesignFlowView;
import com.elphel.vdt.ui.variables.SelectedResourceManager;
import com.elphel.vdt.ui.variables.SelectedResourceManager;
@@ -227,6 +227,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
        this.stateDirString=      stateDirString;
        this.stateDirString=      stateDirString;
        
        
        this.disabledString=      disabledString;          // to disable tools from automatic running
        this.disabledString=      disabledString;          // to disable tools from automatic running
        
        this.resultString=        resultString;            // parameter name of kind of file that represents state after running this tool
        this.resultString=        resultString;            // parameter name of kind of file that represents state after running this tool
        this.restoreString=       restoreString;           // name of tool that restores the state of this tool ran (has own dependencies)
        this.restoreString=       restoreString;           // name of tool that restores the state of this tool ran (has own dependencies)
        this.saveString=          saveString;             // name of tool that saves the state of this tool run 
        this.saveString=          saveString;             // name of tool that saves the state of this tool run 
@@ -239,7 +240,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
        result=null;
        result=null;
        dependStates=null;
        dependStates=null;
        dependFiles=null;
        dependFiles=null;

		DEBUG_PRINT("Created tool"+name+" disabledString = "+disabledString);
        pinned=false;
        pinned=false;
        openState=null;
        openState=null;
        openTool=null;
        openTool=null;
@@ -577,14 +578,20 @@ public class Tool extends Context implements Cloneable, Inheritable {
                                      "' must be of type '" + ParamTypeBool.NAME + 
                                      "' must be of type '" + ParamTypeBool.NAME + 
                                      "'");
                                      "'");
        }
        }
		DEBUG_PRINT("initDisabled() tool "+name+" disabled = "+disabled); // parameter, not value
    }
    }
    
    
    public boolean isDisabled(){
    public boolean isDisabled(){
    	if (abstractTool) return true; // abstract are always disabled
    	if (abstractTool) return true; // abstract are always disabled
    	if (disabled==null) return false;
    	if (disabled==null) return false;
    	List<String> values=disabled.getValue(new FormatProcessor(this)); // null for topFormatProcessor
    	List<String> values=disabled.getValue(new FormatProcessor(this)); // null for topFormatProcessor
    	if ((values==null) || (values.size()==0)) return false;
    	if ((values==null) || (values.size()==0)) {
    	return (!values.get(0).equals("true"));
    		DEBUG_PRINT(name+".isDisabled() ==> FALSE (((values==null) || (values.size()==0)))");
    		return false;
    	}
		DEBUG_PRINT(name+".isDisabled() ==> "+values.get(0).equals("true"));
//    	return (!values.get(0).equals("true"));
    	return (values.get(0).equals("true"));
    }
    }
    
    
    public void initDepends() throws ConfigException{
    public void initDepends() throws ConfigException{
+35 −12
Original line number Original line Diff line number Diff line
@@ -530,8 +530,8 @@ java.lang.NullPointerException
					DEBUG_PRINT("Could not find enabled tool to provide state "+state);
					DEBUG_PRINT("Could not find enabled tool to provide state "+state);
					return null;
					return null;
				} else {
				} else {
					MessageUI.error("No tool provide state "+state);
					MessageUI.error("No tool provides state "+state);
					DEBUG_PRINT("No tool provide state "+state);
					DEBUG_PRINT("No tool provides state "+state);
					return null;
					return null;
				}
				}
			}
			}
@@ -698,8 +698,8 @@ java.lang.NullPointerException
				if ((dependStates!=null) && (dependStates.size()>0)){
				if ((dependStates!=null) && (dependStates.size()>0)){
					for (String state:dependStates){
					for (String state:dependStates){
						if (!stateProviders.containsKey(state)){
						if (!stateProviders.containsKey(state)){
							MessageUI.error("No tool provide output state '"+state+"' needed to satisfy dependency of the tool "+tool.getName());
							MessageUI.error("No tool provides output state '"+state+"' needed to satisfy dependency of the tool "+tool.getName());
							System.out.println("No tool provide output state '"+state+"' needed to satisfy dependency of the tool "+tool.getName());
							System.out.println("No tool provides output state '"+state+"' needed to satisfy dependency of the tool "+tool.getName());
						}
						}
					}
					}
				}
				}
@@ -716,8 +716,10 @@ java.lang.NullPointerException
			String ignoreFilter) throws CoreException {
			String ignoreFilter) throws CoreException {
		if (!okToRun()) return;
		if (!okToRun()) return;
		
		
		// Set this tool dirty (not to try reports on this tool before it ran)
		DEBUG_PRINT("launchToolSequence("+tool.getName()+", setting its state to \"Dirty\"");
		tool.setDirty(true);
		setStateProvides(); // just testing
		setStateProvides(); // just testing
		
		//    		tool.setDesignFlowView(designFlowView);
		//    		tool.setDesignFlowView(designFlowView);
		tool.setDesignFlowView(designFlowView); // maybe will not be needed with ToolSequencing class
		tool.setDesignFlowView(designFlowView); // maybe will not be needed with ToolSequencing class
		tool.setMode(mode) ; //TOOL_MODE.RUN);
		tool.setMode(mode) ; //TOOL_MODE.RUN);
@@ -1603,11 +1605,11 @@ java.lang.NullPointerException
    public void setDependState(Tool tool){
    public void setDependState(Tool tool){
    	DEBUG_PRINT("++++++++ setDependState("+tool.getName()+")");
    	DEBUG_PRINT("++++++++ setDependState("+tool.getName()+")");
    	tool.clearDependStamps(); // is it needed?
    	tool.clearDependStamps(); // is it needed?
    	Map <String,String> depStates=makeDependStates(tool);
    	Map <String,String> depStates=makeDependStates(tool,false);
    	for (String state:depStates.keySet()){
    	for (String state:depStates.keySet()){
			tool.setStateTimeStamp(state,depStates.get(state)); // name of the state file including timestamp
			tool.setStateTimeStamp(state,depStates.get(state)); // name of the state file including timestamp
    	}
    	}
    	Map <String,String> depFiles=makeDependFiles(tool);
    	Map <String,String> depFiles=makeDependFiles(tool,false);
    	for (String file:depFiles.keySet()){
    	for (String file:depFiles.keySet()){
    		DEBUG_PRINT("setDependState("+tool.getName()+"), file="+file+" stamp="+depFiles.get(file));
    		DEBUG_PRINT("setDependState("+tool.getName()+"), file="+file+" stamp="+depFiles.get(file));
			tool.setFileTimeStamp(file,depFiles.get(file)); 
			tool.setFileTimeStamp(file,depFiles.get(file)); 
@@ -1621,15 +1623,26 @@ java.lang.NullPointerException
     * @return true if all timestamps matched, false otherwise
     * @return true if all timestamps matched, false otherwise
     */
     */
    public boolean matchDependState(Tool tool){
    public boolean matchDependState(Tool tool){
    	Map <String,String> depStates=makeDependStates(tool);
    	Map <String,String> depStates=makeDependStates(tool, true);
    	Map <String,String> depFiles=makeDependFiles(tool);
    	Map <String,String> depFiles=makeDependFiles(tool,true);
        Map <String,String> storedDepStates = tool.getDependStatesTimestamps();
        Map <String,String> storedDepStates = tool.getDependStatesTimestamps();
        Map <String,String> storedDepFiles =  tool.getDependFilesTimestamps();
        Map <String,String> storedDepFiles =  tool.getDependFilesTimestamps();
        if (depStates == null) {
        	DEBUG_PRINT("matchDependState("+tool.getName()+") :"+
            " depStates == null");
        	return false;  
        }
        
        if (depStates.size()!=storedDepStates.size()) {
        if (depStates.size()!=storedDepStates.size()) {
        	DEBUG_PRINT("matchDependState("+tool.getName()+") :"+
        	DEBUG_PRINT("matchDependState("+tool.getName()+") :"+
            " depStates.size()!=storedDepStates.size() - "+depStates.size()+"!="+storedDepStates.size());
            " depStates.size()!=storedDepStates.size() - "+depStates.size()+"!="+storedDepStates.size());
        	return false;  
        	return false;  
        }
        }
        if (depFiles == null) {
        	DEBUG_PRINT("matchDependState("+tool.getName()+") :"+
                    " depFiles == null");
        	return false; 
        }
        if (depFiles.size()!=storedDepFiles.size()) {
        if (depFiles.size()!=storedDepFiles.size()) {
        	DEBUG_PRINT("matchDependState("+tool.getName()+") :"+
        	DEBUG_PRINT("matchDependState("+tool.getName()+") :"+
                    " depFiles.size()!=storedDepFiles.size() - "+depFiles.size()+"!="+storedDepFiles.size());
                    " depFiles.size()!=storedDepFiles.size() - "+depFiles.size()+"!="+storedDepFiles.size());
@@ -1662,7 +1675,7 @@ java.lang.NullPointerException
     * @param tool tool just ran
     * @param tool tool just ran
     * @return map of states (link names) to states files (full with timestamps) 
     * @return map of states (link names) to states files (full with timestamps) 
     */
     */
    private  Map <String,String> makeDependStates(Tool tool){
    private  Map <String,String> makeDependStates(Tool tool, boolean failOnMissing){
    	Map <String,String> depStates=new Hashtable<String,String>();    	
    	Map <String,String> depStates=new Hashtable<String,String>();    	
    	List<String> dependStates=tool.getDependStates();
    	List<String> dependStates=tool.getDependStates();
    	if (dependStates!=null) for (String state: dependStates){
    	if (dependStates!=null) for (String state: dependStates){
@@ -1670,6 +1683,10 @@ java.lang.NullPointerException
    			ToolStateStamp tss=currentStates.get(state);
    			ToolStateStamp tss=currentStates.get(state);
    			depStates.put(state,tss.getToolStateFile()); // name of the state file including timestamp
    			depStates.put(state,tss.getToolStateFile()); // name of the state file including timestamp
    		} else {
    		} else {
				if (failOnMissing) {
	    			DEBUG_PRINT("makeDependStates: no information for state "+state+" on which tool "+tool.getName()+" depends, failing");
					return null;
				}
    			DEBUG_PRINT("Seems a BUG (OK when called matchDependState): no information for state "+state+" on which tool "+tool.getName()+" depends");
    			DEBUG_PRINT("Seems a BUG (OK when called matchDependState): no information for state "+state+" on which tool "+tool.getName()+" depends");
/*    			
/*    			
    			DEBUG_PRINT("currentStates are:");
    			DEBUG_PRINT("currentStates are:");
@@ -1681,10 +1698,10 @@ java.lang.NullPointerException
    	}
    	}
    	return depStates;
    	return depStates;
    }
    }
    private  Map <String,String> makeDependFiles(Tool tool){
    private  Map <String,String> makeDependFiles(Tool tool, boolean failOnMissing){
    	DEBUG_PRINT("++++++ makeDependFiles("+tool.getName()+")");
    	DEBUG_PRINT("++++++ makeDependFiles("+tool.getName()+")");
    	Map <String,String> depFiles=new Hashtable<String,String>();    	
    	Map <String,String> depFiles=new Hashtable<String,String>();    	
    	List<String> dependFileNames=tool.getDependFiles();
    	List<String> dependFileNames=tool.getDependFiles(); // files on which this tool depends
    	if (dependFileNames!=null) {
    	if (dependFileNames!=null) {
    		IProject project = SelectedResourceManager.getDefault().getSelectedProject(); // should not be null when we got here
    		IProject project = SelectedResourceManager.getDefault().getSelectedProject(); // should not be null when we got here
    		for (String depFile: dependFileNames){
    		for (String depFile: dependFileNames){
@@ -1698,6 +1715,12 @@ java.lang.NullPointerException
    				DEBUG_PRINT("makeDependFiles(): file="+depFile+", stamp="+sourceFile.getModificationStamp()+
    				DEBUG_PRINT("makeDependFiles(): file="+depFile+", stamp="+sourceFile.getModificationStamp()+
    						" ("+sourceFile.toString()+")");
    						" ("+sourceFile.toString()+")");
    			} else {
    			} else {
    				if (failOnMissing) {
        				DEBUG_PRINT("makeDependFiles(): source file "+sourceFile.getLocation()+" on which tool "+
    						tool.getName()+" depends does not exist, failing");
        				return null;
    					
    				}
    				System.out.println("Seems a BUG:  source file "+sourceFile.getLocation()+" on which tool "+
    				System.out.println("Seems a BUG:  source file "+sourceFile.getLocation()+" on which tool "+
    						tool.getName()+" depends does not exist");
    						tool.getName()+" depends does not exist");
    				depFiles.put(depFile, ""); // empty stamp for non-existent files?
    				depFiles.put(depFile, ""); // empty stamp for non-existent files?
+0 −1
Original line number Original line Diff line number Diff line
@@ -73,7 +73,6 @@ register cascade chains, or that can be converted to register cascade chains"/>
		log-dir="QuartusLogDir"
		log-dir="QuartusLogDir"
		state-dir="QuartusLocalDir"
		state-dir="QuartusLocalDir"
		restore="RestoreQuartusPlace"
		restore="RestoreQuartusPlace"
		disable="DisableQuartusPlace"
		save="SaveQuartusPlace"
		save="SaveQuartusPlace"
		autosave="AutosaveQuartusPlace"
		autosave="AutosaveQuartusPlace"
		inherits="QuartusToolPrototype"
		inherits="QuartusToolPrototype"
+0 −1
Original line number Original line Diff line number Diff line
@@ -72,7 +72,6 @@ may decrease as fast-synthesis netlists take longer to route."/>
		log-dir="QuartusLogDir"
		log-dir="QuartusLogDir"
		state-dir="QuartusLocalDir"
		state-dir="QuartusLocalDir"
		restore="RestoreQuartusSynthesis"
		restore="RestoreQuartusSynthesis"
		disable="DisableQuartusSynth"
		save="SaveQuartusSynthesis"
		save="SaveQuartusSynthesis"
		autosave="AutosaveQuartusSynthesis"
		autosave="AutosaveQuartusSynthesis"
		inherits="QuartusToolPrototype"
		inherits="QuartusToolPrototype"
Loading