Commit 7ee96883 authored by Andrey Filippov's avatar Andrey Filippov

Split tools into core, restore and save, made inheritance work in these

cases
parent 4c8d5dc3
...@@ -32,6 +32,7 @@ import org.eclipse.ui.console.IConsoleManager; ...@@ -32,6 +32,7 @@ import org.eclipse.ui.console.IConsoleManager;
import com.elphel.vdt.core.tools.ToolsCore; import com.elphel.vdt.core.tools.ToolsCore;
import com.elphel.vdt.core.tools.params.Tool; import com.elphel.vdt.core.tools.params.Tool;
import com.elphel.vdt.core.tools.params.Tool.TOOL_MODE;
import com.elphel.vdt.core.tools.params.Tool.TOOL_STATE; import com.elphel.vdt.core.tools.params.Tool.TOOL_STATE;
import com.elphel.vdt.ui.MessageUI; import com.elphel.vdt.ui.MessageUI;
import com.elphel.vdt.veditor.VerilogPlugin; import com.elphel.vdt.veditor.VerilogPlugin;
...@@ -289,7 +290,8 @@ public class RunningBuilds { ...@@ -289,7 +290,8 @@ public class RunningBuilds {
VDTRunnerConfiguration runConfig=unfinishedBuilds.get(consoleName); VDTRunnerConfiguration runConfig=unfinishedBuilds.get(consoleName);
if (toolName.equals(runConfig.getToolName())){ if (toolName.equals(runConfig.getToolName())){
Tool tool=ToolsCore.getTool(runConfig.getToolName()); Tool tool=ToolsCore.getTool(runConfig.getToolName());
tool.setRunning(false); // tool.setRunning(false);
tool.setMode(TOOL_MODE.STOP);
tool.toolFinished(); tool.toolFinished();
if (tool.getState()==TOOL_STATE.KEPT_OPEN) { if (tool.getState()==TOOL_STATE.KEPT_OPEN) {
MessageUI.error("Termninal that starts by this tool ("+toolName+") is already open in console \""+consoleName+"\""); MessageUI.error("Termninal that starts by this tool ("+toolName+") is already open in console \""+consoleName+"\"");
......
...@@ -55,6 +55,7 @@ import com.elphel.vdt.Txt; ...@@ -55,6 +55,7 @@ import com.elphel.vdt.Txt;
import com.elphel.vdt.core.tools.ToolsCore; import com.elphel.vdt.core.tools.ToolsCore;
import com.elphel.vdt.core.tools.contexts.BuildParamsItem; import com.elphel.vdt.core.tools.contexts.BuildParamsItem;
import com.elphel.vdt.core.tools.params.Tool; import com.elphel.vdt.core.tools.params.Tool;
import com.elphel.vdt.core.tools.params.Tool.TOOL_MODE;
import com.elphel.vdt.core.tools.params.Tool.TOOL_STATE; import com.elphel.vdt.core.tools.params.Tool.TOOL_STATE;
import com.elphel.vdt.ui.MessageUI; import com.elphel.vdt.ui.MessageUI;
//import com.elphel.vdt.VDTPlugin; //import com.elphel.vdt.VDTPlugin;
...@@ -69,6 +70,7 @@ import com.elphel.vdt.veditor.preference.PreferenceStrings; ...@@ -69,6 +70,7 @@ import com.elphel.vdt.veditor.preference.PreferenceStrings;
//import com.elphel.vdt.core.Utils; //import com.elphel.vdt.core.Utils;
import org.eclipse.ui.console.IConsoleListener; import org.eclipse.ui.console.IConsoleListener;
...@@ -94,7 +96,8 @@ public class VDTRunner { ...@@ -94,7 +96,8 @@ public class VDTRunner {
Tool tool=ToolsCore.getTool(runConfig.getToolName()); Tool tool=ToolsCore.getTool(runConfig.getToolName());
tool.setDirty(false); tool.setDirty(false);
tool.setState(TOOL_STATE.FAILURE); tool.setState(TOOL_STATE.FAILURE);
tool.setRunning(false); // tool.setRunning(false);
tool.setMode(TOOL_MODE.STOP);
tool.setTimeStamp(); tool.setTimeStamp();
tool.toolFinished(); tool.toolFinished();
//removeConfiguration //removeConfiguration
...@@ -264,7 +267,9 @@ public class VDTRunner { ...@@ -264,7 +267,9 @@ public class VDTRunner {
if (debugPrint) System.out.println("All finished"); if (debugPrint) System.out.println("All finished");
monitor.done(); monitor.done();
Tool tool=ToolsCore.getTool(runConfig.getToolName()); Tool tool=ToolsCore.getTool(runConfig.getToolName());
tool.setRunning(false); // tool.setRunning(false);
tool.setMode(TOOL_MODE.STOP);
tool.setTimeStamp(); tool.setTimeStamp();
if ((tool.getState()==TOOL_STATE.SUCCESS) && runConfig.isKeptOpen()) { if ((tool.getState()==TOOL_STATE.SUCCESS) && runConfig.isKeptOpen()) {
tool.setState(TOOL_STATE.KEPT_OPEN); tool.setState(TOOL_STATE.KEPT_OPEN);
...@@ -331,12 +336,11 @@ public class VDTRunner { ...@@ -331,12 +336,11 @@ public class VDTRunner {
} //for (;numItem<argumentsItemsArray.length;numItem++){ } //for (;numItem<argumentsItemsArray.length;numItem++){
System.out.println("All playbacks finished"); System.out.println("All playbacks finished");
monitor.done(); monitor.done();
ToolsCore.getTool(runConfig.getToolName()).setRunning(false); // ToolsCore.getTool(runConfig.getToolName()).setRunning(false);
ToolsCore.getTool(runConfig.getToolName()).setMode(TOOL_MODE.STOP);
ToolsCore.getTool(runConfig.getToolName()).toolFinished(); ToolsCore.getTool(runConfig.getToolName()).toolFinished();
} }
public void log(String header, public void log(String header,
String[] strings, String[] strings,
String[] controlFiles, String[] controlFiles,
......
...@@ -130,7 +130,10 @@ public class XMLConfig extends Config { ...@@ -130,7 +130,10 @@ public class XMLConfig extends Config {
static final String CONTEXT_TOOL_DISABLED = "disabled"; // Parameter name that disables the tool if true static final String CONTEXT_TOOL_DISABLED = "disabled"; // 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 form result 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_AUTOSAVE = "autosave"; // Parameter name of boolean type that controls automatic save after success
static final String CONTEXT_TOOL_ABSTRACT = "abstract"; // true for the prototype tools used only for inheritance by others
static final String CONTEXT_LINEBLOCK_TAG = "line"; static final String CONTEXT_LINEBLOCK_TAG = "line";
...@@ -572,7 +575,8 @@ public class XMLConfig extends Config { ...@@ -572,7 +575,8 @@ public class XMLConfig extends Config {
String contextLabel = getAttributeValue(contextNode, CONTEXT_LABEL_ATTR); String contextLabel = getAttributeValue(contextNode, CONTEXT_LABEL_ATTR);
if(contextLabel == null) if(contextLabel == null)
throw new ConfigException(err.msg(CONTEXT_LABEL_ATTR)); contextLabel=contextName; // Use name as label /Andrey
// throw new ConfigException(err.msg(CONTEXT_LABEL_ATTR));
Context context = null; Context context = null;
...@@ -636,12 +640,24 @@ public class XMLConfig extends Config { ...@@ -636,12 +640,24 @@ public class XMLConfig extends Config {
String result = getAttributeValue(contextNode, CONTEXT_TOOL_RESULT); String result = getAttributeValue(contextNode, CONTEXT_TOOL_RESULT);
String restore = getAttributeValue(contextNode, CONTEXT_TOOL_RESTORE); String restore = getAttributeValue(contextNode, CONTEXT_TOOL_RESTORE);
String saveString = getAttributeValue(contextNode, CONTEXT_TOOL_SAVE);
String autoSaveString = getAttributeValue(contextNode, CONTEXT_TOOL_AUTOSAVE);
String isAbstractAttr = getAttributeValue(contextNode, CONTEXT_TOOL_ABSTRACT);
boolean isAbstract;
if(isAbstractAttr != null) {
checkBoolAttr(isAbstractAttr, CONTEXT_TOOL_ABSTRACT);
isAbstract = getBoolAttrValue(isAbstractAttr);
} else {
isAbstract = false;
}
boolean isShell=false; boolean isShell=false;
if (toolShell != null){ if (toolShell != null){
toolExe=toolShell; toolExe=toolShell;
isShell=true; isShell=true;
} }
if(toolExe == null) if((toolExe == null) && (toolBase == null)) // when tool inherits, it's exe will be inherited too - check!
throw new ConfigException(err.msg(CONTEXT_TOOL_EXE_ATTR)); throw new ConfigException(err.msg(CONTEXT_TOOL_EXE_ATTR));
// if(toolShell == null) toolShell=""; // if(toolShell == null) toolShell="";
...@@ -682,11 +698,13 @@ public class XMLConfig extends Config { ...@@ -682,11 +698,13 @@ public class XMLConfig extends Config {
disabled, disabled,
result, result,
restore, restore,
saveString,
autoSaveString,
isAbstract,
null, null,
null, null,
null); null);
break; break;
default: default:
throw new ConfigException("Internal error: unknown context kind '" + contextKind + "'"); throw new ConfigException("Internal error: unknown context kind '" + contextKind + "'");
} }
......
...@@ -166,6 +166,7 @@ public class ContextManager { ...@@ -166,6 +166,7 @@ public class ContextManager {
private Context findContext(List<? extends Context> contexts, String name) { private Context findContext(List<? extends Context> contexts, String name) {
for(Context context : contexts) { for(Context context : contexts) {
// System.out.println("Comparing "+context.getName() +" with "+name);
if(context.getName().equals(name)) if(context.getName().equals(name))
return context; return context;
} }
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
package com.elphel.vdt.core.tools.generators; package com.elphel.vdt.core.tools.generators;
import com.elphel.vdt.VDT; import com.elphel.vdt.VDT;
import com.elphel.vdt.ui.variables.SelectedResourceManager;
public class StateDirGenerator extends AbstractGenerator { public class StateDirGenerator extends AbstractGenerator {
public static final String NAME = VDT.GENERATOR_ID_STATE_DIR; public static final String NAME = VDT.GENERATOR_ID_STATE_DIR;
...@@ -27,8 +26,6 @@ public class StateDirGenerator extends AbstractGenerator { ...@@ -27,8 +26,6 @@ public class StateDirGenerator extends AbstractGenerator {
} }
protected String[] getStringValues() { protected String[] getStringValues() {
String stateDir=(tool0==null)?null:tool0.getStateDir(); return new String[] {(tool0!=null)?tool0.getStateDir(): ""};
if (stateDir==null) stateDir="";
return new String[] {stateDir};
} }
} }
...@@ -27,8 +27,6 @@ public class StateFileGenerator extends AbstractGenerator { ...@@ -27,8 +27,6 @@ public class StateFileGenerator extends AbstractGenerator {
} }
protected String[] getStringValues() { protected String[] getStringValues() {
String stateFile=(tool0==null)? null: tool0.getStateFile(); // calculated from result name and timestamp, or explicitly specified return new String[] {(tool0!=null)?tool0.getStateFile(): ""};
if (stateFile==null) stateFile="";
return new String[] {stateFile};
} }
} }
...@@ -483,11 +483,6 @@ public class Parameter implements Cloneable, Updateable { ...@@ -483,11 +483,6 @@ public class Parameter implements Cloneable, Updateable {
// returns current value if it is set // returns current value if it is set
// otherwise returns default value // otherwise returns default value
public List<String> getValue() { public List<String> getValue() {
/*
if (id.equals("SimulationTopFile")){ // Andrey
System.out.println("getValue() SimulationTopFile");
}
*/
if(!currentValue.isEmpty()) if(!currentValue.isEmpty())
return currentValue; return currentValue;
...@@ -497,11 +492,6 @@ public class Parameter implements Cloneable, Updateable { ...@@ -497,11 +492,6 @@ public class Parameter implements Cloneable, Updateable {
// returns external form of the current value unless it equals null; // returns external form of the current value unless it equals null;
// otherwise returns external form of the default value // otherwise returns external form of the default value
public List<String> getExternalValueForm() { public List<String> getExternalValueForm() {
/*
if (id.equals("SimulationTopFile")){ // Andrey
System.out.println("getExternalValueForm() SimulationTopFile");
}
*/
List<String> externalFormValue = new ArrayList<String>(); List<String> externalFormValue = new ArrayList<String>();
for(Iterator<String> i = getValue().iterator(); i.hasNext();) { for(Iterator<String> i = getValue().iterator(); i.hasNext();) {
......
...@@ -39,6 +39,8 @@ import com.elphel.vdt.core.tools.params.types.RunFor; ...@@ -39,6 +39,8 @@ import com.elphel.vdt.core.tools.params.types.RunFor;
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;
import com.elphel.vdt.veditor.VerilogPlugin;
import com.elphel.vdt.veditor.preference.PreferenceStrings;
public class Tool extends Context implements Cloneable, Inheritable { public class Tool extends Context implements Cloneable, Inheritable {
...@@ -82,23 +84,25 @@ public class Tool extends Context implements Cloneable, Inheritable { ...@@ -82,23 +84,25 @@ public class Tool extends Context implements Cloneable, Inheritable {
private String disabledString=null; // to disable tools from automatic running private String disabledString=null; // to disable tools from automatic running
private String resultString=null; // parameter name of kind of file that represents state after running this tool private String resultString=null; // parameter name of kind of file that represents state after running this tool
private String restoreString=null; // name of tool that restores the state of this tool ran (has own dependencies) private String restoreString=null; // name of tool that restores the state of this tool ran (has own dependencies)
private String saveString=null; // name of tool that saves the state of this tool run
private String autoSaveString=null; // name of boolean that turns on/off auto-save after the tool run
private boolean abstractTool; // abstract tools can only be used for inheritance, not directly (so they will not be
// considered when looking for solution to run
private Parameter disabled; private Parameter disabled;
private Tool restore; private Tool restoreTool;
private Parameter result; private Parameter result;
// TODO: Compare dependFiles with literary result of other tools, if match - these are states, not files // TODO: Compare dependFiles with literary result of other tools, if match - these are states, not files
private List<Parameter> dependSessions; private List<Parameter> dependSessions;
private List<Parameter> dependFiles; private List<Parameter> dependFiles;
// private boolean toolIsRestore; // this tool is referenced by other as restore="this-tool" // private boolean toolIsRestore; // this tool is referenced by other as restore="this-tool"
private Tool restoreMaster; // Tool, for which this one is restore (or null if for none). Same restore for
// multiple masters is not allowed
private boolean dirty=false; // tool ran before its sources (runtime value) private boolean dirty=false; // tool ran before its sources (runtime value)
private boolean pinned=false; // tool ran before its sources (runtime value) private boolean pinned=false; // tool ran before its sources (runtime value)
private String openState=null; // (only for open sessions) - last successful result ran in this session
private long runStamp=0; // timestamp of the tool last ran (0 - never) private long runStamp=0; // timestamp of the tool last ran (0 - never)
private TOOL_STATE state=TOOL_STATE.NEW; // tool state (succ, fail,new, running) private TOOL_STATE state=TOOL_STATE.NEW; // tool state (succ, fail,new, running)
private boolean running=false; // private boolean running=false;
// private long finishTimeStamp=0; // private long finishTimeStamp=0;
private String timeStamp=null; private String timeStamp=null;
private DesignFlowView designFlowView; private DesignFlowView designFlowView;
...@@ -106,6 +110,17 @@ public class Tool extends Context implements Cloneable, Inheritable { ...@@ -106,6 +110,17 @@ public class Tool extends Context implements Cloneable, Inheritable {
private String resultFile; // used to overwrite name of the default result file that normally private String resultFile; // used to overwrite name of the default result file that normally
// is calculated from result and timestamp; // is calculated from result and timestamp;
private String openState=null; // (only for open sessions) - last successful result ran in this session
private Tool openTool=null; // (only for open sessions) - tool last successful result ran in this session (null if none/failed)
private Tool restoreMaster; // Tool, for which this one is restore (or null if for none). Same restore for
// multiple masters is not allowed
private Tool saveMaster; // Tool, for which one this is used to save state (should have only one master)
// with inheritance "disabled" will be taken from master
private Tool saveTool;
private Parameter autoSave; // automatically run saveTool after successful completion of this one
private TOOL_MODE runMode;
private TOOL_MODE lastRunMode; // last running (not STOP) mode
public Tool(String name, public Tool(String name,
...@@ -130,7 +145,9 @@ public class Tool extends Context implements Cloneable, Inheritable { ...@@ -130,7 +145,9 @@ public class Tool extends Context implements Cloneable, Inheritable {
String disabledString, // to disable tools from automatic running String disabledString, // to disable tools from automatic running
String resultString, // parameter name of kind of file that represents state after running this tool String resultString, // parameter name of kind of file that represents state after running this tool
String restoreString, // name of tool that restores the state of this tool ran (has own dependencies) String restoreString, // name of tool that restores the state of this tool ran (has own dependencies)
String saveString, // name of tool that saves the state of this tool run
String autoSaveString, // name of boolean that turns on/off auto-save after the tool run
boolean abstractTool,
/* never used ??? */ /* never used ??? */
List<Parameter> params, List<Parameter> params,
List<ParamGroup> paramGroups, List<ParamGroup> paramGroups,
...@@ -163,22 +180,31 @@ public class Tool extends Context implements Cloneable, Inheritable { ...@@ -163,22 +180,31 @@ public class Tool extends Context implements Cloneable, Inheritable {
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.autoSaveString= autoSaveString; // name of boolean that turns on/off auto-save after the tool run
this.abstractTool= abstractTool;
disabled=null; disabled=null;
restore=null; restoreTool=null;
result=null; result=null;
dependSessions=null; dependSessions=null;
dependFiles=null; dependFiles=null;
this.pinned=false; pinned=false;
this.openState=null; openState=null;
this.choice=0; openTool=null;
this.designFlowView =null; choice=0;
this.timeStamp=null; designFlowView =null;
this.logDir=null; timeStamp=null;
this.stateDir=null; logDir=null;
this.resultFile=null; stateDir=null;
resultFile=null;
restoreMaster=null; restoreMaster=null;
saveMaster=null;
saveTool=null;
autoSave=null;
runMode=TOOL_MODE.STOP;
lastRunMode=TOOL_MODE.STOP;
} }
public enum TOOL_STATE { public enum TOOL_STATE {
NEW, NEW,
...@@ -188,17 +214,31 @@ public class Tool extends Context implements Cloneable, Inheritable { ...@@ -188,17 +214,31 @@ public class Tool extends Context implements Cloneable, Inheritable {
KEPT_OPEN//, KEPT_OPEN//,
// RUNNING // RUNNING
} }
public enum TOOL_MODE {
STOP,
RUN,
RESTORE,
SAVE,
PLAYBACK
}
public void setRunStamp(long runStamp) { this.runStamp=runStamp; } public void setRunStamp(long runStamp) { this.runStamp=runStamp; }
public List<String> getDepends() { return depends; } public List<String> getDepends() { return depends; }
public boolean isDirty() { return dirty; } public boolean isDirty() { return dirty; }
public boolean isRunning() { return running; } // public boolean isRunning() { return running; }
public boolean isRunning() { return runMode!=TOOL_MODE.STOP; }
public TOOL_MODE getMode() { return runMode; }
public TOOL_MODE getLastMode() { return lastRunMode; }
public long getRunStamp() { return runStamp; } public long getRunStamp() { return runStamp; }
public TOOL_STATE getState() { return state; } public TOOL_STATE getState() { return state; }
public boolean isPinned() { return pinned; } public boolean isPinned() { return pinned; }
public String getOpenState() { return openState; } public String getOpenState() { return openState; }
public void setOpenState(String stateName) { openState=stateName;} public void setOpenState(String stateName) { openState=stateName;}
public Tool getOpenTool() { return openTool; }
public void setOpenTool(Tool openTool) { this.openTool=openTool;}
public void setTimeStamp(){ public void setTimeStamp(){
timeStamp=SelectedResourceManager.getDefault().getBuildStamp(); timeStamp=SelectedResourceManager.getDefault().getBuildStamp();
...@@ -216,21 +256,27 @@ public class Tool extends Context implements Cloneable, Inheritable { ...@@ -216,21 +256,27 @@ public class Tool extends Context implements Cloneable, Inheritable {
public void setPinned(boolean pinned) { public void setPinned(boolean pinned) {
this.pinned=pinned; this.pinned=pinned;
// toolFinished(); // toolFinished();
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE)) {
System.out.println("SetPinned("+pinned+")"); System.out.println("SetPinned("+pinned+")");
} }
public void setRunning(boolean running) {
this.running=running;
// toolFinished();
System.out.println("SetRunning("+running+")");
} }
public void setMode(TOOL_MODE mode) {
runMode=mode;
if (mode!=TOOL_MODE.STOP) lastRunMode=mode;
// toolFinished();
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE)) {
System.out.println("--->> "+name+": setMode("+mode+"), lastRunMode="+lastRunMode);
}
}
public void setState(TOOL_STATE state) { public void setState(TOOL_STATE state) {
this.state=state; this.state=state;
// toolFinished(); // toolFinished();
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE)) {
System.out.println("SetState("+state+")"); System.out.println("SetState("+state+")");
} }
}
public void setDesignFlowView (DesignFlowView designFlowView){ public void setDesignFlowView (DesignFlowView designFlowView){
this.designFlowView = designFlowView; // to be able to update actions and so the state icons this.designFlowView = designFlowView; // to be able to update actions and so the state icons
...@@ -300,20 +346,26 @@ System.out.println("Tool "+getName()+" FINISHED - add more stuff here"); ...@@ -300,20 +346,26 @@ System.out.println("Tool "+getName()+" FINISHED - add more stuff here");
Checks.checkCyclicInheritance(this, "tool"); Checks.checkCyclicInheritance(this, "tool");
if(baseTool != null) if(baseTool != null) {
baseTool.init(config); baseTool.init(config);
abstractTool=false;
copyBaseAttributes();
}
checkBaseTool(); checkBaseTool();
initParentPackage(); initParentPackage();
initParentProject(); initParentProject();
initParams(); // *Inherits and sets up contexts? Also Error with copying context to items initParams(); // *Inherits and sets up contexts? Also Error with copying context to items
initOtherAttributes(); initOtherAttributes();
initDisabled(); initDisabled();
initDepends(); initDepends();
initResult(); initResult();
initRestore(); initRestore();
initSave();
initAutoSave();
initStateDir(); initStateDir();
initLogDir(); initLogDir();
...@@ -321,6 +373,29 @@ System.out.println("Tool "+getName()+" FINISHED - add more stuff here"); ...@@ -321,6 +373,29 @@ System.out.println("Tool "+getName()+" FINISHED - add more stuff here");
initialized = true; initialized = true;
} }
// Should be called before strings are processed
public void copyBaseAttributes(){
if (label==null) label=baseTool.label;
if (exeName==null) {
exeName=baseTool.exeName;
isShell=baseTool.isShell;
}
if (extensions== null) extensions = baseTool.extensions;
if (toolErrors== null) toolErrors = baseTool.toolErrors;
if (toolWarnings== null) toolWarnings = baseTool.toolWarnings;
if (toolInfo== null) toolInfo = baseTool.toolInfo;
if (runfor== null) runfor = baseTool.runfor;
if (ignoreFilter== null) ignoreFilter = baseTool.ignoreFilter;
if (depends== null) depends = baseTool.depends;
if (logDirString== null) logDirString = baseTool.logDirString;
if (stateDirString== null) stateDirString = baseTool.stateDirString;
if (disabledString== null) disabledString = baseTool.disabledString;
if (resultString== null) resultString = baseTool.resultString;
if (restoreString== null) restoreString = baseTool.restoreString;
if (saveString== null) saveString = baseTool.saveString;
if (autoSaveString== null) autoSaveString = baseTool.autoSaveString;
}
public void initDisabled() throws ConfigException{ public void initDisabled() throws ConfigException{
if (disabledString==null) return; if (disabledString==null) return;
disabled=findParam(disabledString); disabled=findParam(disabledString);
...@@ -337,6 +412,7 @@ System.out.println("Tool "+getName()+" FINISHED - add more stuff here"); ...@@ -337,6 +412,7 @@ System.out.println("Tool "+getName()+" FINISHED - add more stuff here");
} }
public boolean isDisabled(){ public boolean isDisabled(){
if (abstractTool) return true; // abstract are always disabled
if (disabled==null) return false; if (disabled==null) return false;
List<String> values=disabled.getValue(); List<String> values=disabled.getValue();
if ((values==null) || (values.size()==0)) return false; if ((values==null) || (values.size()==0)) return false;
...@@ -421,6 +497,30 @@ System.out.println("Tool "+getName()+" FINISHED - add more stuff here"); ...@@ -421,6 +497,30 @@ System.out.println("Tool "+getName()+" FINISHED - add more stuff here");
} }
} }
} }
// this.autoSaveString=autoSaveString; // name of boolean that turns on/off auto-save after the tool run
public void initAutoSave() throws ConfigException{
if (autoSaveString==null) return;
autoSave=findParam(autoSaveString);
if(autoSave == null) {
throw new ConfigException("Parameter autoSave='" + autoSaveString +
"' used for tool '" + name +
"' is absent");
} else if(!(autoSave.getType() instanceof ParamTypeBool)) {
throw new ConfigException("Parameter autoSave='" + autoSaveString +
"' defined in "+result.getSourceXML()+" used for tool '" + name +
"' must be of type '" + ParamTypeBool.NAME +
"'");
}
}
public boolean getAutoSave(){
if (autoSave==null) return false;
List<String>result=autoSave.getValue();
if (!result.isEmpty()) return result.get(0).equals("true");
return false;
}
public List<String> getResultNames(){ public List<String> getResultNames(){
if (result==null) return null; if (result==null) return null;
return result.getValue(); return result.getValue();
...@@ -428,30 +528,63 @@ System.out.println("Tool "+getName()+" FINISHED - add more stuff here"); ...@@ -428,30 +528,63 @@ System.out.println("Tool "+getName()+" FINISHED - add more stuff here");
public void initRestore() throws ConfigException{ public void initRestore() throws ConfigException{
if (restoreString==null) return; if (restoreString==null) return;
restore=config.getContextManager().findTool(restoreString); restoreTool=config.getContextManager().findTool(restoreString);
if (restore == null) { if (restoreTool == null) {
throw new ConfigException("Restore tool '" + restoreString + throw new ConfigException("Restore tool '" + restoreString +
"' of tool '" + name + "' of tool '" + name +
"' is absent"); "' is absent");
} }
if (restore.restoreMaster!=null){ // verify they have the same result if (restoreTool.restoreMaster!=null){ // verify they have the same result
throw new ConfigException("Same restore tool ("+restore.getName()+") for multiple master tools: " + throw new ConfigException("Same restore tool ("+restoreTool.getName()+") for multiple master tools: " +
restore.restoreMaster.getName() + " and "+this.getName()+" - restore tools should differ."); restoreTool.restoreMaster.getName() + " and "+this.getName()+" - restore tools should differ.");
} }
if (resultString==null){ if (resultString==null){
throw new ConfigException("Tool "+getName()+" has restore='"+restore.getName()+ throw new ConfigException("Tool "+getName()+" has restore='"+restoreTool.getName()+
"' defined, but does not have the result attribute."); "' defined, but does not have the result attribute.");
} }
//restoreMaster //restoreMaster
restore.restoreMaster=this; restoreTool.restoreMaster=this;
} }
public Tool getRestore(){ public Tool getRestore(){
return restore; return restoreTool;
} }
public Tool getRestoreMaster(){ public Tool getRestoreMaster(){
return restoreMaster; return restoreMaster;
} }
public void initSave() throws ConfigException{
if (saveString==null) return;
saveTool=config.getContextManager().findTool(saveString);
if (saveTool == null) {
throw new ConfigException("Save tool '" + saveString +
"' of tool '" + name +
"' is absent");
}
if (saveTool.saveMaster!=null){ // verify they have the same result
throw new ConfigException("Same save tool ("+saveTool.getName()+") for multiple master tools: " +
saveTool.saveMaster.getName() + " and "+this.getName()+" - save tools should differ.");
}
if (resultString==null){
throw new ConfigException("Tool "+getName()+" has save='"+saveTool.getName()+
"' defined, but does not have the result attribute.");
}
//saveMaster
saveTool.saveMaster=this;
}
public Tool getSave(){
return saveTool;
}
public Tool getSaveMaster(){
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE)) {
System.out.println("getSaveMaster("+name+")-> "+((saveMaster==null)?"null":"NOT null"));
}
return saveMaster;
}
public void initLogDir() throws ConfigException{ public void initLogDir() throws ConfigException{
if (logDirString==null) return; if (logDirString==null) return;
logDir=findParam(logDirString); logDir=findParam(logDirString);
...@@ -500,30 +633,51 @@ System.out.println("Tool "+getName()+" FINISHED - add more stuff here"); ...@@ -500,30 +633,51 @@ System.out.println("Tool "+getName()+" FINISHED - add more stuff here");
} }
} }
} }
public String getLogDir() {return getLogDir(true); }
public String getLogDir() { public String getLogDir(boolean first) {
if (logDir==null) return null; if (logDir!=null) { // has logDir specified, but may be empty
List<String> value=logDir.getValue(); List<String> value=logDir.getValue();
if (value.size()==0) return null; if (value.size()==0) return null; // overwrites with empty
return value.get(0); return value.get(0);
} }
if (!first) return null ; // prevent loops
if (restoreMaster != null) return restoreMaster.getLogDir(false);
if (saveMaster != null) return saveMaster.getLogDir(false);
return null;
}
public String getStateDir() { public String getStateDir() {return getStateDir(true); }
if (stateDir==null) return null; public String getStateDir(boolean first) {
if (stateDir!=null) { // has stateDir specified, but may be empty
List<String> value=stateDir.getValue(); List<String> value=stateDir.getValue();
if (value.size()==0) return null; if (value.size()==0) return null; // overwrites with empty
return value.get(0); return value.get(0);
} }
if (!first) return null ; // prevent loops
public void setResultFile(String filename){ if (restoreMaster != null) return restoreMaster.getStateDir(false);
resultFile=filename; if (saveMaster != null) return saveMaster.getStateDir(false);
return null;
} }
public String getStateFile(){
public String getStateFile() {return getStateFile(true); }
public String getStateFile(boolean first) {
if (resultFile!=null) return resultFile; if (resultFile!=null) return resultFile;
List<String> names= getResultNames(); List<String> names= getResultNames();
if ((names==null) || (names.size()==0)) return null; if (names!=null) {
if (names.size()==0) return null;
return ToolLogFile.insertTimeStamp(names.get(0),SelectedResourceManager.getDefault().getBuildStamp()); return ToolLogFile.insertTimeStamp(names.get(0),SelectedResourceManager.getDefault().getBuildStamp());
} }
if (!first) return null ; // prevent loops
if (restoreMaster != null) return restoreMaster.getStateFile(false);
if (saveMaster != null) return saveMaster.getStateFile(false);
return null;
}
public void setResultFile(String filename){
resultFile=filename;
}
public String getResultName(){ public String getResultName(){
List<String> names= getResultNames(); List<String> names= getResultNames();
......
...@@ -25,8 +25,11 @@ import org.eclipse.core.runtime.CoreException; ...@@ -25,8 +25,11 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Display;
import com.elphel.vdt.Txt;
import com.elphel.vdt.core.launching.LaunchCore;
import com.elphel.vdt.core.launching.ToolLogFile; import com.elphel.vdt.core.launching.ToolLogFile;
import com.elphel.vdt.core.tools.ToolsCore; import com.elphel.vdt.core.tools.ToolsCore;
import com.elphel.vdt.core.tools.params.Tool.TOOL_MODE;
import com.elphel.vdt.core.tools.params.Tool.TOOL_STATE; import com.elphel.vdt.core.tools.params.Tool.TOOL_STATE;
import com.elphel.vdt.ui.MessageUI; import com.elphel.vdt.ui.MessageUI;
import com.elphel.vdt.ui.options.FilteredFileSelector; import com.elphel.vdt.ui.options.FilteredFileSelector;
...@@ -53,7 +56,8 @@ public class ToolSequence { ...@@ -53,7 +56,8 @@ public class ToolSequence {
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE)) if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE))
System.out.println("\nTool "+tool.getName()+" FINISHED - add more stuff here"); System.out.println("\nTool "+tool.getName()+" FINISHED - add more stuff here");
if (tool.getState()==TOOL_STATE.SUCCESS){ if (tool.getState()==TOOL_STATE.SUCCESS){
updateLinkLatest(tool); if (tryAutoSave(tool)) return; // started autoSave that will trigger "toolFinished" again
updateLinkLatest(tool); // TODO - maybe swap and do updateLinkLatest before tryAutoSave
} else if (tool.getState()==TOOL_STATE.KEPT_OPEN){ } else if (tool.getState()==TOOL_STATE.KEPT_OPEN){
} else { } else {
...@@ -67,9 +71,54 @@ public class ToolSequence { ...@@ -67,9 +71,54 @@ public class ToolSequence {
}); });
} }
} }
private boolean tryAutoSave(Tool tool){
if (
(tool.getSave()!=null) &&
tool.getAutoSave() &&
(designFlowView!=null) &&
(tool.getLastMode()==TOOL_MODE.RUN)) { // it was not playback of logs
final Tool fTool=tool.getSave();
final IProject fProject = SelectedResourceManager.getDefault().getSelectedProject();
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE)) {
System.out.println("Launching autosave tool "+fTool.getName()+" for "+tool.getName());
}
fTool.setDesignFlowView(designFlowView); // maybe will not be needed with ToolSequencing class
// fTool.setRunning(true);
fTool.setMode(TOOL_MODE.SAVE);
// fTool.toolFinished();
fTool.setChoice(0);
// SelectedResourceManager.getDefault().updateActionChoice(fullPath, choice, ignoreFilter); // A
// SelectedResourceManager.getDefault().setBuildStamp(); // Use the same from Master
// apply designFlowView to the tool itself
Display.getDefault().asyncExec(new Runnable() {
public void run() {
try {
LaunchCore.launch( fTool,
fProject,
null, //fullPath,
null); // run, not playback
} catch (CoreException e1) {
MessageUI.error( Txt.s("Action.ToolLaunch.Error",
new String[] {"Autosave by "+fTool.getName(), e1.getMessage()})
, e1);
}
}
});
return true;
} else if (tool.getSaveMaster()!=null){
// tool.getSaveMaster().setRunning(false); // turn off the master tool that invoked this save one (may be called directly too)
tool.getSaveMaster().setMode(TOOL_MODE.STOP);
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE)) {
System.out.println("Finished autosave tool "+tool.getName()+" for "+tool.getSaveMaster().getName());
}
}
return false;
}
// Result file may be skipped, in that case link should not be updated, but the console state should be // Result file may be skipped, in that case link should not be updated, but the console state should be
private void updateLinkLatest(Tool tool){ private void updateLinkLatest(Tool tool){
if (tool.getLastMode()==TOOL_MODE.PLAYBACK) return; // do nothing here
String stateDirString=tool.getStateDir(); String stateDirString=tool.getStateDir();
String linkString=tool.getResultName(); String linkString=tool.getResultName();
String targetString=tool.getStateFile(); // With timestamp or specifically set through selection String targetString=tool.getStateFile(); // With timestamp or specifically set through selection
...@@ -143,15 +192,11 @@ public class ToolSequence { ...@@ -143,15 +192,11 @@ public class ToolSequence {
for(Iterator<Tool> iter = sessionList.iterator(); iter.hasNext();) { for(Iterator<Tool> iter = sessionList.iterator(); iter.hasNext();) {
Tool consoleTool=iter.next(); Tool consoleTool=iter.next();
consoleTool.setOpenState(targetString); consoleTool.setOpenState(targetString);
consoleTool.setOpenTool(tool);
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE)) if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_TOOL_SEQUENCE))
System.out.println("Set openState of "+consoleTool.getName()+" to "+targetString); System.out.println("Set openState of "+consoleTool.getName()+" to "+targetString);
} }
} }
/*
public String getOpenState() { return openState; }
public void setOpenState(String stateName) { openState=stateName;}
*/
return true; return true;
} }
public String getSelectedStateFile(Tool tool, boolean select){ public String getSelectedStateFile(Tool tool, boolean select){
......
...@@ -52,6 +52,7 @@ import com.elphel.vdt.core.tools.ToolsCore; ...@@ -52,6 +52,7 @@ import com.elphel.vdt.core.tools.ToolsCore;
import com.elphel.vdt.core.tools.contexts.Context; import com.elphel.vdt.core.tools.contexts.Context;
import com.elphel.vdt.core.tools.menu.DesignMenu; import com.elphel.vdt.core.tools.menu.DesignMenu;
import com.elphel.vdt.core.tools.params.Tool; import com.elphel.vdt.core.tools.params.Tool;
import com.elphel.vdt.core.tools.params.Tool.TOOL_MODE;
import com.elphel.vdt.core.tools.params.Tool.TOOL_STATE; import com.elphel.vdt.core.tools.params.Tool.TOOL_STATE;
import com.elphel.vdt.core.tools.params.ToolSequence; import com.elphel.vdt.core.tools.params.ToolSequence;
import com.elphel.vdt.core.tools.params.types.RunFor; import com.elphel.vdt.core.tools.params.types.RunFor;
...@@ -644,8 +645,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener { ...@@ -644,8 +645,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
try { try {
launchTool( launchTool(
fTool, // tool, will get fTool, // tool, will get
fDesignFlowView, // to be able to launch update when build state of the tool changes // fDesignFlowView, // to be able to launch update when build state of the tool changes
// selectedItem, // is it needed?
finalI, finalI,
fFullPath, fFullPath,
fIgnoreFilter); fIgnoreFilter);
...@@ -697,7 +697,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener { ...@@ -697,7 +697,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
try { try {
launchTool( launchTool(
restoreTool, restoreTool,
fDesignFlowView, // to be able to launch update when build state of the tool changes // fDesignFlowView, // to be able to launch update when build state of the tool changes
0, 0,
fFullPath, fFullPath,
fIgnoreFilter); fIgnoreFilter);
...@@ -727,7 +727,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener { ...@@ -727,7 +727,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
try { try {
launchTool( launchTool(
restoreTool, restoreTool,
fDesignFlowView, // to be able to launch update when build state of the tool changes // fDesignFlowView, // to be able to launch update when build state of the tool changes
0, 0,
fFullPath, fFullPath,
fIgnoreFilter); fIgnoreFilter);
...@@ -828,15 +828,14 @@ public class DesignFlowView extends ViewPart implements ISelectionListener { ...@@ -828,15 +828,14 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
private void launchTool( private void launchTool(
Tool tool, Tool tool,
final DesignFlowView designFlowView, // final DesignFlowView designFlowView,
// DesignMenuModel.Item item,
int choice, int choice,
String fullPath, String fullPath,
String ignoreFilter) throws CoreException { String ignoreFilter) throws CoreException {
// if (tool==null) tool = selectedItem.getTool();
if (tool != null) { if (tool != null) {
tool.setDesignFlowView(designFlowView); // tool.setDesignFlowView(designFlowView);
tool.setRunning(true); tool.setDesignFlowView(this); // maybe will not be needed with ToolSequencing class
tool.setMode(TOOL_MODE.RUN);
tool.toolFinished(); tool.toolFinished();
tool.setChoice(0); tool.setChoice(0);
SelectedResourceManager.getDefault().updateActionChoice(fullPath, choice, ignoreFilter); // Andrey SelectedResourceManager.getDefault().updateActionChoice(fullPath, choice, ignoreFilter); // Andrey
...@@ -844,7 +843,6 @@ public class DesignFlowView extends ViewPart implements ISelectionListener { ...@@ -844,7 +843,6 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
// apply designFlowView to the tool itself // apply designFlowView to the tool itself
LaunchCore.launch( tool, LaunchCore.launch( tool,
selectedResource.getProject(), selectedResource.getProject(),
// , selectedResource.getFullPath().toString() );
fullPath, fullPath,
null); // run, not playback null); // run, not playback
...@@ -871,7 +869,8 @@ public class DesignFlowView extends ViewPart implements ISelectionListener { ...@@ -871,7 +869,8 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
System.out.println("logBuildStamp="+logBuildStamp); System.out.println("logBuildStamp="+logBuildStamp);
} }
tool.setDesignFlowView(designFlowView); tool.setDesignFlowView(designFlowView);
tool.setRunning(true); // tool.setRunning(true);
tool.setMode(TOOL_MODE.PLAYBACK);
tool.toolFinished(); tool.toolFinished();
tool.setChoice(0); tool.setChoice(0);
SelectedResourceManager.getDefault().updateActionChoice(fullPath, 0, ignoreFilter); // Andrey SelectedResourceManager.getDefault().updateActionChoice(fullPath, 0, ignoreFilter); // Andrey
......
...@@ -15,4 +15,80 @@ ...@@ -15,4 +15,80 @@
<syntax name="read_xdc_syntax" format="%(read_xdc %%ParamValue%|\n%)" /> --> <syntax name="read_xdc_syntax" format="%(read_xdc %%ParamValue%|\n%)" /> -->
</interface> </interface>
<!-- Abstract tools to be inherited by instances used for various Vivado tools -->
<!-- Restore tool for Vivado -->
<tool name="RestoreVivado" label="Restore state after Vivado tool"
project="FPGA_project"
interface="VivadoInterface"
package="FPGA_package"
shell="/bin/bash"
abstract="true">
<output>
<line name="vivado_pre_restore">
"-c"
<!-- Create project directory on remote server if it did not exist -->
"ssh"
"-oBatchMode=yes"
"-l %RemoteUser %RemoteHost"
"'"
"mkdir -p"
"%VivadoProjectRoot"
"' ;"
<!-- Copy snapshot generated after synthesis from local to remote -->
"rsync -avrR -e ssh"
<!-- from: -->
"%VivadoLocalDir/%%StateFile"
<!-- to: -->
"%RemoteUser@%RemoteHost:%VivadoProjectRoot"
";"
</line>
<line name="vivado_restore"
dest="VivadoConsole"
mark="``"
sep=""
failure="ERROR"
prompt="@@FINISH@@"
log="">
"cd ~/%VivadoProjectRoot\n"
"set outputDir ~/%VivadoProjectRoot/build\n"
"file mkdir $outputDir\n"
"open_checkpoint %%StateFile\n"
"puts \"@@FINISH@@\"\n"
</line>
</output>
</tool>
<!-- Save tool for Vivado tool -->
<tool name="SaveVivado"
label="SaveVivado"
project="FPGA_project"
interface="VivadoInterface"
package="FPGA_package"
shell="/bin/bash"
abstract="true">
<output>
<line name="vivado_save"
dest="VivadoConsole"
mark="``"
sep=""
prompt="@@FINISH@@"
failure="ERROR"
log="">
"cd ~/%VivadoProjectRoot\n"
"set outputDir ~/%VivadoProjectRoot/build\n"
"file mkdir $outputDir\n"
"write_checkpoint -force %%StateFile\n"
"puts \"@@FINISH@@\"\n"
</line>
<line name="vivado_copy_after_save">
"-c"
"mkdir -p %VivadoLocalDir ;"
"rsync -avr -e ssh"
"%RemoteUser@%RemoteHost:%VivadoProjectRoot/%%StateFile"
"%%StateDir/"
</line>
</output>
</tool>
</vdt-project> </vdt-project>
...@@ -59,6 +59,9 @@ ...@@ -59,6 +59,9 @@
state-dir="VivadoLocalDir" state-dir="VivadoLocalDir"
restore="RestoreVivadoOptPlace" restore="RestoreVivadoOptPlace"
disable="DisableVivadoOptPlace" disable="DisableVivadoOptPlace"
autosave="AutosaveVivadoOptPlace"
save="SaveVivadoOptPlace"
> >
<action-menu> <action-menu>
<action label="Optimize and Place" resource="" icon="mondrian2x2.png" /> <action label="Optimize and Place" resource="" icon="mondrian2x2.png" />
...@@ -211,6 +214,10 @@ ...@@ -211,6 +214,10 @@
<!-- not really used now, always "0" --> <!-- not really used now, always "0" -->
<parameter id="VivadoOptPlaceActionIndex" default="%%ChosenActionIndex" <parameter id="VivadoOptPlaceActionIndex" default="%%ChosenActionIndex"
type="String" format="CopyValue" visible="false" /> type="String" format="CopyValue" visible="false" />
<!-- invisible/calculated parameters -->
<parameter id="AutosaveVivadoOptPlace" default="?%%ChosenActionIndex=0 ^ %SkipSnapshotSynth=false : true, false"
visible="false" type="Boolean" format="None"/>
<input> <input>
<group name="General"> <group name="General">
...@@ -372,23 +379,9 @@ ...@@ -372,23 +379,9 @@
"%quiet_phys_opt" "%quiet_phys_opt"
"%verbose_phys_opt" "%verbose_phys_opt"
"\n" "\n"
</if>
<if SkipSnapshotPlace="false">
"write_checkpoint -force %%StateFile\n"
</if> </if>
"puts \"@@FINISH@@\"\n" "puts \"@@FINISH@@\"\n"
</line> </line>
<!-- -top npmtest -part xc7k70tfbg484-2 -flatten rebuilt\n" -->
<if-and SkipSnapshotPlace="false"
VivadoOptPlaceActionIndex="0">
<line name="vivado_copy_after_opt_place">
"-c"
"mkdir -p %VivadoLocalDir ;"
"rsync -avr -e ssh"
"%RemoteUser@%RemoteHost:%VivadoProjectRoot/%%StateFile"
"%%StateDir/"
</line>
</if-and>
<line name="parser_VivadoOpt" <line name="parser_VivadoOpt"
errors= "PatternErrors" errors= "PatternErrors"
warnings= "PatternWarnings" warnings= "PatternWarnings"
...@@ -416,52 +409,18 @@ ...@@ -416,52 +409,18 @@
</output> </output>
</tool> </tool>
<!-- Restore tool for VivadoOptPlace -->
<tool name="RestoreVivadoOptPlace"
project="FPGA_project"
interface="VivadoInterface"
package="FPGA_package"
inherits="RestoreVivado"/>
<!-- Save tool for VivadoOptPlace -->
<tool name="RestoreVivadoOptPlace" label="Restore state after Vivado OptPlace" <tool name="SaveVivadoOptPlace"
project="FPGA_project" project="FPGA_project"
interface="VivadoOptPlaceInterface" interface="VivadoInterface"
package="FPGA_package" package="FPGA_package"
shell="/bin/bash" inherits="SaveVivado"/>
ignore="%VivadoIgnoreSource"
description="Restore Vivado OptPlace"
log-dir="VivadoLogDir"
state-dir="VivadoLocalDir"
>
<output>
<line name="vivado_pre_restore_opt_place">
"-c"
<!-- Create project directory on remote server if it did not exist -->
"ssh"
"-oBatchMode=yes"
"-l %RemoteUser %RemoteHost"
"'"
"mkdir -p"
"%VivadoProjectRoot"
"' ;"
<!-- Copy snapshot generated after opt/place from local to remote -->
"rsync -avrR -e ssh"
<!-- from: -->
"%VivadoLocalDir/%%StateFile"
<!-- to: -->
"%RemoteUser@%RemoteHost:%VivadoProjectRoot"
";"
</line>
<!-- success="phys_opt_design completed successfully" -->
<line name="vivado_restore_synthesis"
dest="VivadoConsole"
mark="``"
sep=""
failure="ERROR"
prompt="@@FINISH@@"
log="">
"cd ~/%VivadoProjectRoot\n"
"set outputDir ~/%VivadoProjectRoot/build\n"
"file mkdir $outputDir\n"
<!-- Start fresh from the loaded checkpoint -->
"open_checkpoint %%StateFile\n"
"puts \"@@FINISH@@\"\n"
</line>
</output>
</tool>
</vdt-project> </vdt-project>
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
state-dir="VivadoLocalDir" state-dir="VivadoLocalDir"
restore="RestoreVivadoRoute" restore="RestoreVivadoRoute"
disable="DisableVivadoRoute" disable="DisableVivadoRoute"
autosave="AutosaveVivadoRoute"
save="SaveVivadoRoute"
> >
<action-menu> <action-menu>
<action label="Route" resource="" icon="route66.png" /> <action label="Route" resource="" icon="route66.png" />
...@@ -131,6 +133,8 @@ ...@@ -131,6 +133,8 @@
<parameter id="OtherProblems" label="Other problems" tooltip= "Other problem patterns (after opening '[') to be suppressed)" <parameter id="OtherProblems" label="Other problems" tooltip= "Other problem patterns (after opening '[') to be suppressed)"
default="" visible="true" omit="" type="Stringlist" format="GrepFilterProblemOtherSyntax"/> default="" visible="true" omit="" type="Stringlist" format="GrepFilterProblemOtherSyntax"/>
<parameter id="AutosaveVivadoRoute" default="?%%ChosenActionIndex=0 ^ %SkipSnapshotSynth=false : true, false"
visible="false" type="Boolean" format="None"/>
<!-- hidden (calculated) parameters --> <!-- hidden (calculated) parameters -->
<!-- not really used now, always "0" --> <!-- not really used now, always "0" -->
...@@ -227,22 +231,8 @@ ...@@ -227,22 +231,8 @@
"%quiet_route" "%quiet_route"
"%verbose_route" "%verbose_route"
"\n" "\n"
<if SkipSnapshotRoute="false">
"write_checkpoint -force %SnapshotRoute\n"
</if>
"puts \"@@FINISH@@\"\n" "puts \"@@FINISH@@\"\n"
</line> </line>
<!-- -top npmtest -part xc7k70tfbg484-2 -flatten rebuilt\n" -->
<if-and SkipSnapshotRoute="false"
VivadoRouteActionIndex="0">
<line name="vivado_copy_after_route">
"-c"
"mkdir -p %VivadoLocalDir ;"
"rsync -avr -e ssh"
"%RemoteUser@%RemoteHost:%VivadoProjectRoot/%SnapshotRoute"
"%VivadoLocalDir/"
</line>
</if-and>
<line name="parser_VivadoRoute" <line name="parser_VivadoRoute"
errors= "PatternErrors" errors= "PatternErrors"
warnings= "PatternWarnings" warnings= "PatternWarnings"
...@@ -271,50 +261,18 @@ ...@@ -271,50 +261,18 @@
</line> </line>
</output> </output>
</tool> </tool>
<tool name="RestoreVivadoRoute" label="Restore state after Vivado Route"
<!-- Restore tool for VivadoRoute -->
<tool name="RestoreVivadoRoute"
project="FPGA_project" project="FPGA_project"
interface="VivadoRouteInterface" interface="VivadoInterface"
package="FPGA_package" package="FPGA_package"
shell="/bin/bash" inherits="RestoreVivado"/>
ignore="%VivadoIgnoreSource" <!-- Save tool for VivadoRoute -->
description="Restore Vivado Routing"
log-dir="VivadoLogDir" <tool name="SaveVivadoRoute"
state-dir="VivadoLocalDir" project="FPGA_project"
> interface="VivadoInterface"
<output> package="FPGA_package"
<line name="vivado_pre_restore_route"> inherits="SaveVivado"/>
"-c"
<!-- Create project directory on remote server if it did not exist -->
"ssh"
"-oBatchMode=yes"
"-l %RemoteUser %RemoteHost"
"'"
"mkdir -p"
"%VivadoProjectRoot"
"' ;"
<!-- Copy snapshot generated after route from local to remote -->
"rsync -avrR -e ssh"
<!-- from: -->
"%VivadoLocalDir/%%StateFile"
<!-- to: -->
"%RemoteUser@%RemoteHost:%VivadoProjectRoot"
";"
</line>
<!-- success="phys_opt_design completed successfully" -->
<line name="vivado_restore_route"
dest="VivadoConsole"
mark="``"
sep=""
failure="ERROR"
prompt="@@FINISH@@"
log="">
"cd ~/%VivadoProjectRoot\n"
"set outputDir ~/%VivadoProjectRoot/build\n"
"file mkdir $outputDir\n"
<!-- Start fresh from the loaded checkpoint -->
"open_checkpoint %%StateFile\n"
"puts \"@@FINISH@@\"\n"
</line>
</output>
</tool>
</vdt-project> </vdt-project>
...@@ -61,7 +61,8 @@ ...@@ -61,7 +61,8 @@
state-dir="VivadoLocalDir" state-dir="VivadoLocalDir"
restore="RestoreVivadoSynthesis" restore="RestoreVivadoSynthesis"
disable="DisableVivadoSynth" disable="DisableVivadoSynth"
> autosave="AutosaveVivadoSynthesis"
save="SaveVivadoSynthesis" >
<extensions-list> <extensions-list>
<extension mask="v" /> <extension mask="v" />
...@@ -186,6 +187,11 @@ ...@@ -186,6 +187,11 @@
<parameter id="OtherProblems" label="Other problems" tooltip= "Other problem patterns (after opening '[') to be suppressed)" <parameter id="OtherProblems" label="Other problems" tooltip= "Other problem patterns (after opening '[') to be suppressed)"
default="" visible="true" omit="" type="Stringlist" format="GrepFilterProblemOtherSyntax"/> default="" visible="true" omit="" type="Stringlist" format="GrepFilterProblemOtherSyntax"/>
<!-- invisible/calculated parameters -->
<parameter id="AutosaveVivadoSynthesis" default="?%%ChosenActionIndex=0 ^ %SkipSnapshotSynth=false : true, false"
visible="false" type="Boolean" format="None"/>
<input> <input>
<group name="General"> <group name="General">
"ConstraintsFiles" "ConstraintsFiles"
...@@ -308,28 +314,8 @@ ...@@ -308,28 +314,8 @@
"%quiet" "%quiet"
"%verbose" "%verbose"
"\n" "\n"
<if-and SkipSnapshotSynth="false"
VivadoSynthActionIndex="0">
<!-- "write_checkpoint -force %SnapshotSynth\n" -->
"write_checkpoint -force %%StateFile\n"
</if-and>
"puts \"@@FINISH@@\"\n" "puts \"@@FINISH@@\"\n"
</line> </line>
<!-- -top npmtest -part xc7k70tfbg484-2 -flatten rebuilt\n" -->
<if-and SkipSnapshotSynth="false"
VivadoSynthActionIndex="0">
<line name="vivado_copy_after_synth">
"-c"
"mkdir -p %VivadoLocalDir ;"
"rsync -avr -e ssh"
<!-- "%RemoteUser@%RemoteHost:%VivadoProjectRoot/%SnapshotSynth"
"%VivadoLocalDir/" -->
"%RemoteUser@%RemoteHost:%VivadoProjectRoot/%%StateFile"
"%%StateDir/"
</line>
</if-and>
<!-- errors=".*[ERROR|CRITICAL WARNING]: (\[.*\].*)\[(.*):([0-9]+)\]"
-->
<line name="parser_VivadoSynth" <line name="parser_VivadoSynth"
errors= "PatternErrors" errors= "PatternErrors"
warnings= "PatternWarnings" warnings= "PatternWarnings"
...@@ -355,50 +341,18 @@ ...@@ -355,50 +341,18 @@
</line> </line>
</output> </output>
</tool> </tool>
<tool name="RestoreVivadoSynthesis" label="Restore state after Vivado Synthesis"
<!-- Restore tool for VivadoSynthesis -->
<tool name="RestoreVivadoSynthesis"
project="FPGA_project" project="FPGA_project"
interface="VivadoSynthesisInterface" interface="VivadoInterface"
package="FPGA_package" package="FPGA_package"
shell="/bin/bash" inherits="RestoreVivado"/>
ignore="%VivadoIgnoreSource" <!-- Save tool for VivadoSynthesis -->
description="Restore Vivado Synthesis"
log-dir="VivadoLogDir" <tool name="SaveVivadoSynthesis"
state-dir="VivadoLocalDir" project="FPGA_project"
> interface="VivadoInterface"
<output> package="FPGA_package"
<line name="vivado_pre_restore_synthesis"> inherits="SaveVivado"/>
"-c"
<!-- Create project directory on remote server if it did not exist -->
"ssh"
"-oBatchMode=yes"
"-l %RemoteUser %RemoteHost"
"'"
"mkdir -p"
"%VivadoProjectRoot"
"' ;"
<!-- Copy snapshot generated after synthesis from local to remote -->
"rsync -avrR -e ssh"
<!-- from: -->
"%VivadoLocalDir/%%StateFile"
<!-- to: -->
"%RemoteUser@%RemoteHost:%VivadoProjectRoot"
";"
</line>
<!-- success="phys_opt_design completed successfully" -->
<line name="vivado_restore_synthesis"
dest="VivadoConsole"
mark="``"
sep=""
failure="ERROR"
prompt="@@FINISH@@"
log="">
"cd ~/%VivadoProjectRoot\n"
"set outputDir ~/%VivadoProjectRoot/build\n"
"file mkdir $outputDir\n"
<!-- Start fresh from the loaded checkpoint -->
"open_checkpoint %%StateFile\n"
"puts \"@@FINISH@@\"\n"
</line>
</output>
</tool>
</vdt-project> </vdt-project>
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