Commit bee49a3f authored by Andrey Filippov's avatar Andrey Filippov

fixed 'enebled' for report tools, modified tool sequencing

parent be2ad110
......@@ -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_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_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)
......
......@@ -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.KIND;
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.views.DesignFlowView;
import com.elphel.vdt.ui.variables.SelectedResourceManager;
......@@ -226,7 +226,8 @@ public class Tool extends Context implements Cloneable, Inheritable {
this.logDirString= logDirString;
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.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
......@@ -239,7 +240,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
result=null;
dependStates=null;
dependFiles=null;
DEBUG_PRINT("Created tool"+name+" disabledString = "+disabledString);
pinned=false;
openState=null;
openTool=null;
......@@ -576,15 +577,21 @@ public class Tool extends Context implements Cloneable, Inheritable {
"' used for tool '" + name +
"' must be of type '" + ParamTypeBool.NAME +
"'");
}
}
DEBUG_PRINT("initDisabled() tool "+name+" disabled = "+disabled); // parameter, not value
}
public boolean isDisabled(){
if (abstractTool) return true; // abstract are always disabled
if (disabled==null) return false;
List<String> values=disabled.getValue(new FormatProcessor(this)); // null for topFormatProcessor
if ((values==null) || (values.size()==0)) return false;
return (!values.get(0).equals("true"));
if ((values==null) || (values.size()==0)) {
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{
......
......@@ -530,8 +530,8 @@ java.lang.NullPointerException
DEBUG_PRINT("Could not find enabled tool to provide state "+state);
return null;
} else {
MessageUI.error("No tool provide state "+state);
DEBUG_PRINT("No tool provide state "+state);
MessageUI.error("No tool provides state "+state);
DEBUG_PRINT("No tool provides state "+state);
return null;
}
}
......@@ -698,8 +698,8 @@ java.lang.NullPointerException
if ((dependStates!=null) && (dependStates.size()>0)){
for (String state:dependStates){
if (!stateProviders.containsKey(state)){
MessageUI.error("No tool provide 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());
MessageUI.error("No tool provides 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 {
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
// tool.setDesignFlowView(designFlowView);
tool.setDesignFlowView(designFlowView); // maybe will not be needed with ToolSequencing class
tool.setMode(mode) ; //TOOL_MODE.RUN);
......@@ -1603,11 +1605,11 @@ java.lang.NullPointerException
public void setDependState(Tool tool){
DEBUG_PRINT("++++++++ setDependState("+tool.getName()+")");
tool.clearDependStamps(); // is it needed?
Map <String,String> depStates=makeDependStates(tool);
Map <String,String> depStates=makeDependStates(tool,false);
for (String state:depStates.keySet()){
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()){
DEBUG_PRINT("setDependState("+tool.getName()+"), file="+file+" stamp="+depFiles.get(file));
tool.setFileTimeStamp(file,depFiles.get(file));
......@@ -1621,15 +1623,26 @@ java.lang.NullPointerException
* @return true if all timestamps matched, false otherwise
*/
public boolean matchDependState(Tool tool){
Map <String,String> depStates=makeDependStates(tool);
Map <String,String> depFiles=makeDependFiles(tool);
Map <String,String> depStates=makeDependStates(tool, true);
Map <String,String> depFiles=makeDependFiles(tool,true);
Map <String,String> storedDepStates = tool.getDependStatesTimestamps();
Map <String,String> storedDepFiles = tool.getDependFilesTimestamps();
if (depStates == null) {
DEBUG_PRINT("matchDependState("+tool.getName()+") :"+
" depStates == null");
return false;
}
if (depStates.size()!=storedDepStates.size()) {
DEBUG_PRINT("matchDependState("+tool.getName()+") :"+
" depStates.size()!=storedDepStates.size() - "+depStates.size()+"!="+storedDepStates.size());
return false;
}
if (depFiles == null) {
DEBUG_PRINT("matchDependState("+tool.getName()+") :"+
" depFiles == null");
return false;
}
if (depFiles.size()!=storedDepFiles.size()) {
DEBUG_PRINT("matchDependState("+tool.getName()+") :"+
" depFiles.size()!=storedDepFiles.size() - "+depFiles.size()+"!="+storedDepFiles.size());
......@@ -1662,7 +1675,7 @@ java.lang.NullPointerException
* @param tool tool just ran
* @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>();
List<String> dependStates=tool.getDependStates();
if (dependStates!=null) for (String state: dependStates){
......@@ -1670,6 +1683,10 @@ java.lang.NullPointerException
ToolStateStamp tss=currentStates.get(state);
depStates.put(state,tss.getToolStateFile()); // name of the state file including timestamp
} 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("currentStates are:");
......@@ -1681,10 +1698,10 @@ java.lang.NullPointerException
}
return depStates;
}
private Map <String,String> makeDependFiles(Tool tool){
private Map <String,String> makeDependFiles(Tool tool, boolean failOnMissing){
DEBUG_PRINT("++++++ makeDependFiles("+tool.getName()+")");
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) {
IProject project = SelectedResourceManager.getDefault().getSelectedProject(); // should not be null when we got here
for (String depFile: dependFileNames){
......@@ -1698,6 +1715,12 @@ java.lang.NullPointerException
DEBUG_PRINT("makeDependFiles(): file="+depFile+", stamp="+sourceFile.getModificationStamp()+
" ("+sourceFile.toString()+")");
} 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 "+
tool.getName()+" depends does not exist");
depFiles.put(depFile, ""); // empty stamp for non-existent files?
......
......@@ -73,7 +73,6 @@ register cascade chains, or that can be converted to register cascade chains"/>
log-dir="QuartusLogDir"
state-dir="QuartusLocalDir"
restore="RestoreQuartusPlace"
disable="DisableQuartusPlace"
save="SaveQuartusPlace"
autosave="AutosaveQuartusPlace"
inherits="QuartusToolPrototype"
......
......@@ -72,7 +72,6 @@ may decrease as fast-synthesis netlists take longer to route."/>
log-dir="QuartusLogDir"
state-dir="QuartusLocalDir"
restore="RestoreQuartusSynthesis"
disable="DisableQuartusSynth"
save="SaveQuartusSynthesis"
autosave="AutosaveQuartusSynthesis"
inherits="QuartusToolPrototype"
......
......@@ -194,7 +194,7 @@
default="off" visible="true" omit="off" type="PRIOType" format="Dash"/>
<!-- default not clear , disabling omit-->
<parameter id="register_duplication" label="Register duplication"
tooltip="PRegister duplication (disabled if '-global_opt' is used, reguires '-timing')"
tooltip="Register duplication (disabled if '-global_opt' is used, reguires '-timing')"
default="true" omit="" type= "Bool_on_off" format="Dash"/>
<parameter id="register_ordering" outid="r" label="Register ordering"
tooltip="Register ordering in a slice (use 4 or 8)"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment