Commit d2d7c636 authored by Andrey Filippov's avatar Andrey Filippov

Configuring tools for IVerilog & GTKWave + minor bug fixes

parent ed18a78f
......@@ -17,10 +17,12 @@
*******************************************************************************/
package com.elphel.vdt.core.tools.generators;
//import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFile;
//import org.eclipse.core.resources.IResource;
//import org.eclipse.ui.IPageLayout;
import org.eclipse.core.runtime.Path;
import com.elphel.vdt.VDT;
import com.elphel.vdt.ui.variables.SelectedResourceManager;
......@@ -33,12 +35,10 @@ public class CurrentFileBaseGenerator extends AbstractGenerator {
protected String[] getStringValues() {
// IResource resource = SelectedResourceManager.getDefault().getSelectedResource();
String fullName=SelectedResourceManager.getDefault().getChosenTarget();
// if((resource != null) && (resource.getType() == IResource.FILE)) {
// String fullName=((IFile)resource).getLocation().toOSString();
if (fullName!=null){
int dot = fullName.lastIndexOf('.');
return new String[] { (dot <0) ? fullName : fullName.substring(0, dot) };
String name=SelectedResourceManager.getDefault().getChosenShort(); // last segment of the file name
if (name!=null){
int dot = name.lastIndexOf('.');
return new String[] { (dot>=0)? name.substring(0, dot): name };
}
return new String[] { "" };
}
......
......@@ -346,9 +346,9 @@ public class Parameter implements Cloneable, Updateable {
}
public List<String> getCurrentValue() {
if (id.equals("SimulationTopFile")){ // Andrey
System.out.println("getCurrentValue() SimulationTopFile, value="+currentValue);
}
// if (id.equals("SimulationTopFile")){ // Andrey
// System.out.println("getCurrentValue() SimulationTopFile, value="+currentValue);
// }
if(currentValue.isEmpty())
return null;
......
......@@ -64,6 +64,7 @@ public class SelectedResourceManager implements IWindowListener, ISelectionListe
//Andrey
private String fChosenTarget=null; // full path of the chosen (for action) resource or any string. Used to calculate CurrentFile, verilog file, ...
private String fChosenShort=null; // last segment of the chosen resource name
private IResource fChosenVerilogFile = null; // to keep fSelectedVerilogFile
private int fChosenAction=0; // Chosen variant of running the tool
private long timestamp=0;
......@@ -255,6 +256,11 @@ public class SelectedResourceManager implements IWindowListener, ISelectionListe
fChosenVerilogFile=file;
else if (fChosenVerilogFile==null)
fChosenVerilogFile=fSelectedVerilogFile;
if (file!=null){
fChosenShort=file.getName(); // last segment
} else {
fChosenShort=fChosenTarget; // whatever
}
}
public String setBuildStamp(){
......@@ -270,6 +276,9 @@ public class SelectedResourceManager implements IWindowListener, ISelectionListe
public String getChosenTarget() {
return fChosenTarget;
}
public String getChosenShort() {
return fChosenShort;
}
public IResource getChosenVerilogFile() {
return (fChosenVerilogFile!=null)?fChosenVerilogFile:fSelectedVerilogFile;
......
......@@ -522,7 +522,15 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
enabled=(selectedItem != null);
if (enabled && runFor[i].getCheckExistence()){
IPath path = new Path(name);
IFile file = (path==null)?null:project.getFile(path);
IFile file = null;
if (path!=null) {
try {
file = project.getFile(path);
} catch (IllegalArgumentException e) {
}
}
if (file==null){
// System.out.println(name+" does not exist");
enabled=false;
......
......@@ -31,16 +31,6 @@
</typedef>
<syntax name="QuotedFileListSyntax" format="--%%ParamName %(&quot;%%FileList&quot;%| %)" />
<syntax name="QuotedTopModuleSyntax" format="--%%ParamName=%%TopModule" />
<syntax name="QuotedTopModulesSyntax" format="--%%ParamName %(&quot;%%TopModules&quot;%| %)" />
<syntax name="QuotedSourceListSyntax" format="--%%ParamName %(&quot;%%SourceList&quot;%| %)" />
<syntax name="QuotedCurrentFileSyntax" format="--%%ParamName=&quot;%%CurrentFile&quot;" />
<syntax name="QuotedCurrentFileBaseSyntax" format="--%%ParamName=&quot;%%CurrentFileBase&quot;" />
<syntax name="QuotedProjectNameSyntax" format="--%%ParamName=&quot;%%ProjectName&quot;" />
<!-- Actually used -->
<syntax name="JustValueSyntax" format="%%ParamValue"></syntax>
<syntax name="TopModuleSyntax" format="-s%%TopModule" />
......@@ -56,17 +46,21 @@
<syntax name="BuildStampSyntax" format="%%BuildStamp" />
<syntax name="GrepFindSyntax"
format="| grep --line-buffered -E &quot;%%ParamValue&quot;" />
format="| { grep --line-buffered -E &quot;%%ParamValue&quot; || true; }" />
<syntax name="GrepSkipSyntax"
format="| grep --line-buffered -v &quot;%%ParamValue&quot;" />
<syntax name="LogFileSyntax" format="| tee %%ParamName%%BuildStamp.log" />
format="| { grep --line-buffered -v &quot;%%ParamValue&quot; || true; }" />
<syntax name="LogFileSyntax" format="%%ParamValue-%%BuildStamp.log" />
<syntax name="OutputFileSyntax" format="%%ParamValue-%%BuildStamp.ivlg" />
<!-- typedef -->
<syntax name="LxtFileSyntax" format="%%ParamValue-%%BuildStamp.lxt" />
<syntax name="LxtParamFileSyntax"
format="parameter lxtname=&quot;%%ParamValue-%%BuildStamp.lxt&quot;;" />
<!-- <syntax name="LxtParamFileSyntax" format="parameter lxtname=%%ParamValue;"
/> -->
<syntax name="IncludeParamSyntax" format="%(%%ParamValue%|\n%)" />
<typedef name="MyTypeList" list="true">
<paramtype kind="string" maxlength="256" sensitivity="sensitive" />
</typedef>
<!-- typedef -->
<typedef name="ExtraFilesType" list="true">
<paramtype kind="string" textkind="file" maxlength="256"
......@@ -130,6 +124,8 @@
check-extension="false" check-existence="true" icon="iverilog.ico" />
<action label="Simulate for" resource="%%SelectedFile"
check-extension="true" check-existence="true" />
<action label="Verify" resource="%%SelectedFile"
check-extension="true" check-existence="true" icon="newmod_wiz.gif" />
<action label="Empty" resource="" icon="sample.gif" />
<action label="Just try for" resource="%%OS" />
</action-menu>
......@@ -147,22 +143,22 @@
format="exeFileSyntax" default="/usr/bin/iverilog" readonly="false"
visible="true" />
<parameter id="Param_TopModule" label="Param_TopModule"
<parameter id="Param_TopModule" label="Top module extracted from the chosen target file"
type="StringType" format="TopModuleSyntax" default="%%TopModule"
readonly="true" visible="true" />
<parameter id="TopModulesOther" type="StringListType"
format="TopModulesOtherSyntax" default="" omit=""
label="Select top modules (not referenced by other modules)"
label="Select top modules not referenced by the chosen target"
readonly="false" visible="true" />
<parameter id="ModuleLibrary" type="ModuleLibraryType"
format="ModuleLibrarySyntax" default="" label="Select libraries to include"
format="ModuleLibrarySyntax" default="" label="Select additional libraries to include"
omit="" readonly="false" visible="true" />
<parameter id="ExtraFiles" type="ExtraFilesType" format="ExtraFilesSyntax"
default="" label="Select extra files to include" readonly="false"
default="" label="Select additional files to include" readonly="false"
visible="true" />
......@@ -172,24 +168,14 @@
<parameter id="NoSpecify" outid="no-specify" type="NoSpecifyType"
format="g_ParamSyntax" default="true" label="Use no-specify" />
<!-- -->
<parameter id="SourceList" type="MyTypeList" format="SourceListSyntax"
default="" readonly="true" visible="false" />
<!-- -->
<parameter id="v" type="SwitchType" format="SwitchSyntax"
default="true" label="Verbose" />
<parameter id="Param_SourceList" label="Param_SourceList"
type="MyTypeList" format="SourceListSyntax" default="" readonly="true"
type="StringListType" format="SourceListSyntax" default="" readonly="true"
visible="true" />
<parameter id="Filter_String" label="Filter_String" type="StringType"
format="JustValueSyntax"
default="2&gt;&amp;1 | tee %LogFile | grep --line-buffered -E 'error|warning' | grep --line-buffered -v &quot;(null):0&quot;"
readonly="false" visible="true" />
<parameter id="DbgCurrentFile" label="DbgCurrentFile" type="StringType"
format="DbgCurrentFileSyntax" default="" readonly="false" visible="true" />
......@@ -197,12 +183,6 @@
type="StringType" format="DbgChosenActionIndexSyntax" default=""
readonly="false" visible="true" />
<!-- intentional error below - duplicate -->
<parameter id="ShowNoProblem" type="BoolYesNo" format="None"
default="false" label="Show output with no errors/warnings" />
......@@ -212,14 +192,33 @@
<parameter id="RemoveBugs" type="BoolYesNo" format="None"
default="false" label="Remove buggy simulator output" />
<parameter id="SaveLogs" type="BoolYesNo" format="None"
<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" />
<parameter id="ShowWaves" type="BoolYesNo" format="None"
default="true" label="Show simulation result in waveform viewer" />
<!-- Advanced Section -->
<parameter id="LogFile" label="Simulator log file prefix"
type="StringType" default="iverilog" format="LogFileSyntax" readonly="false" />
type="StringType" default="%%CurrentFileBase" format="LogFileSyntax"
readonly="false" />
<parameter id="OutFile" label="Simulator intermediate file prefix"
type="StringType" default="%%CurrentFileBase" format="OutputFileSyntax"
readonly="false" />
<parameter id="LxtDumpFile" label="Simulator LXT dump file prefix"
type="StringType" default="%%CurrentFileBase" format="LxtFileSyntax"
readonly="false" />
<parameter id="GTKWaveSavFile" label="GTKWave sav file"
type="FileType" default="%%CurrentFileBase.sav" format="ValueSyntax"
omit="" readonly="false" />
<parameter id="GrepFindErr" label="Grep pattern for errors only"
type="StringType" format="GrepFindSyntax" default="error" readonly="false"
......@@ -232,71 +231,171 @@
<parameter id="GrepSkip1" label="Grep skip pattern" type="StringType"
format="GrepSkipSyntax" default="(null)" readonly="false" visible="true" />
<parameter id="Param_1" label="Param_1" type="StringType"
format="JustValueSyntax" default="" omit="" readonly="false" visible="true" />
<parameter id="Param_2" label="Param_2" type="StringType"
format="JustValueSyntax" default="" omit="" readonly="false" visible="true" />
<parameter id="Param_3" label="Param_3" type="StringType"
format="JustValueSyntax" default="" omit="" readonly="false" visible="true" />
<parameter id="Param_4" label="Param_4" type="StringType"
format="JustValueSyntax" default="" omit="" readonly="false" visible="true" />
<parameter id="IVerilogOther" label="Other IVerilog options"
type="StringType" format="JustValueSyntax" default="" omit=""
readonly="false" visible="true" />
<parameter id="IncludeParametersList" type="StringListType"
format="IncludeParamSyntax" default="" omit=""
label="Verilog parameters definition to be included in the test fixture"
readonly="false" visible="true" />
<!-- Invisible parameters -->
<parameter id="IVerilogActionIndex" type="StringType"
format="JustValueSyntax" visible="false" default="%%ChosenActionIndex" />
<parameter id="SourceList" type="StringListType" format="SourceListSyntax"
default="" readonly="true" visible="false" />
<parameter id="iverilog_include_file" type="FileType"
default="IVERILOG_INCLUDE.v" format="JustValueSyntax" visible="false" />
<input>
<group name="files" label="Files">
<!-- "SimulationTopFile" -->
"Param_PreExe"
"Param_Exe"
"Param_Shell_Options"
"Param_TopModule"
"TopModulesOther"
"ModuleLibrary"
"ExtraFiles"
</group>
<group name="options" label="Options">
"ShowNoProblem"
"ShowWarnings"
"RemoveBugs"
"SaveLogs"
"v"
"LegacyModel"
"NoSpecify"
</group>
<group name="Advanced" label="Advanced">
"LogFile"
"GrepFindErr"
"GrepFindErrWarn"
"GrepSkip1"
</group>
</input>
<output>
<line name="command_line" sep=" ">
"%Param_Shell_Options"
"%Param_PreExe"
"%Param_Exe"
"%Param_TopModule"
"%TopModulesOther"
"%ModuleLibrary"
"%LegacyModel"
"%NoSpecify"
"%v"
"%SourceList"
"%ExtraFiles"
<if ShowNoProblem="false">
"2&gt;&amp;1"
</if>if>
<if SaveLogs="true">
"%LogFile"
</if>
<if ShowNoProblem="false">
<if ShowWarnings="true">
"%GrepFindErrWarn"
<parameter id="LxtDumpFileParameter" type="StringType"
default="%LxtDumpFile" format="LxtParamFileSyntax" visible="false" />
<input>
<group name="files" label="Files">
<!-- "SimulationTopFile" -->
"Param_TopModule"
"TopModulesOther"
"ExtraFiles"
"ModuleLibrary"
"GTKWaveSavFile"
"IncludeParametersList"
</group>
<group name="options" label="Options">
"ShowWaves"
"ShowNoProblem"
"ShowWarnings"
"RemoveBugs"
"SaveLogsPreprocessor"
"SaveLogsSimulator"
"v"
"LegacyModel"
"NoSpecify"
</group>
<group name="Advanced" label="Advanced">
"Param_PreExe"
"Param_Exe"
"Param_Shell_Options"
"IVerilogOther"
"LogFile"
"OutFile"
"LxtDumpFile"
"GrepFindErr"
"GrepFindErrWarn"
"GrepSkip1"
"Param_1"
"Param_2"
"Param_3"
"Param_4"
</group>
</input>
<output>
<line name="command_line" sep=" ">
"%Param_Shell_Options"
"%Param_PreExe"
"trap 'killall iverilog; ' EXIT;"
"echo 'current PID='$$;"
"%Param_Exe"
"-o"
<if IVerilogActionIndex="2">
"/dev/null"
</if>
<if-not IVerilogActionIndex="2">
"%OutFile"
</if-not>
" -D IVERILOG"
"%IVerilogOther"
"%Param_TopModule"
"%TopModulesOther"
"%ModuleLibrary"
"%LegacyModel"
"%NoSpecify"
"%v"
"%SourceList"
"%ExtraFiles"
<if ShowNoProblem="false">
"2&gt;&amp;1"
</if>
<if ShowWarnings="false">
"%GrepFindErr"
<if SaveLogsPreprocessor="true">
"| tee"
"%LogFile"
</if>
<if RemoveBugs="true">
"%GrepSkip1"
<if ShowNoProblem="false">
<if ShowWarnings="true">
"%GrepFindErrWarn"
</if>
<if ShowWarnings="false">
"%GrepFindErr"
</if>
<if RemoveBugs="true">
"%GrepSkip1"
</if>
</if>
</if>
</line>
</output>
"|| { echo '*** iverilog failed ***'; exit 1; } ;"
"trap '' EXIT;"
<if-not IVerilogActionIndex="2">
<!-- "time vvp -v" -->
"%Param_1"
"trap 'killall vvp; ' EXIT;"
"vvp -v"
"%Param_2"
"%OutFile"
"-lxt2 "
<if SaveLogsSimulator="true">
<if SaveLogsPreprocessor="true">
"| tee -a"
"%LogFile"
</if>
<if-not SaveLogsPreprocessor="true">
"| tee"
"%LogFile"
</if-not>
</if>
"|| { echo '*** vvp failed ***'; exit 1; } ;"
"trap '' EXIT;" <!-- no
trap for GTKWave -->
<!-- "%Param_2" -->
"%Param_3"
<if ShowWaves="true">
"gtkwave"
"%LxtDumpFile"
"%GTKWaveSavFile"
"&amp;"
</if>
"%Param_4"
</if-not>
</line>
<line name="IverilogIncludeFile" dest="iverilog_include_file"
sep="\n">
"%LxtDumpFileParameter"
"%IncludeParametersList"
</line>
</output>
</tool>
<!-- "echo %SimulationTopFile %%CurrentFile ;" -->
<!-- "-s counter_tb" "%SourceList" -->
<!-- <parameter id = "xc_config_file" type = "Filename" default = "xc.cfg"
format = "Option" visible = "false" /> || { echo "iverilog failed"; exit
1; } ; time vvp -v x353mjpeg_test -lxt2 || { echo "vvp failed"; exit 1; }
; || { echo "iverilog failed"; exit 1; } time vvp -v x353mjpeg_test -lxt2
|| { echo "vvp failed"; exit 1; } gtkwave x353.lxt x353_1.sav & exit 0 -->
</vdt-project>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment