Commit 2ce74392 authored by Andrey Filippov's avatar Andrey Filippov

Added Vivado launching, some cleanup of the code

parent 9d3c3811
......@@ -17,68 +17,14 @@
package com.elphel.vdt.core.launching;
import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.eclipse.debug.internal.ui.views.console.ProcessConsole;
//import org.eclipse.core.resources.IProject;
//import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.IStreamListener;
//import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.model.IProcess;
//import org.eclipse.debug.ui.DebugUITools;
//import org.eclipse.ui.console.ConsolePlugin;
//import org.eclipse.ui.console.IConsoleManager;
//import org.eclipse.ui.console.IPatternMatchListener;
//import org.eclipse.ui.console.MessageConsole;
import org.eclipse.debug.core.model.IStreamMonitor;
import org.eclipse.debug.core.model.IStreamsProxy;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.ui.console.IConsole;
//import org.eclipse.debug.ui.console.IConsole;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsoleManager;
import org.eclipse.ui.console.IOConsole;
import org.eclipse.ui.console.IOConsoleInputStream;
import org.eclipse.ui.console.IOConsoleOutputStream;
import com.elphel.vdt.Txt;
import com.elphel.vdt.core.tools.contexts.BuildParamsItem;
import com.elphel.vdt.ui.MessageUI;
//import com.elphel.vdt.VDTPlugin;
import com.elphel.vdt.veditor.VerilogPlugin;
import com.elphel.vdt.veditor.parser.OutlineContainer;
import com.elphel.vdt.veditor.preference.PreferenceStrings;
//import com.elphel.vdt.core.Utils;
import org.eclipse.ui.console.IConsoleListener;
public class RunningBuilds {
......@@ -87,19 +33,25 @@ public class RunningBuilds {
public RunningBuilds(){
unfinishedBuilds = new ConcurrentHashMap<String, VDTRunnerConfiguration>();
IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
// This is not used, just for testing
System.out.println("***Addded console listeners");
// This is not used, just for testing
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println("***Addded console listeners");
}
manager.addConsoleListener(new IConsoleListener(){
public void consolesAdded(IConsole[] consoles){
for (int i=0;i<consoles.length;i++){
System.out.println("+++ Added: "+consoles[i].getName());
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println("+++ Added: "+consoles[i].getName());
}
// Only shows added consoles
}
}
public void consolesRemoved(IConsole[] consoles){
for (int i=0;i<consoles.length;i++){
System.out.println("--- Removed: "+consoles[i].getName());
// unfinishedBuilds.remove(consoles[i]);
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println("--- Removed: "+consoles[i].getName());
}
// unfinishedBuilds.remove(consoles[i]);
removeConsole(consoles[i]);
}
}
......@@ -108,16 +60,24 @@ public class RunningBuilds {
public String findConsoleParent(IConsole console){
Iterator<String> iter=unfinishedBuilds.keySet().iterator();
System.out.println("findConsoleParent("+console.getName()+")");
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println("findConsoleParent("+console.getName()+")");
}
while (iter.hasNext()) {
String consoleName=iter.next();
System.out.print("Got console name:"+consoleName);
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.print("Got console name:"+consoleName);
}
VDTRunnerConfiguration runConfig=unfinishedBuilds.get(consoleName);
if (runConfig.hasConsole(console)){
System.out.println(consoleName+" -> GOT IT");
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println(consoleName+" -> GOT IT");
}
return consoleName;
}
System.out.println(consoleName+" -> no luck");
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println(consoleName+" -> no luck");
}
}
return null;
}
......@@ -126,13 +86,19 @@ public class RunningBuilds {
if (consoleName!=null){
VDTRunnerConfiguration runConfig=unfinishedBuilds.get(consoleName);
runConfig.removeConsole(console);
System.out.println("Removing console "+console.getName()+" from runConfig for "+consoleName);
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println("Removing console "+console.getName()+" from runConfig for "+consoleName);
}
if (runConfig.noConsoles()){
System.out.println("No consoles left in unfinished "+consoleName+" - removing it too");
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println("No consoles left in unfinished "+consoleName+" - removing it too");
}
unfinishedBuilds.remove(consoleName);
}
} else {
System.out.println("Console "+console.getName()+" did not belong here");
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println("Console "+console.getName()+" did not belong here");
}
}
}
public boolean isUnfinished(IConsole console){
......
......@@ -54,35 +54,20 @@ import com.elphel.vdt.veditor.preference.PreferenceStrings;
import com.sun.net.ssl.internal.www.protocol.https.Handler;
public class VDTConsoleRunner{
private final VDTRunnerConfiguration runConfig;
private IProcess processErr=null;
private IProcess processOut=null;
private IStreamsProxy stdoutStreamProxy=null;
private IStreamsProxy stderrStreamProxy=null;
private final VDTRunnerConfiguration runConfig; //*
private IProcess processErr=null; //*
private IProcess processOut=null; //*
private IStreamsProxy sendErrorsToStreamProxy=null;
private Object errorListener=null; //+
private Object outputListener=null; //+
private IOConsole iCons=null;
private IProcess process=null;
private IStreamsProxy consoleInStreamProxy= null;
private IStreamsProxy consoleInStreamProxy= null; //+
private Timer timer;
public VDTConsoleRunner (VDTRunnerConfiguration runConfig){
this.runConfig=runConfig;
}
/*
* private BuildParamsItem getParser( String parserName){
if (parserName==null) return null;
BuildParamsItem[] buildParamsItems = runConfig.getArgumentsItemsArray(); // uses already calculated
if (buildParamsItems==null) return null;
for (int i=0;i<buildParamsItems.length;i++){
if (parserName.equals(buildParamsItems[i].getNameAsParser()))
return buildParamsItems[i];
}
return null;
}
*/
private int getParserIndex( String parserName){
if (parserName==null) return -1;
BuildParamsItem[] buildParamsItems = runConfig.getArgumentsItemsArray(); // uses already calculated
......@@ -99,6 +84,8 @@ public class VDTConsoleRunner{
, ILaunch launch
, IProgressMonitor monitor
) throws CoreException{
final boolean debugPrint=VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING);
VDTRunner runner = VDTLaunchUtil.getRunner();
int numItem=runConfig.getBuildStep();
BuildParamsItem buildParamsItem = runConfig.getArgumentsItemsArray()[numItem]; // uses already calculated
......@@ -106,8 +93,7 @@ public class VDTConsoleRunner{
// Find console with name starting with consolePrefix
IConsoleManager man = ConsolePlugin.getDefault().getConsoleManager(); // debugging
IConsole[] consoles=(IConsole[]) man.getConsoles();
// IOConsole iCons=null;
iCons=null;
IOConsole iCons=null;
consoleInStreamProxy=null;
for (int i=0;i<consoles.length;i++){
if (consoles[i].getName().startsWith(consolePrefix)){
......@@ -122,7 +108,7 @@ public class VDTConsoleRunner{
// try to send
String[] arguments = runConfig.getToolArguments();
if (arguments == null) arguments=new String[0];
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
if (debugPrint) {
// System.out.println("patternErrors= \""+ runConfig.getPatternErrors()+"\"");
// System.out.println("patternWarnings= \""+runConfig.getPatternWarnings()+"\"");
// System.out.println("patternInfo= \"" +runConfig.getPatternInfo()+"\"");
......@@ -134,27 +120,21 @@ public class VDTConsoleRunner{
}
runner.log("Writing to console "+iCons.getName()+":", arguments, null, false, true); /* Appears in the console of the target Eclipse (immediately erased) */
runner.log("Writing to console "+iCons.getName()+":", arguments, null, false, false); /* Appears in the console of the parent Eclipse */
// IOConsoleInputStream inStream= iCons.getInputStream();
IOConsoleOutputStream outStream= iCons.newOutputStream();
// IProcess process=((ProcessConsole)iCons).getProcess();
process=((ProcessConsole)iCons).getProcess();
// IStreamsProxy consoleInStreamProxy= process.getStreamsProxy();
IProcess process=((ProcessConsole)iCons).getProcess();
consoleInStreamProxy= process.getStreamsProxy();
int stderrParserIndex=getParserIndex(buildParamsItem.getStderr());
int stdoutParserIndex=getParserIndex(buildParamsItem.getStdout());
BuildParamsItem stderrParser=(stderrParserIndex>=0)?runConfig.getArgumentsItemsArray()[stderrParserIndex]:null;
BuildParamsItem stdoutParser=(stdoutParserIndex>=0)?runConfig.getArgumentsItemsArray()[stdoutParserIndex]:null;
// BuildParamsItem stderrParser=getParser(buildParamsItem.getStderr()); // re-parses all - why?
// BuildParamsItem stdoutParser=getParser(buildParamsItem.getStdout());
System.out.println("Using parser for stderr: "+((stderrParser!=null)?stderrParser.getNameAsParser():"none")); // actually may be the same as stdout
System.out.println("Using parser for stdout: "+((stdoutParser!=null)?stdoutParser.getNameAsParser():"none"));
if (debugPrint) {
System.out.println("Using parser for stderr: "+((stderrParser!=null)?stderrParser.getNameAsParser():"none")); // actually may be the same as stdout
System.out.println("Using parser for stdout: "+((stdoutParser!=null)?stdoutParser.getNameAsParser():"none"));
}
processErr=null;
processOut=null;
stdoutStreamProxy=null;
stderrStreamProxy=null;
IStreamsProxy stdoutStreamProxy=null;
IStreamsProxy stderrStreamProxy=null;
if (stdoutParser!=null){
List<String> toolArgumentsStdout = new ArrayList<String>();
List<String> stdoutArguments=stdoutParser.getParamsAsList();
......@@ -168,7 +148,6 @@ public class VDTConsoleRunner{
null, //monitor
stdoutParserIndex);
stdoutStreamProxy= processOut.getStreamsProxy();
//TODO: Add error parsers
}
if (stderrParser!=null){
......@@ -197,22 +176,23 @@ public class VDTConsoleRunner{
runConfig.resetConsoleText();
String interrupt=buildParamsItem.getInterrupt(); // Not yet used
runConfig.setConsoleFinish(buildParamsItem.getPrompt());
System.out.println("Using console program termination string: \""+buildParamsItem.getPrompt()+"\"");
errorListener=null;
if (debugPrint) {
System.out.println("Using console program termination string: \""+buildParamsItem.getPrompt()+"\"");
}
errorListener=null;
if (fSendErrorsToStreamProxy!=null){
consoleErrStreamMonitor=consoleInStreamProxy.getErrorStreamMonitor();
// IStreamListener errorListener=null;
errorListener=new IStreamListener(){
public void streamAppended(String text, IStreamMonitor monitor){
// System.out.println("Err:'"+text+"'");
try {
fSendErrorsToStreamProxy.write(text);
} catch (IOException e) {
System.out.println("Can not write errors"); //happens for the last prompt got after finish marker
if (debugPrint) System.out.println("Can not write errors"); //happens for the last prompt got after finish marker
}
if (runConfig.addConsoleText(text)){
System.out.println("Got finish sequence");
if (debugPrint) System.out.println("Got finish sequence");
// TODO: launch continuation of the build process
finishConsolescript();
}
......@@ -225,14 +205,13 @@ public class VDTConsoleRunner{
consoleOutStreamMonitor=consoleInStreamProxy.getOutputStreamMonitor();
outputListener=new IStreamListener(){
public void streamAppended(String text, IStreamMonitor monitor){
// System.out.println("Out:'"+text+"'");
try {
fSendOutputToStreamProxy.write(text);
} catch (IOException e) {
System.out.println("Can not write output");
if (debugPrint) System.out.println("Can not write output");
}
if (runConfig.addConsoleText(text)){
System.out.println("Got finish sequence");
if (debugPrint) System.out.println("Got finish sequence");
// TODO: launch continuation of the build process
finishConsolescript();
}
......@@ -253,13 +232,15 @@ public class VDTConsoleRunner{
}
int timeout=buildParamsItem.getTimeout();
if ((timeout==0) && (buildParamsItem.getPrompt()==null)) timeout=1;// should specify at least one of timeout or prompt
timer=null;
if (timeout>0){
System.out.println("Setting timeout "+timeout);
if (debugPrint) System.out.println("Setting timeout "+timeout);
final int fTimeout = timeout;
new Timer().schedule(new TimerTask() {
timer=new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
System.out.println(">>Timeout<<");
if (debugPrint) System.out.println(">>Timeout<<");
finishConsolescript();
}
}, fTimeout*1000);
......@@ -271,7 +252,11 @@ public class VDTConsoleRunner{
// TODO: remove unneeded global vars
public void finishConsolescript() {
System.out.println("finishConsolescript()");
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING))
System.out.println("finishConsolescript()");
if (timer!=null){
timer.cancel();
}
if (consoleInStreamProxy==null) {
System.out.println("Bug: consoleInStreamProxy == null");
return; // or continue other commands?
......@@ -289,20 +274,19 @@ public class VDTConsoleRunner{
try {
processErr.terminate();
} catch (DebugException e) {
System.out.println("Failed to reminate processErr parser process");
System.out.println("Failed to terminate processErr parser process");
}
}
if (processOut!=null){
try {
processOut.terminate();
} catch (DebugException e) {
System.out.println("Failed to reminate processOut parser process");
System.out.println("Failed to terminate processOut parser process");
}
}
// Is that all?
// runConfig.setBuildStep(runConfig.getBuildStep()+1); // next task to run
int thisStep=runConfig.getBuildStep();
System.out.println("Finished console task, step was "+thisStep);
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING))
System.out.println("Finished console task, step was "+thisStep);
runConfig.setBuildStep(thisStep+1); // next task to run
VDTLaunchUtil.getRunner().getRunningBuilds().saveUnfinished(runConfig.getOriginalConsoleName(), runConfig );
try {
......
......@@ -42,6 +42,7 @@ import com.elphel.vdt.VDT;
import com.elphel.vdt.VerilogUtils;
// import com.elphel.vdt.VDTPlugin;
import com.elphel.vdt.veditor.VerilogPlugin;
import com.elphel.vdt.veditor.preference.PreferenceStrings;
import com.elphel.vdt.core.tools.ToolsCore;
import com.elphel.vdt.core.tools.contexts.BuildParamsItem;
import com.elphel.vdt.core.tools.params.Parameter;
......@@ -64,13 +65,17 @@ public class VDTLaunchUtil {
* Returns the VDT runner.
*/
public static VDTRunner getRunner() {
if (toolRunner == null) {
System.out.println ("Created new VDTRunner()");
toolRunner = new VDTRunner();
} else {
System.out.println ("Reused old VDTRunner()");
}
return toolRunner;
if (toolRunner == null) {
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println ("Created new VDTRunner()");
}
toolRunner = new VDTRunner();
} else {
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println ("Reused old VDTRunner()");
}
}
return toolRunner;
}
//runningBuilds
/**
......
......@@ -106,13 +106,15 @@ public class VDTRunner {
// make call it when console is closed
private void doResumeLaunch(String consoleName ) throws CoreException {
final VDTRunnerConfiguration runConfig=runningBuilds.resumeConfiguration(consoleName);
final boolean debugPrint=VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING);
if (runConfig==null){
System.out.println("Turned out nothing to do. Probably a bug");
return;
}
BuildParamsItem[] argumentsItemsArray = runConfig.getArgumentsItemsArray(); // uses already calculated
int numItem=runConfig.getBuildStep();
System.out.println("--------- resuming "+ consoleName+", numItem="+numItem+" ------------");
if (debugPrint) System.out.println("--------- resuming "+ consoleName+", numItem="+numItem+" ------------");
ILaunch launch=runConfig.getLaunch();
IProgressMonitor monitor=runConfig.getMonitor();
for (;numItem<argumentsItemsArray.length;numItem++){
......@@ -132,7 +134,7 @@ public class VDTRunner {
}
if (argumentsItemsArray[numItem].getNameAsParser()!=null){
// parsers should be launched by the console scripts, in parallel to them
System.out.println("Skipping parser "+argumentsItemsArray[numItem].getNameAsParser());
if (debugPrint) System.out.println("Skipping parser "+argumentsItemsArray[numItem].getNameAsParser());
continue;
}
// Launch the configuration - 1 unit of work
......@@ -147,8 +149,6 @@ public class VDTRunner {
);
//Andrey: if there is a single item - launch asynchronously, if more - verify queue is empty
// will not change
// String consoleName=renderProcessLabel(runConfig.getToolName());
// check for cancellation
if (monitor.isCanceled() || (process==null)) {
......@@ -163,17 +163,17 @@ public class VDTRunner {
IOConsole iCons= (IOConsole) DebugUITools.getConsole(process); // had non-null fPatternMatcher , fType="org.eclipse.debug.ui.ProcessConsoleType"
if (iCons==null){
System.out.println("Could not get a console for the specified process");
System.out.println("Could not get console for the specified process");
continue;
}
System.out.println("originalConsoleName="+consoleName+
if (debugPrint) System.out.println("originalConsoleName="+consoleName+
"\nprocessConsole name="+iCons.getName());
final IOConsole fiCons=iCons;
// final String fConsoleName=fiCons.getName(); // actual console name - may be already "<terminated> ... "
final String fConsoleName=consoleName; // calculated console name - used for launching external program
// if (!fConsoleName.equals(consoleName)){ // terminated before we added listeners
if (!fConsoleName.equals(fiCons.getName())){ // terminated before we added listeners
System.out.println("Already terminated, proceed to the next item");
if (debugPrint) System.out.println("Already terminated, proceed to the next item");
continue; // proceed with the next item without pausing
}
/* Prepare to postpone next commands to be resumed by event*/
......@@ -184,37 +184,41 @@ public class VDTRunner {
public void propertyChange(PropertyChangeEvent event) {
if (!fConsoleName.equals(fiCons.getName())){
fiCons.removePropertyChangeListener(this);
System.out.println(">>> "+fConsoleName+" -> "+fiCons.getName());
// VDTRunner runner = VDTLaunchUtil.getRunner();
if (debugPrint) System.out.println(">>> "+fConsoleName+" -> "+fiCons.getName());
try {
resumeLaunch(fConsoleName); // replace with console
} catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.out.println ("Failed to resume launch sequence");
}
}
}
});
if (!fConsoleName.equals(consoleName)){ // terminated before we added listeners
System.out.println("Fire!");
if (debugPrint) System.out.println("Fire!");
iCons.firePropertyChange(fiCons,"org.eclipse.jface.text", consoleName, fConsoleName);
}
System.out.println("return - waiting to be awaken");
if (debugPrint) System.out.println("return - waiting to be awaken");
int timeout=argumentsItemsArray[numItem].getTimeout();
if (timeout>0){
final int fTimeout = timeout;
final IProcess fProcess=process;
new Timer().schedule(new TimerTask() {
@Override
public void run() {
System.out.println(">>Timeout<<");
try {
fProcess.terminate();
} catch (DebugException e) {
System.out.println("Failed to terminate preocess on "+fConsoleName);
}
}
}, fTimeout*1000);
System.out.println ("timeout is only implemented for console scripts");
// implementation will require keeping track of it and canceling if program terminated earlier.
// And for the programs it is easy to kill them manually with a red square button
if (timeout>100000) { //never with no warnings
final int fTimeout = timeout;
final IProcess fProcess=process;
new Timer().schedule(new TimerTask() {
@Override
public void run() {
System.out.println(">>Timeout<<");
try {
fProcess.terminate();
} catch (DebugException e) {
System.out.println("Failed to terminate process on "+fConsoleName);
}
}
}, fTimeout*1000);
}
}
return;
......@@ -397,7 +401,9 @@ public class VDTRunner {
if (consoles.length>1){
// ((IConsole) consoles[1]).setName("Python Consloe");
}
System.out.println(consoles.length+" consoles, processes="+launch.getChildren().length);
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)){
System.out.println(consoles.length+" consoles, processes="+launch.getChildren().length);
}
return process;
//= consoles
//setImageDescriptor
......
......@@ -49,6 +49,14 @@
icon="my_tool.gif"
call="RemotePythonCommand"/>
<menuitem name="Vivado"
label="Run remote Vivado session"
icon="xilinx.png"
call="Vivado"/>
<menuitem name="Vivado Test"
label="Send a command to the remote Vivado session"
icon="my_tool.gif"
call="VivadoTest"/>
<menu name="XDS"
label="Demo XDS Tools"
......
......@@ -30,9 +30,11 @@
<parameter id="ShellSwitches" label="Shell switches" type="String"
format="CopyValue" default="-c" readonly="false" visible="true" />
<parameter id="SSHSwitches" label="Remote ssh switches"
type="String" format="CopyValue" default="" readonly="false" visible="true" />
<parameter id="TerminalMode" type="BoolYesNo" format="None"
default="false" label="Force termonal mode for remote program" />
<parameter id="SSHSwitches" label="Other ssh switches"
type="String" format="CopyValue" default="" readonly="false" visible="true" />
<parameter id="RemoteCommand" label="Remote ssh command"
type="String" format="CopyValue" default="python -i -u" readonly="false"
......@@ -45,6 +47,7 @@
<group name="General">
"RemoteHost"
"RemoteUser"
"TerminalMode"
"ShellSwitches"
"PreSSH"
"SSHSwitches"
......@@ -59,11 +62,13 @@
"%ShellSwitches"
"%PreSSH"
"ssh"
"-t"
<if TerminalMode = "true">
"-t -t"
</if>
"%SSHSwitches"
"-l"
"%RemoteUser"
"%RemoteHost"
"%SSHSwitches"
"'"
"%RemoteCommand"
"'"
......
<?xml version="1.0" encoding="UTF-8"?>
<vdt-project>
<interface name="VivadoInterface" extends="project_interface">
<syntax name="ProgramSyntax" format="%(%%ParamValue%|\n%)" />
</interface>
<tool name="Vivado" project="FPGA_project" label="Launch Vivado"
shell="/bin/bash" interface="VivadoInterface" description="Launching remote Xilinx Vivado in console"
errors="(.*):([0-9]+): [a-z ]*error: (.*)" warnings="(.*):([0-9]+): warning: (.*)"
info="(.*):([0-9]+): info: (.*)"> <!--does not actually exist -->
<extensions-list>
<extension mask="v" />
<extension mask="tf" />
</extensions-list>
<action-menu>
<action label="Launch Vivado" resource="" icon="xilinx.png" />
</action-menu>
<parameter id="RemoteHost" label="Remote Host IP" type="String"
format="CopyValue" default="192.168.0.122" readonly="false" visible="true" />
<parameter id="RemoteUser" label="Remote user name" type="String"
format="CopyValue" default="xilinx" readonly="false" visible="true" />
<parameter id="PreSSH" label="pre-ssh shell parameters"
type="String" format="CopyValue" default="" readonly="false" visible="true" />
<parameter id="ShellSwitches" label="Shell switches" type="String"
format="CopyValue" default="-c" readonly="false" visible="true" />
<parameter id="TerminalMode" type="BoolYesNo" format="None"
default="false" label="Force termonal mode for remote program" />
<parameter id="SSHSwitches" label="Other ssh switches"
type="String" format="CopyValue" default="" readonly="false" visible="true" />
<parameter id="RemoteCommand" label="Remote ssh command"
type="String" format="CopyValue" default="/opt/Xilinx/Vivado/2013.4/bin/vivado -mode tcl" readonly="false"
visible="true" />
<parameter id="SSHExtra" label="ssh extra parameters" type="String"
format="CopyValue" default="" readonly="false" visible="true" />
<input>
<group name="General">
"RemoteHost"
"RemoteUser"
"TerminalMode"
"ShellSwitches"
"PreSSH"
"SSHSwitches"
"RemoteCommand"
"SSHExtra"
</group>
</input>
<output>
<line name="vivado_launch"
interrupt="\x03">
"%ShellSwitches"
"%PreSSH"
"ssh"
<if TerminalMode = "true">
"-t -t"
</if>
"%SSHSwitches"
"-l"
"%RemoteUser"
"%RemoteHost"
"'"
"%RemoteCommand"
"'"
"%SSHExtra"
</line>
</output>
</tool>
<tool name="VivadoTest" project="FPGA_project" label="VivadoCommand"
shell="/bin/bash" interface="VivadoInterface"
description="Sending command to a remote Vivado session" errors="(.*):([0-9]+): [a-z ]*error: (.*)"
warnings="(.*):([0-9]+): warning: (.*)" info="(.*):([0-9]+): info: (.*)"> <!--does not actually exist -->
<extensions-list>
<extension mask="v" />
<extension mask="tf" />
</extensions-list>
<action-menu>
<action label="Vivado Command" resource="" icon="xilinx.png" />
</action-menu>
<parameter id="RemoteCommand" label="Remote Command to send"
type="Stringlist" format="ProgramSyntax" default="puts &quot;Hello, World!&quot;"
readonly="false" visible="true" />
<parameter id="vivado_console" default="Vivado"
type="String" format="CopyValue" visible="false" />
<parameter id="Timeout" label="Script timeout(sec)" type="Cardinal"
format="CopyValue" default="10" readonly="false" visible="true" />
<input>
<group name="General">
"RemoteCommand"
"Timeout"
</group>
</input>
<output>
<line name="pre_tcl">
"-c"
"echo 'scp files here' ;"
"sleep 2 ;"
</line>
<!-- TODO: Make it OK to ose just strings, not parameters in dest (for console names) -->
<line name="vivado_line_01"
dest="vivado_console"
mark="``"
sep="\n"
prompt="@@FINISH@@"
stdout="parser_001"
timeout="Timeout">
"%RemoteCommand"
"puts '@@FINISH@@'"
"``"`" <!-- two new lines should generate a pair of prompts from the remote -->
</line>
<line name="command_line_02">
"-c"
"echo 'Will scp result files back here' ;"
"sleep 2 ;"
</line>
<!-- parser_01 being referenced should be launched in an asynchronous process/console, removed from the launch sequence -->
<line name="parser_001"
errors="(.*):([0-9]+): [a-z ]*error: (.*)"
warnings="(.*):([0-9]+): warning: (.*)"
info="(.*):([0-9]+): info: (.*)">
"-c"
"cat"
</line>
</output>
</tool>
</vdt-project>
<!-- /opt/Xilinx/Vivado/2013.4/bin/vivado -mode tcl -->
\ No newline at end of file
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