Commit 17be1363 authored by Andrey Filippov's avatar Andrey Filippov

Added support for Cocotb

parent 8ac01d33
...@@ -7,3 +7,4 @@ tmp ...@@ -7,3 +7,4 @@ tmp
about_veditor.html about_veditor.html
ChangeLogVeditor.txt ChangeLogVeditor.txt
CONTRIBUTORS_VEDITOR.txt CONTRIBUTORS_VEDITOR.txt
cocotb
...@@ -169,6 +169,7 @@ public class VDT { ...@@ -169,6 +169,7 @@ public class VDT {
public static final String GENERATOR_ID_STATE_FILE = "StateFile"; public static final String GENERATOR_ID_STATE_FILE = "StateFile";
public static final String GENERATOR_PARSERS_PATH = "ParsersPath"; public static final String GENERATOR_PARSERS_PATH = "ParsersPath";
public static final String GENERATOR_PLUGIN_ROOT = "PluginRoot";
public static final String PATH_TO_PARSERS = "parsers"; public static final String PATH_TO_PARSERS = "parsers";
public static final String TIME_STAMP_FORMAT = "yyyyMMddHHmmssSSS"; public static final String TIME_STAMP_FORMAT = "yyyyMMddHHmmssSSS";
......
...@@ -38,7 +38,8 @@ import org.eclipse.jface.util.PropertyChangeEvent; ...@@ -38,7 +38,8 @@ import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.ui.console.IConsole; import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.ConsolePlugin; import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsoleManager; import org.eclipse.ui.console.IConsoleManager;
import org.eclipse.ui.console.TextConsole;
import org.eclipse.debug.internal.ui.views.console.ProcessConsole;
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_MODE;
...@@ -82,9 +83,9 @@ public class RunningBuilds { ...@@ -82,9 +83,9 @@ public class RunningBuilds {
parserListeners= new ConcurrentHashMap<IConsole,MonListener>(); parserListeners= new ConcurrentHashMap<IConsole,MonListener>();
unfinishedBuilds = new ConcurrentHashMap<String, VDTRunnerConfiguration>(); unfinishedBuilds = new ConcurrentHashMap<String, VDTRunnerConfiguration>();
IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager(); IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) { // if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println("***Addded console listeners"); // System.out.println("***Addded console listeners");
} // }
manager.addConsoleListener(new IConsoleListener(){ manager.addConsoleListener(new IConsoleListener(){
public void consolesAdded(IConsole[] consoles){ public void consolesAdded(IConsole[] consoles){
for (int i=0;i<consoles.length;i++){ for (int i=0;i<consoles.length;i++){
...@@ -101,10 +102,14 @@ public class RunningBuilds { ...@@ -101,10 +102,14 @@ public class RunningBuilds {
} }
// unfinishedBuilds.remove(consoles[i]); // unfinishedBuilds.remove(consoles[i]);
removeMonListener(consoles[i]); // remove listeners that provided input data for parsers removeMonListener(consoles[i]); // remove listeners that provided input data for parsers
removeConsole(consoles[i]); removeConsole(consoles[i], null);
} }
} }
}); });
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println("***Addded console listeners");
}
} }
public void addMonListener(IConsole parserConsole, IStreamMonitor monitor, IStreamListener listener){ public void addMonListener(IConsole parserConsole, IStreamMonitor monitor, IStreamListener listener){
...@@ -165,18 +170,6 @@ public class RunningBuilds { ...@@ -165,18 +170,6 @@ public class RunningBuilds {
String consoleName=findConsoleParent(console); String consoleName=findConsoleParent(console);
if (consoleName!=null){ if (consoleName!=null){
VDTRunnerConfiguration runConfig=unfinishedBuilds.get(consoleName); VDTRunnerConfiguration runConfig=unfinishedBuilds.get(consoleName);
/*
runConfig.removeConsole(console);
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println("Removing console "+console.getName()+" from runConfig for "+consoleName);
}
if (runConfig.noConsoles()){
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println("No consoles left in unfinished "+consoleName+" - removing it too");
}
unfinishedBuilds.remove(consoleName);
}
*/
} else { } else {
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) { if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println("Console "+console.getName()+" did not belong here"); System.out.println("Console "+console.getName()+" did not belong here");
...@@ -263,12 +256,22 @@ public class RunningBuilds { ...@@ -263,12 +256,22 @@ public class RunningBuilds {
final String fConsoleName=fIconsole.getName(); final String fConsoleName=fIconsole.getName();
final IPropertyChangeListener fListener =new IPropertyChangeListener() { final IPropertyChangeListener fListener =new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) { public void propertyChange(PropertyChangeEvent event) {
// ProcessConsole console = (ProcessConsole) event.getSource();
// TextConsole console = (TextConsole) event.getSource();
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
String txt = ((TextConsole) event.getSource()).getDocument().get();
System.out.println("==== Console contents at "+event.getProperty()+" ====");
System.out.println("fConsoleName="+fConsoleName+" fIconsole.getName()="+fIconsole.getName());
System.out.println(txt);
System.out.println("==== End of console contents at "+event.getProperty()+" ====");
}
if (!fConsoleName.equals(fIconsole.getName())){ if (!fConsoleName.equals(fIconsole.getName())){
fIconsole.removePropertyChangeListener(this); fIconsole.removePropertyChangeListener(this);
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) { if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println(">>> "+fConsoleName+" -> "+fIconsole.getName()); System.out.println(">>> "+fConsoleName+" -> "+fIconsole.getName());
} }
removeConsole(fIconsole); // changed name means "<terminated>..." String ctxt = ((TextConsole) event.getSource()).getDocument().get(); // To search for good/bad completion
removeConsole(fIconsole, ctxt); // changed name means "<terminated>..."
} }
} }
}; };
...@@ -283,12 +286,25 @@ public class RunningBuilds { ...@@ -283,12 +286,25 @@ public class RunningBuilds {
} }
// Only for closing consoles // Only for closing consoles
public boolean removeConsole(IConsole iConsole){ // from add console; public boolean removeConsole(IConsole iConsole, String consoleText){ // from add console;
Iterator<String> iter=unfinishedBuilds.keySet().iterator(); Iterator<String> iter=unfinishedBuilds.keySet().iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
String consoleName=iter.next(); String consoleName=iter.next();
VDTRunnerConfiguration runConfig=unfinishedBuilds.get(consoleName); VDTRunnerConfiguration runConfig=unfinishedBuilds.get(consoleName);
if (runConfig.getIConsole()==iConsole){ // same instance if (runConfig.getIConsole()==iConsole){ // same instance
boolean hasGood = false;
boolean hasBad = false;
boolean goodSet = false;
boolean badSet = false;
if (consoleText != null){
goodSet = runConfig.isSetGood();
badSet = runConfig.isSetBad();
if (goodSet || badSet) {
runConfig.addConsoleText(consoleText);
hasGood = runConfig.gotGood();
hasBad = runConfig.gotBad();
}
}
runConfig.setIConsole(null); runConfig.setIConsole(null);
Tool tool=ToolsCore.getTool(runConfig.getToolName()); Tool tool=ToolsCore.getTool(runConfig.getToolName());
if (tool.getState()==TOOL_STATE.KEPT_OPEN) { if (tool.getState()==TOOL_STATE.KEPT_OPEN) {
...@@ -297,6 +313,10 @@ public class RunningBuilds { ...@@ -297,6 +313,10 @@ public class RunningBuilds {
removeConfiguration(consoleName); removeConfiguration(consoleName);
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) System.out.print("Killed open console"); if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) System.out.print("Killed open console");
return true; return true;
} else {
if (hasBad) tool.setState(TOOL_STATE.FAILURE);
else if (hasGood) tool.setState(TOOL_STATE.SUCCESS);
else if (goodSet) tool.setState(TOOL_STATE.FAILURE);
} }
} }
} }
......
...@@ -147,6 +147,12 @@ public class VDTProgramRunner { ...@@ -147,6 +147,12 @@ public class VDTProgramRunner {
} }
} }
// AF2016
// Adding good/bad console messages - same as for VDTConsoleRunner
runConfig.setConsoleFinish(buildParamsItem.getPrompt());
runConfig.setConsoleBad(buildParamsItem.getFailureString());
runConfig.setConsoleGood(buildParamsItem.getSuccessString());
String[] cmdLine; String[] cmdLine;
if (isShell && (arguments != null) && (arguments.length > 0)){ /* first argument is passed as a parameter to shell*/ if (isShell && (arguments != null) && (arguments.length > 0)){ /* first argument is passed as a parameter to shell*/
......
...@@ -245,12 +245,12 @@ public class VDTRunner { ...@@ -245,12 +245,12 @@ public class VDTRunner {
if (debugPrint) System.out.println("Fire!"); if (debugPrint) System.out.println("Fire!");
fiCons.firePropertyChange(fiCons,"org.eclipse.jface.text", consoleName, fConsoleName); fiCons.firePropertyChange(fiCons,"org.eclipse.jface.text", consoleName, fConsoleName);
} }
if (debugPrint) System.out.println("return - waiting to be awaken");
int timeout=argumentsItemsArray[numItem].getTimeout(); int timeout=argumentsItemsArray[numItem].getTimeout();
//keepOpen() //keepOpen()
final boolean fKeepOpen=argumentsItemsArray[numItem].keepOpen(); final boolean fKeepOpen=argumentsItemsArray[numItem].keepOpen();
if (fKeepOpen) runConfig.setKeptOpen(true); if (fKeepOpen) runConfig.setKeptOpen(true);
if (fKeepOpen && (timeout<1)) timeout=1; // some minimal timeout if (fKeepOpen && (timeout<1)) timeout=1; // some minimal timeout
if (debugPrint) System.out.println("return - waiting to be awaken, timeout = "+timeout);
if (timeout>0){ if (timeout>0){
if (debugPrint) System.out.println ("timeout="+timeout+"s, keep-open="+ fKeepOpen); if (debugPrint) System.out.println ("timeout="+timeout+"s, keep-open="+ fKeepOpen);
// implementation will require keeping track of it and canceling if program terminated earlier. // implementation will require keeping track of it and canceling if program terminated earlier.
......
...@@ -273,20 +273,7 @@ public class VDTRunnerConfiguration { ...@@ -273,20 +273,7 @@ public class VDTRunnerConfiguration {
public VDTProgramRunner getProgramRunner(){ public VDTProgramRunner getProgramRunner(){
return this.programRunner; return this.programRunner;
} }
/*
public void addConsole(IConsole console){ // not used
consoles.add(console);
}
public void removeConsole(IConsole console){ // from VDTRunnerConfiguration
consoles.remove(console);
}
public boolean noConsoles(){
return consoles.isEmpty();
}
public boolean hasConsole(IConsole console){
return consoles.contains(console);
}
*/
public void setConsoleFinish(String consoleFinish){ public void setConsoleFinish(String consoleFinish){
this.consoleFinish=consoleFinish; this.consoleFinish=consoleFinish;
if ((this.consoleFinish!=null) && ((this.consoleFinish.length()+extraChars) > maxLength)){ if ((this.consoleFinish!=null) && ((this.consoleFinish.length()+extraChars) > maxLength)){
...@@ -356,7 +343,16 @@ public class VDTRunnerConfiguration { ...@@ -356,7 +343,16 @@ public class VDTRunnerConfiguration {
} }
public boolean gotGood(){ public boolean gotGood(){
return hasGood; return hasGood;
} }
public boolean isSetGood(){
return consoleGood != null;
}
public boolean isSetBad(){
return consoleBad != null;
}
public String getConsoluBuffer(){ public String getConsoluBuffer(){
return consoleBuffer; // just for debugging return consoleBuffer; // just for debugging
} }
......
...@@ -97,7 +97,7 @@ public class FilteredIncludesListGenerator extends AbstractGenerator { ...@@ -97,7 +97,7 @@ public class FilteredIncludesListGenerator extends AbstractGenerator {
} }
String[] file_names = null; String[] file_names = null;
IResource resource = SelectedResourceManager.getDefault().getChosenVerilogFile(); IResource resource = SelectedResourceManager.getDefault().getChosenVerilogFile();
if ((topFile != null) && (topFile !="") && (resource !=null)) { if ((topFile != null) && (!topFile.equals("")) && (resource !=null)) {
IResource resource1 = resource.getProject().getFile(topFile); IResource resource1 = resource.getProject().getFile(topFile);
if ((resource1 != null) && (resource1.getType() == IResource.FILE)){ if ((resource1 != null) && (resource1.getType() == IResource.FILE)){
resource = resource1; resource = resource1;
......
...@@ -108,7 +108,7 @@ public class FilteredSourceListGenerator extends AbstractGenerator { ...@@ -108,7 +108,7 @@ public class FilteredSourceListGenerator extends AbstractGenerator {
} }
String[] file_names = null; String[] file_names = null;
IResource resource = SelectedResourceManager.getDefault().getChosenVerilogFile(); IResource resource = SelectedResourceManager.getDefault().getChosenVerilogFile();
if ((topFile != null) && (topFile !="") && (resource !=null)) { if ((topFile != null) && (!topFile.equals("")) && (resource !=null)) {
IResource resource1 = resource.getProject().getFile(topFile); IResource resource1 = resource.getProject().getFile(topFile);
if ((resource1 != null) && (resource1.getType() == IResource.FILE)){ if ((resource1 != null) && (resource1.getType() == IResource.FILE)){
resource = resource1; resource = resource1;
......
...@@ -53,7 +53,8 @@ public class ParsersPathGenerator extends AbstractGenerator { ...@@ -53,7 +53,8 @@ public class ParsersPathGenerator extends AbstractGenerator {
if(url != null) { if(url != null) {
URI uri=FileLocator.resolve(url).toURI(); URI uri=FileLocator.resolve(url).toURI();
// System.out.println("ParsersPathGenerator()->"+uri.getRawPath()+" : "+uri.toString()); // System.out.println("ParsersPathGenerator()->"+uri.getRawPath()+" : "+uri.toString());
return new String[]{uri.getRawPath()}; // return new String[]{uri.getRawPath()};
return new String[]{uri.normalize().getPath()};
} }
return null; return null;
} catch (Exception e){ } catch (Exception e){
......
/*******************************************************************************
* Copyright (c) 2014 Elphel, Inc.
* This file is a part of VDT plug-in.
* VDT plug-in is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VDT plug-in is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Additional permission under GNU GPL version 3 section 7:
* If you modify this Program, or any covered work, by linking or combining it
* with Eclipse or Eclipse plugins (or a modified version of those libraries),
* containing parts covered by the terms of EPL/CPL, the licensors of this
* Program grant you additional permission to convey the resulting work.
* {Corresponding Source for a non-source form of such a combination shall
* include the source code for the parts of Eclipse or Eclipse plugins used
* as well as that of the covered work.}
*******************************************************************************/
package com.elphel.vdt.core.tools.generators;
import java.io.File;
import java.net.URI;
import org.eclipse.core.runtime.FileLocator;
import com.elphel.vdt.VDT;
import com.elphel.vdt.veditor.VerilogPlugin;
public class PluginPathGenerator extends AbstractGenerator {
public static final String NAME = VDT.GENERATOR_PLUGIN_ROOT;
public String getName() {
return NAME;
}
public PluginPathGenerator()
{
super(null); // null for topFormatProcessor - this generator can not reference other parameters
}
protected String[] getStringValues() {
try {
File path=FileLocator.getBundleFile(VerilogPlugin.getDefault().getBundle());
String normalized = new URI(path.getAbsolutePath()).normalize().getPath();
return new String[]{normalized};
} catch (Exception e){
return null;
}
}
}
...@@ -27,10 +27,12 @@ ...@@ -27,10 +27,12 @@
package com.elphel.vdt.core.tools.generators; package com.elphel.vdt.core.tools.generators;
import java.io.File; import java.io.File;
import java.nio.file.Paths;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import com.elphel.vdt.VDT; import com.elphel.vdt.VDT;
import com.elphel.vdt.ui.variables.SelectedResourceManager; import com.elphel.vdt.ui.variables.SelectedResourceManager;
...@@ -55,10 +57,19 @@ public class ProjectPathGenerator extends AbstractGenerator { ...@@ -55,10 +57,19 @@ public class ProjectPathGenerator extends AbstractGenerator {
protected String[] getStringValues() { protected String[] getStringValues() {
String[] value = null; String[] value = null;
IResource resource = SelectedResourceManager.getDefault().getSelectedResource(); IResource resource = SelectedResourceManager.getDefault().getSelectedResource();
if (resource != null) { if (resource != null) {
/*
String workspaceRoot=resource.getWorkspace().getRoot().getLocation().toString(); String workspaceRoot=resource.getWorkspace().getRoot().getLocation().toString();
String project_name = workspaceRoot+resource.getProject().getFullPath().toString()+File.separator; String project_name = workspaceRoot+resource.getProject().getFullPath().toString()+File.separator;
value = new String[]{project_name}; String projectRoot=resource.getWorkspace().getRoot().getLocation().toString();
IPath apath = resource.getProject().getRawLocation().makeAbsolute();
value = new String[]{project_name};
*/
try {
value = new String[]{resource.getProject().getRawLocation().makeAbsolute().toString()};
} catch (NullPointerException npe){
return new String[] {""};
}
} else { } else {
// fault("There is no selected project"); // fault("There is no selected project");
System.out.println(getName()+": no project selected"); System.out.println(getName()+": no project selected");
......
...@@ -61,7 +61,7 @@ public class TopModuleNameGenerator extends AbstractGenerator { ...@@ -61,7 +61,7 @@ public class TopModuleNameGenerator extends AbstractGenerator {
} else { } else {
System.out.println("ToolNameGenerator(): topProcessor.getCurrentTool() is null"); System.out.println("ToolNameGenerator(): topProcessor.getCurrentTool() is null");
} }
if ((topFile != null) && (topFile !="") && (resource !=null)) { if ((topFile != null) && (!topFile.equals("")) && (resource !=null)) {
IResource resource1 = resource.getProject().getFile(topFile); IResource resource1 = resource.getProject().getFile(topFile);
if ((resource1 != null) && (resource1.getType() == IResource.FILE)){ if ((resource1 != null) && (resource1.getType() == IResource.FILE)){
resource = resource1; resource = resource1;
......
...@@ -65,7 +65,7 @@ public class TopModulesNameGenerator extends AbstractGenerator { ...@@ -65,7 +65,7 @@ public class TopModulesNameGenerator extends AbstractGenerator {
} else { } else {
System.out.println("ToolNameGenerator(): topProcessor.getCurrentTool() is null"); System.out.println("ToolNameGenerator(): topProcessor.getCurrentTool() is null");
} }
if ((topFile != null) && (topFile !="") && (resource !=null)) { if ((topFile != null) && (!topFile.equals("")) && (resource !=null)) {
IResource resource1 = resource.getProject().getFile(topFile); IResource resource1 = resource.getProject().getFile(topFile);
if ((resource1 != null) && (resource1.getType() == IResource.FILE)){ if ((resource1 != null) && (resource1.getType() == IResource.FILE)){
resource = resource1; resource = resource1;
......
...@@ -55,7 +55,8 @@ public class SimpleGeneratorRecognizer implements Recognizer { ...@@ -55,7 +55,8 @@ public class SimpleGeneratorRecognizer implements Recognizer {
new StateFileGenerator(processor), new StateFileGenerator(processor),
new StateBaseGenerator(processor), new StateBaseGenerator(processor),
new ToolNameGenerator(), new ToolNameGenerator(),
new ParsersPathGenerator() new ParsersPathGenerator(),
new PluginPathGenerator()
// new SourceListGenerator("","",""), // new SourceListGenerator("","",""),
// new FilteredSourceListGenerator("","","") // new FilteredSourceListGenerator("","","")
}; };
......
...@@ -41,7 +41,8 @@ import org.eclipse.jface.viewers.*; ...@@ -41,7 +41,8 @@ import org.eclipse.jface.viewers.*;
import org.eclipse.jface.window.Window; import org.eclipse.jface.window.Window;
import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Image;
//import org.eclipse.swt.graphics.ImageData; //import org.eclipse.swt.graphics.ImageData;
import org.eclipse.jface.action.*; import org.eclipse.jface.action.*;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ui.*; import org.eclipse.ui.*;
import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
...@@ -71,7 +72,9 @@ import com.elphel.vdt.core.tools.params.types.RunFor; ...@@ -71,7 +72,9 @@ import com.elphel.vdt.core.tools.params.types.RunFor;
import com.elphel.vdt.Txt; import com.elphel.vdt.Txt;
import com.elphel.vdt.VDT; import com.elphel.vdt.VDT;
import com.elphel.vdt.VerilogUtils; import com.elphel.vdt.VerilogUtils;
import com.elphel.vdt.veditor.VerilogPlugin; import com.elphel.vdt.veditor.VerilogPlugin;
import com.elphel.vdt.veditor.document.HdlDocument;
import com.elphel.vdt.veditor.editor.HdlEditor;
import com.elphel.vdt.veditor.preference.PreferenceStrings; import com.elphel.vdt.veditor.preference.PreferenceStrings;
import com.elphel.vdt.ui.MessageUI; import com.elphel.vdt.ui.MessageUI;
import com.elphel.vdt.ui.VDTPluginImages; import com.elphel.vdt.ui.VDTPluginImages;
...@@ -362,7 +365,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener { ...@@ -362,7 +365,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
manager.add(clearProjectPropertiesAction); manager.add(clearProjectPropertiesAction);
manager.add(clearToolPropertiesAction); manager.add(clearToolPropertiesAction);
manager.add(new Separator()); manager.add(new Separator());
manager.add(selectDesignMenuAction); manager.add(selectDesignMenuAction); // got null
manager.add(new Separator()); manager.add(new Separator());
manager.add(clearStateFilesAction); manager.add(clearStateFilesAction);
manager.add(clearLogFilesAction); manager.add(clearLogFilesAction);
...@@ -574,9 +577,17 @@ public class DesignFlowView extends ViewPart implements ISelectionListener { ...@@ -574,9 +577,17 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
} }
}; };
clearToolPropertiesAction.setText("Clear Tool Parameters"); clearToolPropertiesAction.setText("Clear Tool Parameters");
clearToolPropertiesAction.setImageDescriptor(VDTPluginImages.DESC_TOOL_PROPERTIES); clearToolPropertiesAction.setImageDescriptor(VDTPluginImages.DESC_TOOL_PROPERTIES);
selectDesignMenuAction = new Action() { selectDesignMenuAction = new Action() {
public void run() { public void run() {
if (selectedResource == null){
HdlEditor editor = HdlEditor.current();
if ((editor != null) && (editor.getDocument() != null) && (editor.getDocument() instanceof HdlDocument) ){
selectedResource = ((HdlDocument)editor.getDocument()).getFile();
} else {
return;
}
}
openDesignMenuSelectionDialog(selectedResource.getProject()); openDesignMenuSelectionDialog(selectedResource.getProject());
} }
}; };
......
...@@ -52,6 +52,10 @@ ...@@ -52,6 +52,10 @@
<paramtype kind="bool" formatTrue="on" formatFalse="off" /> <paramtype kind="bool" formatTrue="on" formatFalse="off" />
</typedef> </typedef>
<typedef name = "Bool_1_0">
<paramtype kind="bool" formatTrue="1" formatFalse="0" />
</typedef>
<typedef name = "Cardinal"> <typedef name = "Cardinal">
<paramtype kind="number" lo="0" hi="65535" format="%d" /> <paramtype kind="number" lo="0" hi="65535" format="%d" />
</typedef> </typedef>
...@@ -125,6 +129,7 @@ ...@@ -125,6 +129,7 @@
<syntax name="NameValue" format=" %%ParamName %%ParamValue" /> <syntax name="NameValue" format=" %%ParamName %%ParamValue" />
<syntax name="DoubleDash" format="--%%ParamName=%%ParamValue" /> <syntax name="DoubleDash" format="--%%ParamName=%%ParamValue" />
<syntax name="DoubleDashName" format="--%%ParamName" /> <syntax name="DoubleDashName" format="--%%ParamName" />
<syntax name="NameEqValue" format="%%ParamName=%%ParamValue" />
<!-- <!--
Does not work according to 2.2.1. "Inside text-repetitor, one and only one pattern-generator is mandatory". Does not work according to 2.2.1. "Inside text-repetitor, one and only one pattern-generator is mandatory".
......
...@@ -39,6 +39,11 @@ ...@@ -39,6 +39,11 @@
icon="iverilog.ico" icon="iverilog.ico"
call="iverilog"/> call="iverilog"/>
<menuitem name="cocotb"
label="Cocotb Python Verification"
icon="pv_logo_32x32.png"
call="cocotb"/>
<menuitem name="GTKWave" <menuitem name="GTKWave"
label="GTKWave (Waves viewer)" label="GTKWave (Waves viewer)"
icon="gtkwave.ico" icon="gtkwave.ico"
......
...@@ -243,12 +243,19 @@ ...@@ -243,12 +243,19 @@
readonly="false" /> readonly="false" />
<parameter id="SimulationTopModule" label="Simulation top module" tooltip="Project top simulation module" <parameter id="SimulationTopModule" label="Simulation top module" tooltip="Project top simulation module"
type="String" default="" format="CopyValue" readonly="false" /> type="String" default="" format="CopyValue" readonly="false" />
<parameter id="DUTTopFile" label="DUT top file" tooltip="Cocotb DUT top Veilog file"
type="Filename" default="" format="CopyValue"
readonly="false" />
<parameter id="DUTTopModule" label="DUT top module" tooltip="Cocotb DUT top simulation module"
type="String" default="" format="CopyValue" readonly="false" />
<parameter id="ImplementationTopFile" label="Implementation top file" tooltip="Project file with top implementation module" <parameter id="ImplementationTopFile" label="Implementation top file" tooltip="Project file with top implementation module"
type="Filename" default="" format="CopyValue" readonly="false" /> type="Filename" default="" format="CopyValue" readonly="false" />
<parameter id="ImplementationTopModule" label="Implementation top module" tooltip="Project top implementation module" <parameter id="ImplementationTopModule" label="Implementation top module" tooltip="Project top implementation module"
type="String" default="" format="CopyValue" readonly="false" /> type="String" default="" format="CopyValue" readonly="false" />
<parameter id="SimulDir" label="Simulation directory" tooltip="Project simulation directory" <parameter id="SimulDir" label="Simulation directory" tooltip="Project simulation directory"
type="Pathname" default="simulation" format="CopyValue" readonly="false" /> type="Pathname" default="simulation" format="CopyValue" readonly="false" />
<parameter id="CocotbFilesDir" label="Cocotb Simulation directory" tooltip="Cocotb simulation files directory for the project"
type="Pathname" default="cocotb" format="CopyValue" readonly="false" />
<!-- Vivado parameters --> <!-- Vivado parameters -->
<parameter id="part" label="Device" tooltip= "FPGA part number (device) to use" <parameter id="part" label="Device" tooltip= "FPGA part number (device) to use"
default="" visible="true" omit="" type="String" format="CopyValue"/> default="" visible="true" omit="" type="String" format="CopyValue"/>
...@@ -481,6 +488,9 @@ ...@@ -481,6 +488,9 @@
<group name="Simulation" label="Simulation properties"> <group name="Simulation" label="Simulation properties">
"SimulationTopFile" "SimulationTopFile"
"SimulationTopModule" "SimulationTopModule"
"DUTTopFile"
"DUTTopModule"
"CocotbFilesDir"
"SimulDir" "SimulDir"
</group> </group>
......
This diff is collapsed.
...@@ -93,7 +93,8 @@ ...@@ -93,7 +93,8 @@
<tool name="iverilog" project="FPGA_project" label="Icarus Verilog compiler" <tool name="iverilog" project="FPGA_project" label="Icarus Verilog compiler"
shell="bash" shell="bash"
package="FPGA_package" package="FPGA_package"
interface="IVerilog" errors="(.*):([0-9]+): [a-z_\- ]*error: (.*)" interface="IVerilog"
errors="(.*):([0-9]+): [a-z_\- ]*error[: ]?(.*)"
warnings="(.*):([0-9]+): [a-z_\- ]*warning: (.*)" warnings="(.*):([0-9]+): [a-z_\- ]*warning: (.*)"
info="(.*):([0-9]+): [a-z_\- ]*sorry: (.*)" info="(.*):([0-9]+): [a-z_\- ]*sorry: (.*)"
top-file="%IcarusTopFile" top-file="%IcarusTopFile"
...@@ -290,6 +291,7 @@ ...@@ -290,6 +291,7 @@
<parameter id="FstDumpFileFull" default="%SimulDir/%FstDumpFile" <parameter id="FstDumpFileFull" default="%SimulDir/%FstDumpFile"
visible="false" type="String" format="FstFileSyntax"/> visible="false" type="String" format="FstFileSyntax"/>
<input> <input>
<group name="files" label="Files"> <group name="files" label="Files">
<!-- "SimulationTopFile" --> <!-- "SimulationTopFile" -->
...@@ -336,13 +338,17 @@ ...@@ -336,13 +338,17 @@
<output> <output>
<!-- TODO: watch for new lines inserted inside quoted tokens during autoformat - they break output <!-- TODO: watch for new lines inserted inside quoted tokens during autoformat - they break output
Maybe add filter to the code to transform white spaces --> Maybe add filter to the code to transform white spaces -->
<line name="command_line" sep=" "> <line name="command_line"
sep=" "
success = "SIMULATION FINISHED SUCCESSFULLY"
>
"%Param_Shell_Options" "%Param_Shell_Options"
"%Param_PreExe" "%Param_PreExe"
<!-- MKDIR - ALWAYS --> <!-- MKDIR - ALWAYS -->
"mkdir -p" "mkdir -p"
"%SimulDir" "%SimulDir"
";" ";"
<!-- "(&gt;&amp;2 echo 'unisims/RAMB36E1.v:100: warning: choosing typ expression.');" -->
<if SaveLogsPreprocessor="true" <if SaveLogsPreprocessor="true"
SaveLogsSimulator="true"> SaveLogsSimulator="true">
"touch" "touch"
...@@ -366,6 +372,8 @@ ...@@ -366,6 +372,8 @@
"%Param_TopModule" "%Param_TopModule"
"%TopModulesOther" "%TopModulesOther"
"%ModuleLibrary" "%ModuleLibrary"
<!-- Always include top project dir (where IVERILOG_INCLUDE.v is) -->
"-I%%ProjectPath"
"%IncludeDir" "%IncludeDir"
"%legacy_model" "%legacy_model"
"%no_specify" "%no_specify"
...@@ -416,10 +424,14 @@ ...@@ -416,10 +424,14 @@
"%GtkWave_Exe" "%GtkWave_Exe"
"%FstDumpFileFull" "%FstDumpFileFull"
"%GTKWaveSavFile" "%GTKWaveSavFile"
"&lt;/dev/null &amp;&gt;/dev/null"
"&amp; " "&amp; "
</if> </if>
"%Param_4" "%Param_4"
</if-not> </if-not>
"if [ $? -eq 0 ]; then echo 'SIMULATION FINISHED SUCCESSFULLY'; else echo 'SIMULATION FAILED'; fi;"
"sleep 1"
</line> </line>
<line name="IverilogIncludeFile" dest="iverilog_include_file" <line name="IverilogIncludeFile" dest="iverilog_include_file"
sep="\n"> sep="\n">
......
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