Skip to content

Commit 81b85bd

Browse files
committed
small update to installation manual
also includes a bug fix for the backend, to handle VGA x and y arguments properly (the code did not allow the full range of these arguments)
1 parent 200e357 commit 81b85bd

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

backend/sim_task.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,19 @@ static int CheckArgs(vpiHandle handle, PLI_INT32 type, int size) {
9898
return 0;
9999
}
100100

101+
/**
102+
* Helper function for MyCompiletf specifically for VGA args, which have a legal range
103+
* @return return 1 if the argument is not proper, o/w return 0
104+
*/
105+
static int CheckArgsRange(vpiHandle handle, PLI_INT32 type, int lsize, int hsize) {
106+
int actual = vpi_get(vpiSize, handle);
107+
if (handle == NULL || vpi_get(vpiType, handle) != type || (actual < lsize) || (actual > hsize)){
108+
PrintUsageError(handle);
109+
return 1;
110+
}
111+
return 0;
112+
}
113+
101114

102115
static void PrintUsageError(vpiHandle handle) {
103116
vpi_printf_helper(USAGE "\n");
@@ -171,15 +184,14 @@ static int MyCompiletf(PLI_BYTE8 *user_data) {
171184
return 0;
172185
}
173186

174-
175187
// Arguments for VGA
176188
vpiHandle x_handle = vpi_scan(args);
177-
if(CheckArgs(x_handle, vpiNet, 8)){
189+
if(CheckArgsRange(x_handle, vpiNet, 8, 10)){
178190
return 0;
179191
}
180192

181193
vpiHandle y_handle = vpi_scan(args);
182-
if(CheckArgs(y_handle, vpiNet, 7)){
194+
if(CheckArgsRange(y_handle, vpiNet, 7, 9)){
183195
return 0;
184196
}
185197

documentation/installation/DESim_install.tex

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,14 @@ \section{Configuring the DESim Application}
115115
replace \texttt{<SimulatorPath>} with the actual location of the folder where you have
116116
installed your Simulator.
117117

118-
In most cases you will not need to make any other changes to {\it DESim\_run.bat}, and you
119-
should be ready to execute this batch script to start {\it DESim}. Complete instructions for
120-
using the {\it DESim} application are provided in the {\it docs} folder listed in
118+
In most cases you will not need to make any other changes
119+
\footnote{If your {\it Questa} (or {\it ModelSim}) version requires a license, then you should
120+
make an \texttt{LM\_LICENSE\_FILE} environment variable that specifies the location of your
121+
{\it license file}. But if you cannot set this variable, then the {\it DESim\_run.bat} file
122+
describes a command-line option that can be used to specify your license-file location.}
123+
to the {\it DESim\_run.bat} file, and you
124+
should be ready to execute this batch script to start the {\it DESim} application. Complete
125+
instructions for using {\it DESim} are provided in the {\it docs} folder listed in
121126
Figure~\ref{fig:install}, and also in the
122127
\texttt{DESim} section of {\small \href{https://www.fpgacademy.org/tools.html}
123128
{FPGAcademy.org}}.

0 commit comments

Comments
 (0)