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,11 +336,10 @@ public class VDTRunner { ...@@ -331,11 +336,10 @@ 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,
......
...@@ -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;
...@@ -635,13 +639,25 @@ public class XMLConfig extends Config { ...@@ -635,13 +639,25 @@ public class XMLConfig extends Config {
String disabled = getAttributeValue(contextNode, CONTEXT_TOOL_DISABLED); String disabled = getAttributeValue(contextNode, CONTEXT_TOOL_DISABLED);
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="";
...@@ -659,7 +675,7 @@ public class XMLConfig extends Config { ...@@ -659,7 +675,7 @@ public class XMLConfig extends Config {
System.out.println("got toolRunfor.size()="+toolRunfor.size()); System.out.println("got toolRunfor.size()="+toolRunfor.size());
} }
} }
context = new Tool(contextName, context = new Tool(contextName,
contextInterfaceName, contextInterfaceName,
contextLabel, contextLabel,
...@@ -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();) {
......
...@@ -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,32 +828,30 @@ public class DesignFlowView extends ViewPart implements ISelectionListener { ...@@ -828,32 +828,30 @@ 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.setDesignFlowView(this); // maybe will not be needed with ToolSequencing class
tool.setRunning(true); 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
SelectedResourceManager.getDefault().setBuildStamp(); // Andrey SelectedResourceManager.getDefault().setBuildStamp(); // Andrey
// 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
} else if (selectedItem.hasChildren()) { } else if (selectedItem.hasChildren()) {
if (viewer.getExpandedState(selectedItem)) if (viewer.getExpandedState(selectedItem))
viewer.collapseToLevel(selectedItem, AbstractTreeViewer.ALL_LEVELS); viewer.collapseToLevel(selectedItem, AbstractTreeViewer.ALL_LEVELS);
else else
viewer.expandToLevel(selectedItem, 1); viewer.expandToLevel(selectedItem, 1);
} }
} // launchTool() } // launchTool()
...@@ -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" label="Restore state after Vivado OptPlace" <tool name="RestoreVivadoOptPlace"
project="FPGA_project" project="FPGA_project"
interface="VivadoOptPlaceInterface" interface="VivadoInterface"
package="FPGA_package" package="FPGA_package"
shell="/bin/bash" inherits="RestoreVivado"/>
ignore="%VivadoIgnoreSource" <!-- Save tool for VivadoOptPlace -->
description="Restore Vivado OptPlace"
log-dir="VivadoLogDir" <tool name="SaveVivadoOptPlace"
state-dir="VivadoLocalDir" project="FPGA_project"
> interface="VivadoInterface"
<output> package="FPGA_package"
<line name="vivado_pre_restore_opt_place"> 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 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"
project="FPGA_project" <!-- Restore tool for VivadoRoute -->
interface="VivadoRouteInterface" <tool name="RestoreVivadoRoute"
project="FPGA_project"
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" />
...@@ -185,6 +186,11 @@ ...@@ -185,6 +186,11 @@
default="true" visible="true" omit="true" type="Boolean" format="GrepFilterProblemSyntax"/> default="true" visible="true" omit="true" type="Boolean" format="GrepFilterProblemSyntax"/>
<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">
...@@ -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"
project="FPGA_project" <!-- Restore tool for VivadoSynthesis -->
interface="VivadoSynthesisInterface" <tool name="RestoreVivadoSynthesis"
project="FPGA_project"
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