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

Added support for Cocotb

parent 8ac01d33
......@@ -7,3 +7,4 @@ tmp
about_veditor.html
ChangeLogVeditor.txt
CONTRIBUTORS_VEDITOR.txt
cocotb
......@@ -169,6 +169,7 @@ public class VDT {
public static final String GENERATOR_ID_STATE_FILE = "StateFile";
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 TIME_STAMP_FORMAT = "yyyyMMddHHmmssSSS";
......
......@@ -38,7 +38,8 @@ import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.ConsolePlugin;
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.params.Tool;
import com.elphel.vdt.core.tools.params.Tool.TOOL_MODE;
......@@ -82,9 +83,9 @@ public class RunningBuilds {
parserListeners= new ConcurrentHashMap<IConsole,MonListener>();
unfinishedBuilds = new ConcurrentHashMap<String, VDTRunnerConfiguration>();
IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println("***Addded console listeners");
}
// 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++){
......@@ -101,10 +102,14 @@ public class RunningBuilds {
}
// unfinishedBuilds.remove(consoles[i]);
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){
......@@ -165,18 +170,6 @@ public class RunningBuilds {
String consoleName=findConsoleParent(console);
if (consoleName!=null){
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 {
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
System.out.println("Console "+console.getName()+" did not belong here");
......@@ -263,12 +256,22 @@ public class RunningBuilds {
final String fConsoleName=fIconsole.getName();
final IPropertyChangeListener fListener =new IPropertyChangeListener() {
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())){
fIconsole.removePropertyChangeListener(this);
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
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 {
}
// 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();
while (iter.hasNext()) {
String consoleName=iter.next();
VDTRunnerConfiguration runConfig=unfinishedBuilds.get(consoleName);
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);
Tool tool=ToolsCore.getTool(runConfig.getToolName());
if (tool.getState()==TOOL_STATE.KEPT_OPEN) {
......@@ -297,6 +313,10 @@ public class RunningBuilds {
removeConfiguration(consoleName);
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) System.out.print("Killed open console");
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);
}
}
}
......
......@@ -148,6 +148,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;
if (isShell && (arguments != null) && (arguments.length > 0)){ /* first argument is passed as a parameter to shell*/
StringBuilder builder = new StringBuilder();
......
......@@ -245,12 +245,12 @@ public class VDTRunner {
if (debugPrint) System.out.println("Fire!");
fiCons.firePropertyChange(fiCons,"org.eclipse.jface.text", consoleName, fConsoleName);
}
if (debugPrint) System.out.println("return - waiting to be awaken");
int timeout=argumentsItemsArray[numItem].getTimeout();
//keepOpen()
final boolean fKeepOpen=argumentsItemsArray[numItem].keepOpen();
if (fKeepOpen) runConfig.setKeptOpen(true);
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 (debugPrint) System.out.println ("timeout="+timeout+"s, keep-open="+ fKeepOpen);
// implementation will require keeping track of it and canceling if program terminated earlier.
......
......@@ -273,20 +273,7 @@ public class VDTRunnerConfiguration {
public VDTProgramRunner getProgramRunner(){
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){
this.consoleFinish=consoleFinish;
if ((this.consoleFinish!=null) && ((this.consoleFinish.length()+extraChars) > maxLength)){
......@@ -357,6 +344,15 @@ public class VDTRunnerConfiguration {
public boolean gotGood(){
return hasGood;
}
public boolean isSetGood(){
return consoleGood != null;
}
public boolean isSetBad(){
return consoleBad != null;
}
public String getConsoluBuffer(){
return consoleBuffer; // just for debugging
}
......
......@@ -97,7 +97,7 @@ public class FilteredIncludesListGenerator extends AbstractGenerator {
}
String[] file_names = null;
IResource resource = SelectedResourceManager.getDefault().getChosenVerilogFile();
if ((topFile != null) && (topFile !="") && (resource !=null)) {
if ((topFile != null) && (!topFile.equals("")) && (resource !=null)) {
IResource resource1 = resource.getProject().getFile(topFile);
if ((resource1 != null) && (resource1.getType() == IResource.FILE)){
resource = resource1;
......
......@@ -108,7 +108,7 @@ public class FilteredSourceListGenerator extends AbstractGenerator {
}
String[] file_names = null;
IResource resource = SelectedResourceManager.getDefault().getChosenVerilogFile();
if ((topFile != null) && (topFile !="") && (resource !=null)) {
if ((topFile != null) && (!topFile.equals("")) && (resource !=null)) {
IResource resource1 = resource.getProject().getFile(topFile);
if ((resource1 != null) && (resource1.getType() == IResource.FILE)){
resource = resource1;
......
......@@ -53,7 +53,8 @@ public class ParsersPathGenerator extends AbstractGenerator {
if(url != null) {
URI uri=FileLocator.resolve(url).toURI();
// 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;
} 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;
}
}
}
......@@ -28,8 +28,10 @@ package com.elphel.vdt.core.tools.generators;
import java.io.File;
import java.nio.file.Paths;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import com.elphel.vdt.VDT;
import com.elphel.vdt.ui.variables.SelectedResourceManager;
......@@ -56,9 +58,18 @@ public class ProjectPathGenerator extends AbstractGenerator {
String[] value = null;
IResource resource = SelectedResourceManager.getDefault().getSelectedResource();
if (resource != null) {
/*
String workspaceRoot=resource.getWorkspace().getRoot().getLocation().toString();
String project_name = workspaceRoot+resource.getProject().getFullPath().toString()+File.separator;
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 {
// fault("There is no selected project");
System.out.println(getName()+": no project selected");
......
......@@ -61,7 +61,7 @@ public class TopModuleNameGenerator extends AbstractGenerator {
} else {
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);
if ((resource1 != null) && (resource1.getType() == IResource.FILE)){
resource = resource1;
......
......@@ -65,7 +65,7 @@ public class TopModulesNameGenerator extends AbstractGenerator {
} else {
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);
if ((resource1 != null) && (resource1.getType() == IResource.FILE)){
resource = resource1;
......
......@@ -55,7 +55,8 @@ public class SimpleGeneratorRecognizer implements Recognizer {
new StateFileGenerator(processor),
new StateBaseGenerator(processor),
new ToolNameGenerator(),
new ParsersPathGenerator()
new ParsersPathGenerator(),
new PluginPathGenerator()
// new SourceListGenerator("","",""),
// new FilteredSourceListGenerator("","","")
};
......
......@@ -42,6 +42,7 @@ import org.eclipse.jface.window.Window;
import org.eclipse.swt.graphics.Image;
//import org.eclipse.swt.graphics.ImageData;
import org.eclipse.jface.action.*;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ui.*;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.SWT;
......@@ -72,6 +73,8 @@ import com.elphel.vdt.Txt;
import com.elphel.vdt.VDT;
import com.elphel.vdt.VerilogUtils;
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.ui.MessageUI;
import com.elphel.vdt.ui.VDTPluginImages;
......@@ -362,7 +365,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
manager.add(clearProjectPropertiesAction);
manager.add(clearToolPropertiesAction);
manager.add(new Separator());
manager.add(selectDesignMenuAction);
manager.add(selectDesignMenuAction); // got null
manager.add(new Separator());
manager.add(clearStateFilesAction);
manager.add(clearLogFilesAction);
......@@ -577,6 +580,14 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
clearToolPropertiesAction.setImageDescriptor(VDTPluginImages.DESC_TOOL_PROPERTIES);
selectDesignMenuAction = new Action() {
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());
}
};
......
......@@ -52,6 +52,10 @@
<paramtype kind="bool" formatTrue="on" formatFalse="off" />
</typedef>
<typedef name = "Bool_1_0">
<paramtype kind="bool" formatTrue="1" formatFalse="0" />
</typedef>
<typedef name = "Cardinal">
<paramtype kind="number" lo="0" hi="65535" format="%d" />
</typedef>
......@@ -125,6 +129,7 @@
<syntax name="NameValue" format=" %%ParamName %%ParamValue" />
<syntax name="DoubleDash" format="--%%ParamName=%%ParamValue" />
<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".
......
......@@ -39,6 +39,11 @@
icon="iverilog.ico"
call="iverilog"/>
<menuitem name="cocotb"
label="Cocotb Python Verification"
icon="pv_logo_32x32.png"
call="cocotb"/>
<menuitem name="GTKWave"
label="GTKWave (Waves viewer)"
icon="gtkwave.ico"
......
......@@ -243,12 +243,19 @@
readonly="false" />
<parameter id="SimulationTopModule" label="Simulation top module" tooltip="Project top simulation module"
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"
type="Filename" default="" format="CopyValue" readonly="false" />
<parameter id="ImplementationTopModule" label="Implementation top module" tooltip="Project top implementation module"
type="String" default="" format="CopyValue" readonly="false" />
<parameter id="SimulDir" label="Simulation directory" tooltip="Project simulation directory"
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 -->
<parameter id="part" label="Device" tooltip= "FPGA part number (device) to use"
default="" visible="true" omit="" type="String" format="CopyValue"/>
......@@ -481,6 +488,9 @@
<group name="Simulation" label="Simulation properties">
"SimulationTopFile"
"SimulationTopModule"
"DUTTopFile"
"DUTTopModule"
"CocotbFilesDir"
"SimulDir"
</group>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*******************************************************************************
* 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.}
*******************************************************************************/
-->
<vdt-project>
<interface name="Cocotb" extends="FPGAPprojectInterface">
<!-- Syntax definitions -->
<typedef name="CocotbSimulatorsType">
<paramtype kind= "enum" base="String">
<item value="aldec" label="Aldec simulator"/>
<item value="cvc" label="CVC simulator"/>
<item value="ghdl" label="GHDL simulator"/>
<item value="icarus" label="Icarus Verilog simulator"/>
<item value="ius" label="IUS simulator"/>
<item value="modelsim" label="Modelsim simulator"/>
<item value="nvc" label="NVC simulator"/>
<item value="questa" label="Questa simulator"/>
<item value="vcs" label="VCS simulator"/>
</paramtype>
</typedef>
<syntax name="ListEqMultiline" format="%%ParamName = %(%%ParamValue%| \\n%)" />
<syntax name="ListEqMultilineAbs" format="%%ParamName = %($(PROJECT_ROOT)/%%ParamValue%| \\n%)" />
<syntax name="MakeCleanItems" format="clean::\n%(\t-@rm -f %%ParamValue%|\n%)"/>
<syntax name="ListEqComma" format="%%ParamName = %(%%ParamValue%|,%)" />
<syntax name="CocotbIncludeDirSyntax" format="%%ParamName += %(-I%%ParamValue%| %)" />
<syntax name="D_ParamSyntax" format="-D%%ParamName" />
<syntax name="g_ParamSyntax" format="-g%%ParamName" />
<syntax name="NospecifySyntax" format="-gno-specify" />
<syntax name="TopModuleSyntax" format="-s%%TopModule" />
<syntax name="TopModulesOtherSyntax" format="%(-s%%ParamValue%| %)" />
<syntax name="ModuleLibrarySyntax" format="%(-y%%ParamValue%| %)" />
<syntax name="IncludeDirSyntax" format="%(-I%%ParamValue%| %)" />
<syntax name="ExtraFilesSyntax" format="%(%%ParamValue%| %)" />
<syntax name="SwitchSyntax" format="-%%ParamName" />
<syntax name="GrepFindSyntax"
format="| { grep --line-buffered -E &quot;%%ParamValue&quot; || true; }" />
<syntax name="GrepSkipSyntax"
format="| { grep --line-buffered -v &quot;%%ParamValue&quot; || true; }" />
<syntax name="LogFileSyntax" format="%%ParamValue-%%BuildStamp.log" />
<syntax name="OutFileSyntax" format="%%ParamValue-%%BuildStamp.ivlg" />
<syntax name="FstFileSyntax" format="%%ParamValue-%%BuildStamp.fst" />
<syntax name="LogFileLatestSyntax"
format="ln -sf %%ParamValue-%%BuildStamp.log %SimulDir/%%ParamValue-latest.log;" />
<syntax name="OutputFileLatestSyntax"
format="ln -sf %%ParamValue-%%BuildStamp.ivlg %SimulDir/%%ParamValue-latest.ivlg;" />
<syntax name="FstFileLatestSyntax"
format="ln -sf %%ParamValue-%%BuildStamp.fst %SimulDir/%%ParamValue-latest.fst;" />
<!-- include file has target, not link value -->
<syntax name="FstParamFileSyntax"
format="parameter fstname=&quot;%%ParamValue-%%BuildStamp.fst&quot;;" />
<syntax name="IncludeParamSyntax" format="%(%%ParamValue%|\n%)" />
<!-- Types definitions -->
<typedef name="ModuleLibraryType" list="true">
<paramtype kind="string" default="" textkind="dir"
maxlength="256" sensitivity="sensitive" />
</typedef>
<typedef name="IncludeDirType" list="true">
<paramtype kind="string" default="" textkind="dir"
maxlength="256" sensitivity="sensitive" />
</typedef>
<typedef name="SwitchType">
<paramtype kind="bool" formatTrue="-%%ParamName"
formatFalse="" />
</typedef>
<typedef name="D_ParamType">
<paramtype kind="bool" formatTrue="-D%%ParamName"
formatFalse="" />
</typedef>
<typedef name="g_ParamType">
<paramtype kind="bool" formatTrue="-g%%ParamName"
formatFalse="" />
</typedef>
</interface>
<tool name="cocotb" project="FPGA_project" label="COroutine based COsimulation TestBench"
shell="bash"
package="FPGA_package"
interface="Cocotb"
errors="(.*):([0-9]+): [a-z_\- ]*error[: ]?(.*)"
warnings="(.*):([0-9]+): [a-z_\- ]*warning: (.*)"
info="(.*):([0-9]+): [a-z_\- ]*sorry: (.*)"
top-file="%CocotbDutTopFile"
define="COCOTB"
>
<extensions-list>
<extension mask="v" />
<extension mask="tf" />
</extensions-list>
<action-menu>
<action label="Simulate with Cocotb " resource="%CocotbDutTopFile"
check-extension="false" check-existence="true" icon="pv_wave.png" />
<action label="Regression analysis" resource="%CocotbDutTopFile"
check-extension="true" check-existence="true" icon="pv_hc.png" />
<action label="Clear Cocotb workspace" resource=""
check-extension="true" check-existence="true" icon="pv_eraser.png" />
</action-menu>
<parameter id="CocotbGUI" outid="GUI" type="Bool_1_0" format="NameEqValue"
default="false" label="GUI" tooltip="Set this to 1 to enable the GUI mode in the simulator (if supported)" />
<parameter id="CocotbSIM" outid="SIM" type="CocotbSimulatorsType" format="NameEqValue"
default="icarus" label="Simulator" tooltip="Selects which simulator Makefile to use. Attempts to include a simulator specific makefile from cocotb/makefiles/makefile.$(SIM)" />
<parameter id="CocotbVERILOG_SOURCES" outid="VERILOG_SOURCES" type="Filelist" label="Verilog sources" tooltip="Verilog source files (relative to project)"
format="ListEqMultilineAbs" default="%%FilteredSourceList" readonly="false" visible="true" />
<parameter id="CocotbVHDL_SOURCES" outid="VHDL_SOURCES" type="Filelist" label="VHDL sources" tooltip="VHDL source files (relative to project)"
format="ListEqMultilineAbs" default="" omit="" readonly="false" visible="true" />
<parameter id="CocotbCOMPILE_ARGS" outid="COMPILE_ARGS" type="String" label="Simulator compilation flags" tooltip="Any arguments or flags to pass to the compile stage of the simulation. Only applies to simulators with a separate compilation stage (currently Icarus and VCS)"
format="NameEqValue" default="" omit="" readonly="false" visible="true" />
<parameter id="CocotbSIM_ARGS" outid="SIM_ARGS" type="String" label="Simulator run flags" tooltip="Any arguments or flags to pass to the execution of the compiled simulation. Only applies to simulators with a separate compilation stage (currently Icarus and VCS)."
format="NameEqValue" default="-fst" omit="" readonly="false" visible="true" />
<parameter id="CocotbEXTRA_ARGS" outid="EXTRA_ARGS" type="String" label="Simulator flags" tooltip="Passed to both the compile and execute phases of simulators with two rules, or passed to the single compile and run command for simulators which don’t have a distinct compilation stage."
format="NameEqValue" default="" omit="" readonly="false" visible="true" />
<parameter id="CocotbCUSTOM_COMPILE_DEPS" outid="CUSTOM_COMPILE_DEPS" type="Filelist" label="Custom compile dependencies" tooltip="Any other dependencies but Verilog/VHDL sources (relative to project)."
format="ListEqMultilineAbs" default="" omit="" readonly="false" visible="true" />
<parameter id="CocotbCUSTOM_SIM_DEPS" outid="CUSTOM_SIM_DEPS" type="Filelist" label="Custom simulation dependencies" tooltip="Use to add additional dependencies to the simulation target (relative to project)."
format="ListEqMultilineAbs" default="" omit="" readonly="false" visible="true" />
<parameter id="CocotbDutTopFile"
label="Simulation top file" tooltip="File including top Verilog module of DUT"
default="%DUTTopFile"
type="String" format="CopyValue" />
<parameter id="CocotbDutTopModule" outid="TOPLEVEL" label="DUT top module" tooltip="DUT top module extracted from the chosen target file"
type="String" format="NameEqValue" default="%%TopModule"
readonly="true" visible="true" />
<parameter id="CocotbRANDOM_SEED" outid="RANDOM_SEED" type="LongCardinal" label="Random seed" tooltip="Seed the Python random module to recreate a previous test stimulus. At the beginning of every test a message is displayed with the seed used for that execution."
format="NameEqValue" default="0" omit="0" readonly="false" visible="true" />
<parameter id="COCOTB_ANSI_OUTPUT" outid="COCOTB_ANSI_OUTPUT" type="Bool_1_0" format="NameEqValue"
default="false" label="Force ANSI output" tooltip="Use this to override the default behaviour of annotating cocotb output with ANSI colour codes if the output is a terminal (isatty())." />
<parameter id="CocotbMODULE" outid="MODULE" type="Stringlist" label="Simulation Python module(s)" tooltip="The name of the module(s) to search for test functions."
format="ListEqComma" default="" omit="" readonly="false" visible="true" />
<parameter id="CocotbTESTCASE" outid="TESTCASE" type="Stringlist" label="Test funcion(s) to run" tooltip="The name of the test function(s) to run. If this variable is not defined cocotb discovers and executes all functions decorated with @cocotb.test() decorator in the supplied modules."
format="ListEqComma" default="" omit="" readonly="false" visible="true" />
<parameter id="MakeCleanPatterns" type="Stringlist" label="Make clean" tooltip="File patterns to remove at make clean"
format="MakeCleanItems" default="*.pyc results.xml" readonly="false" visible="true" />
<!-- <parameter id="CocotbMakefileDir" type="Pathname" label="Makefile directory" tooltip="Cocotb project Makefile directory"
format="CopyValue" default="%CocotbFilesDir" readonly="false" visible="true" />-->
<parameter id="CocotbRoot" outid="COCOTB" type="Pathname" label="Cocotb installation" tooltip="Cocotb installation root directory"
format="NameEqValue" default="%%PluginRoot/cocotb" readonly="false" visible="true" />
<parameter id="ProjectAbsolutePath" outid="PROJECT_ROOT" default="%%ProjectPath" label = "Project absolute path"
type="Pathname" format="NameEqValue" visible="true" />
<parameter id="GTKWaveSavFile" label="GTKWave sav file"
type="Filename" default="%%CurrentFileBase.sav" format="CopyValue"
omit="" readonly="false" />
<parameter id="ParsersRoot" outid="ParsersRoot" type="Pathname" label="Parsers root dir" tooltip="Tools output parsers root directory"
format="NameEqValue" default="%%ParsersPath" readonly="false" visible="true" />
<parameter id="CocotbIncludeDir" outid="COMPILE_ARGS" type="IncludeDirType"
format="CocotbIncludeDirSyntax" default="" label="Select include file directories"
omit="" readonly="false" visible="true" />
<parameter id="ShowWaves" type="BoolYesNo" format="None"
default="true" label="Show simulation result in waveform viewer" />
<parameter id="IcarusTopFile"
label="Simulation top file" tooltip="IVerilog simulator top file"
default="%SimulationTopFile"
type="String" format="CopyValue" />
<parameter id="Param_Shell_Options" label="Param_Shell_Options"
type="String" format="CopyValue" default="-c" readonly="false"
visible="true" />
<parameter id="Param_PreExe" label="Param_PreExe" type="String"
format="CopyValue" default="" readonly="false" visible="true" />
<parameter id="Param_Exe" label="Param_Exe" type="Filename"
format="CopyValue" default="iverilog" readonly="false"
visible="true" />
<parameter id="VVP_prefix" label="VVP command prefix" type="String"
format="CopyValue" default="time stdbuf -i0 -o0 -e0" omit="" readonly="false"
visible="true" />
<parameter id="VVP_Exe" label="VVP_Exe" type="Filename"
format="CopyValue" default="vvp" readonly="false"
visible="true" />
<parameter id="GtkWave_Exe" label="GtkWave_Exe" type="Filename"
format="CopyValue" default="gtkwave" readonly="false"
visible="true" />
<parameter id="Param_TopModule" label="Top module extracted from the chosen target file"
type="String" format="TopModuleSyntax" default="%%TopModule"
readonly="true" visible="true" />
<parameter id="TopModulesOther" type="Stringlist"
format="TopModulesOtherSyntax" default="" omit=""
label="Select top modules not referenced by the chosen target"
readonly="false" visible="true" />
<parameter id="ModuleLibrary" type="ModuleLibraryType"
format="ModuleLibrarySyntax" default="" label="Select additional libraries to include"
omit="" readonly="false" visible="true" />
<parameter id="ExtraFiles" type="Filelist" format="ExtraFilesSyntax"
default="" label="Select additional files to include" readonly="false"
visible="true" />
<parameter id="IncludeDir" type="IncludeDirType"
format="IncludeDirSyntax" default="" label="Select include file directories"
omit="" readonly="false" visible="true" />
<parameter id="legacy_model" outid="legacy_model" type="D_ParamType"
format="D_ParamSyntax" default="true" label="Use legacy model" />
<parameter id="no_specify" outid="no-specify" type="g_ParamType"
format="NospecifySyntax" default="true" label="Use no-specify" />
<!-- -->
<parameter id="v" type="SwitchType" format="SwitchSyntax"
default="true" label="Verbose" />
<!-- <parameter id="Param_SourceList" label="Param_SourceList"
type="Stringlist" format="SourceListSyntax" default="" readonly="true"
visible="true" /> -->
<parameter id="SourceListPar" label="Param_SourceList" type="Filelist"
format="ParamListSyntax" default="%%FilteredSourceList" readonly="true" visible="false" />
<parameter id="ShowNoProblem" type="BoolYesNo" format="None"
default="false" label="Show output with no errors/warnings" />
<parameter id="ShowWarnings" type="BoolYesNo" format="None"
default="true" label="Show output warnings" />
<parameter id="RemoveBugs" type="BoolYesNo" format="None"
default="false" label="Remove buggy simulator output" />
<parameter id="SaveLogsPreprocessor" type="BoolYesNo"
format="None" default="false" label="Save simulator preprocessor log output" />
<parameter id="SaveLogsSimulator" type="BoolYesNo" format="None"
default="false" label="Save simulator log output" />
<!-- Advanced Section -->
<parameter id="LogFile" label="Simulator log file prefix"
type="String" default="%%CurrentFileBase" format="LogFileSyntax"
readonly="false" />
<parameter id="OutFile" label="Simulator intermediate file prefix"
type="String" default="%%CurrentFileBase" format="OutFileSyntax"
readonly="false" />
<parameter id="FstDumpFile" label="Simulator FST dump file prefix"
type="String" default="%%CurrentFileBase" format="FstFileSyntax"
readonly="false" />
<parameter id="GrepFindErr" label="Grep pattern for errors only"
type="String" format="GrepFindSyntax" default="error" readonly="false"
visible="true" />
<parameter id="GrepFindErrWarn" label="Grep pattern for both errors and warnings"
type="String" format="GrepFindSyntax" default="error|warning|sorry"
readonly="false" visible="true" />
<parameter id="GrepSkip1" label="Grep skip pattern" type="String"
format="GrepSkipSyntax" default="(null)" readonly="false" visible="true" />
<parameter id="IVerilogOther" label="Other IVerilog options"
type="String" format="CopyValue" default="" omit=""
readonly="false" visible="true" />
<parameter id="IncludeParametersList" type="Stringlist"
format="IncludeParamSyntax" default="" omit=""
label="Verilog parameters definition to be included in the test fixture"
readonly="false" visible="true" />
<!-- Temporary inserted into the command line, will be removed -->
<parameter id="Param_1" label="Param_1" type="String"
format="CopyValue" default="" omit="" readonly="false" visible="true" />
<parameter id="Param_2" label="Param_2" type="String"
format="CopyValue" default="" omit="" readonly="false" visible="true" />
<parameter id="Param_3" label="Param_3" type="String"
format="CopyValue" default="" omit="" readonly="false" visible="true" />
<parameter id="Param_4" label="Param_4" type="String"
format="CopyValue" default="" omit="" readonly="false" visible="true" />
<!-- Invisible parameters, just pass calculated default values -->
<parameter id="IVerilogActionIndex" default="%%ChosenActionIndex"
type="String" format="CopyValue" visible="false" />
<!-- <parameter id="SourceList" format="SourceListSyntax"
type="Stringlist" default="" readonly="true" visible="false" /> -->
<parameter id="SourceListPar" label="Param_SourceList" type="Filelist"
format="ParamListSyntax" default="%%FilteredSourceList" readonly="true" visible="false" />
<parameter id="iverilog_include_file" default="IVERILOG_INCLUDE.v"
type="Filename" format="CopyValue" visible="false" />
<parameter id="FstDumpFileParameter" default="%FstDumpFileFull"
type="String" format="FstParamFileSyntax" visible="false" />
<parameter id="LogFileLatest" default="%LogFile"
type="String" format="LogFileLatestSyntax" visible="false" />
<parameter id="OutFileLatest" type="String" default="%OutFile"
format="OutputFileLatestSyntax" visible="false" />
<parameter id="FstDumpFileLatest" default="%FstDumpFile"
type="String" format="FstFileLatestSyntax" visible="false" />
<parameter id="LogFileFull" default="%SimulDir/%LogFile"
visible="false" type="String" format="LogFileSyntax"/>
<parameter id="OutFileFull" default="%SimulDir/%OutFile"
visible="false" type="String" format="OutFileSyntax"/>
<parameter id="FstDumpFileFull" default="%%ProjectPath/%SimulDir/%FstDumpFile"
visible="false" type="String" format="FstFileSyntax"/>
<!-- <parameter id="cocotbMakefile" default="%CocotbMakefileDir/Makefile"
type="Filename" format="CopyValue" visible="false" /> -->
<parameter id="cocotbMakefile" default="%CocotbFilesDir/Makefile"
type="Filename" format="CopyValue" visible="false" />
<parameter id="cocotbInstallDir" default="%CocotbRoot"
type="String" format="CopyValue" visible="false" /> -->
<input>
<group name="cocotb" label="Cocotb">
"CocotbGUI"
"CocotbSIM"
"CocotbVERILOG_SOURCES"
"CocotbVHDL_SOURCES"
"CocotbCOMPILE_ARGS"
"CocotbSIM_ARGS"
"CocotbEXTRA_ARGS"
"CocotbCUSTOM_COMPILE_DEPS"
"CocotbCUSTOM_SIM_DEPS"
"CocotbDutTopFile"
"CocotbDutTopModule"
"CocotbRANDOM_SEED"
"COCOTB_ANSI_OUTPUT"
"CocotbMODULE"
"CocotbTESTCASE"
"CocotbRoot"
"CocotbFilesDir"
"CocotbIncludeDir"
"MakeCleanPatterns"
"ShowWaves"
"GTKWaveSavFile"
<!-- "CocotbMakefileDir" -->
"ParsersRoot"
"ProjectAbsolutePath"
</group>
<group name="files" label="Files">
<!-- "SimulationTopFile" -->
"IcarusTopFile"
"Param_TopModule"
"TopModulesOther"
"ExtraFiles"
"ModuleLibrary"
"IncludeDir"
"IncludeParametersList"
</group>
<group name="options" label="Options">
<!--"ShowWaves" -->
"ShowNoProblem"
"ShowWarnings"
"RemoveBugs"
"SaveLogsPreprocessor"
"SaveLogsSimulator"
"v"
"legacy_model"
"no_specify"
</group>
<group name="Advanced" label="Advanced">
"Param_PreExe"
"Param_Exe"
"Param_Shell_Options"
"IVerilogOther"
"VVP_prefix"
"VVP_Exe"
"GtkWave_Exe"
"LogFile"
"OutFile"
"FstDumpFile"
"GrepFindErr"
"GrepFindErrWarn"
"GrepSkip1"
"Param_1"
"Param_2"
"Param_3"
"Param_4"
</group>
</input>
<output>
<line name="install_cocotb"
sep=" "
success = "COCOTB INSTALLED"
>
"%Param_Shell_Options"
"if [ -d '%cocotbInstallDir' ]; then"
"echo 'COCOTB INSTALLED';"
"exit 0;"
"else"
"cd %%PluginRoot;"
"git clone https://github.com/potentialventures/cocotb.git ;"
"fi;"
"if [ -d '%cocotbInstallDir' ]; then"
"echo 'COCOTB INSTALLED';"
"exit 0;"
- "else echo 'FAILURE';"
"fi"
<!--
"%Param_Shell_Options"
"while true; do"
" read -p 'Do you wish to install this program? ' yn;"
" case $yn in"
" [Yy]* ) echo 'Installing...'; break;;"
" [Nn]* ) exit;;"
" * ) echo 'Please answer yes or no.';;"
" esac"
"done"
-->
</line>
<!-- TODO: watch for new lines inserted inside quoted tokens during autoformat - they break output
Maybe add filter to the code to transform white spaces -->
<line name="command_line"
sep=" "
success = "SIMULATION FINISHED SUCCESSFULLY"
failure = "recipe for target '[^']*' failed"
>
<!-- success="SIMULATION FINISHED SUCCESSFULLY" -->
"%Param_Shell_Options"
"%Param_PreExe"
<!-- MKDIR - ALWAYS -->
"mkdir -p"
"%SimulDir"
";"
"cd %CocotbFilesDir"
";"
<if IVerilogActionIndex="0">
"make sim;"
"if [ $? -ne 0 ]; then echo 'SIMULATION FAILED'; sleep 1; exit 1; fi;"
<!-- Add gtkwave here -->
<if ShowWaves="true">
"if [ $? -eq 0 ]; then"
"%GtkWave_Exe"
"%FstDumpFileFull"
"%GTKWaveSavFile"
"&lt;/dev/null &amp;&gt;/dev/null"
"&amp; \n"
"fi;"
</if>
</if>
<if IVerilogActionIndex="1">
"make regression;"
</if>
<if IVerilogActionIndex="2">
"make clean;"
</if>
"if [ $? -eq 0 ]; then echo 'SIMULATION FINISHED SUCCESSFULLY'; else echo 'SIMULATION FAILED'; fi;"
"sleep 1"
</line>
<line name="IverilogIncludeFile" dest="iverilog_include_file"
sep="\n">
"%FstDumpFileParameter"
"%IncludeParametersList"
</line>
<line name="CocotbMakefile" dest="cocotbMakefile"
sep="\n">
"%ProjectAbsolutePath"
"%CocotbDutTopModule"
"%CocotbMODULE"
"%CocotbTESTCASE"
"%CocotbVERILOG_SOURCES"
"%CocotbVHDL_SOURCES"
"%CocotbGUI"
"%CocotbSIM"
"%CocotbCOMPILE_ARGS"
<!-- Always include top project dir (where IVERILOG_INCLUDE.v is) -->
"COMPILE_ARGS += -I/$(PROJECT_ROOT)"
"%CocotbIncludeDir"
"%CocotbSIM_ARGS"
"%CocotbEXTRA_ARGS"
"%CocotbCUSTOM_COMPILE_DEPS"
<!--"CUSTOM_COMPILE_DEPS += %%ProjectPath/IVERILOG_INCLUDE.v"-->
""CUSTOM_COMPILE_DEPS += $(PROJECT_ROOT)/IVERILOG_INCLUDE.v
"%CocotbCUSTOM_SIM_DEPS"
"%CocotbRANDOM_SEED"
"%COCOTB_ANSI_OUTPUT"
"%CocotbRoot"
"include $(COCOTB)/makefiles/Makefile.inc"
"include $(COCOTB)/makefiles/Makefile.sim"
"%MakeCleanPatterns"
<!-- "clean::"
"\t-@rm -f *.pyc"
"\t-@rm -f *.jpg"
"\t-@rm -f results.xml" -->
</line>
</output>
</tool>
</vdt-project>
......@@ -93,7 +93,8 @@
<tool name="iverilog" project="FPGA_project" label="Icarus Verilog compiler"
shell="bash"
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: (.*)"
info="(.*):([0-9]+): [a-z_\- ]*sorry: (.*)"
top-file="%IcarusTopFile"
......@@ -290,6 +291,7 @@
<parameter id="FstDumpFileFull" default="%SimulDir/%FstDumpFile"
visible="false" type="String" format="FstFileSyntax"/>
<input>
<group name="files" label="Files">
<!-- "SimulationTopFile" -->
......@@ -336,13 +338,17 @@
<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 -->
<line name="command_line" sep=" ">
<line name="command_line"
sep=" "
success = "SIMULATION FINISHED SUCCESSFULLY"
>
"%Param_Shell_Options"
"%Param_PreExe"
<!-- MKDIR - ALWAYS -->
"mkdir -p"
"%SimulDir"
";"
<!-- "(&gt;&amp;2 echo 'unisims/RAMB36E1.v:100: warning: choosing typ expression.');" -->
<if SaveLogsPreprocessor="true"
SaveLogsSimulator="true">
"touch"
......@@ -366,6 +372,8 @@
"%Param_TopModule"
"%TopModulesOther"
"%ModuleLibrary"
<!-- Always include top project dir (where IVERILOG_INCLUDE.v is) -->
"-I%%ProjectPath"
"%IncludeDir"
"%legacy_model"
"%no_specify"
......@@ -416,10 +424,14 @@
"%GtkWave_Exe"
"%FstDumpFileFull"
"%GTKWaveSavFile"
"&lt;/dev/null &amp;&gt;/dev/null"
"&amp; "
</if>
"%Param_4"
</if-not>
"if [ $? -eq 0 ]; then echo 'SIMULATION FINISHED SUCCESSFULLY'; else echo 'SIMULATION FAILED'; fi;"
"sleep 1"
</line>
<line name="IverilogIncludeFile" dest="iverilog_include_file"
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