Commit Graph

255 Commits

Author SHA1 Message Date
Jim Monte 88653fa998 Fixed assorted compiler warnings, memory leaks, etc. 2020-03-07 23:46:58 -05:00
Jim Monte 8d903d8e30 Merge branch 'pre-master' of ssh://git.code.sf.net/p/ngspice/ngspice into beta_jdm 2020-03-03 09:59:30 -05:00
Holger Vogt ab12ad574e remove xgraph in ngspice shared lib 2020-03-02 18:13:35 +01:00
dwarning 2c8f59d77a add wincolor 2020-02-24 15:09:39 +01:00
Jim Monte b945fb3733 Merging with pre-master 2020-02-24 02:48:13 -05:00
dwarning 89b691e70f no xgraph anymore 2020-02-23 21:58:13 +01:00
Holger Vogt 3e197c954e remove all the remains of quote() and strip() that had been
used to modify the eigths bit of a character or string.
The functions had been switched off some time ago.
We now need all bits of a char for extended ascii or utf8
2020-02-22 09:55:44 +01:00
Holger Vogt e595347819 remove the remains of the old xgraph program
that has not been supported for many years
2020-02-22 09:55:35 +01:00
Holger Vogt a709512a86 add color selection to WinGui plots 2020-02-22 09:51:21 +01:00
Holger Vogt a951d121ea undo EXT_ASC 2020-02-22 09:50:39 +01:00
Holger Vogt 03d14660cf add optional HAVE_XFT and EXT_ASC for Visual Studio 2020-02-22 09:50:12 +01:00
Holger Vogt 6ce9003d3d update to cmpp by J. Monte 2020-02-12 23:13:08 +01:00
Jim Monte aee256e211 Fix of buffer overrun in interpolation at endpoint of interval. Made cfunc.mod for tables more modular. Prevented buffer overrun when building file name. Added error checking for allocation failures in many locations. Made binary search for interpolation more efficient. 2020-02-12 22:33:52 +01:00
Jim Monte d33b31b3a9 Minor merge issues 2020-01-29 01:42:37 -05:00
Jim Monte da9bcc050f Merge branch 'pre-master' of ssh://git.code.sf.net/p/ngspice/ngspice into beta_jdm
Fixed some uses of const

Changed dstring to use allocations that are serialized by mutex when
needed
but can fail without terminating the program. Also changed calls to free()
to
use a replacement (txfree()) that will serialize when necessary.

Removed flag fields from Model_Info_t and Node_Info_t since they were no
longer required.

Reverted OK back to 0 in cmpp. There were issues with OK conflicting with
another macro definition of OK due to a header inclusion.

Added functions for writing new code model and UDN information.

Added function output_paths_from_lst_file() to extract paths in more
general
lst format.

Used new function fbget() in cmpp to get data from lst file.

Made reomval of trailing slash in cmpp an inline function for modularity.

Removed restrictions on line length and related items in cmpp by
dynamically
resizizng as required.

Reduced the number of allocation calls when storing model info and
user-defined type information in cmpp while reading lst files by doubling
the
size when resizing rather than increasing the size by 1. Also added checks
for
failure that were not present. These things were also done for
user-defined
types, which are processed in a similar way.

Fixed potential buffer overrun in cmpp function read_model_names() while
building the path. Also the path name is built more efficiently by
maintining
the current location in the output string instead of repeatedly finding it
via
strcat(). These things were also done for the corresponding function for
user-defined nodes.

To support versioning, a group of "filebuf" functions were written to get
the
path names and version numbers from a .lst file having a more flexible
format.

Added checks for failure in cmpp function read_model_names() while setting
the
name of the model and the function.

Developed a more modular and efficient method of testing for duplicate
SPICE
models, etc. in cmpp. Instead of nested for loops, the items are compared
in a
sorted order, so that a single pass needs to be done. This method also
avoids
the need of several flag variables that are used to check if a duplicate
is
being found multiple times. A related functions test_for_duplicates() was
written to perform a generic test of any of the uniquness conditions
checked,
along with a sort function and functions to report errors.

In cmpp, function fopen_cmpp was changed into a function that generates
the
file name but does not open the file (gen_filename()) followed by a
standard
fopen. This change prevented error messages from fopen_cmpp() from causing
an
access violation of the name of the file was not allocated properly. It
also
separtes the input file name from the output file name, so it is clearer
what
is being freed when the output file name is freed at the end of the
function.

Added checks for failure of fclose() in several places. Often a small file
is
not written at all on disk until fclose is called.

Added a function to write version 2 code model info into cminfo2.h. A
similar
function was written for udninfo.h.

Wrote functions to free Model_Info_t and Node_Info_t structures.

Added checks to all output file operations to ensure that the files that
are
generated are correct. This change involved adding tests to the individual
functions outputting data and adding return codes and checks of them in
functions doing output.

Combined several small file outputs into larger ones while adjusting the
format of the text being ouptut to keep the clarity of what is being
written
while reducing the number of function calls.

In functions like cmpp function dta_type_to_str(), strings were returned
directly instead of making a copy that was not necessary. This change
eliminated the copy, made the functions thread safe, and eliminated
allocations. The allocations were not checked for failure, so the change
also
prevented problems associated with failures of these allocations.

In value_to_string(), the elimination of the allocation and copy were not
possible due to retain the value of the string, but the allocation was
checked
for failure where it was not and the resize was also checked.

In integer_to_str(), a buffer size was used that was a function of the
size of
the data to fill it rather than an unrelated size that was most likely too
large. Also due to the reduced size, a stack-based buffer was used.

Fixed a bug in table-generator-b4-2d.sp where the plot names are incorrect
if
the script is called from a running instance of ngspice that has already
created some plot names that would cause conflicts. Also commented this
issue.

Added functions to the structure communicating between ngspice and code
models
to support required memory functions so that the code models, which are
running in the same address space, will have serialized allocations when
that
is required.

Reorganized memory allocations to allow for "raw" allocations that are
serialized when required. Essentially the allocation functions were
decomposed
into part that does not require serialization and part that does. Aside
from
exposing the "raw" allocations, this change made the functions clearer and
fixed an issue where free was being called without mutex protection when
it
would be required. Also, tstrdup() and tstrdup_raw() were written so that
serialization would be available in strdup(). If the other allocation
functions require serialization, then strdup() does also. There were some
issues fixed with the "garbage collect" versions of the allocation
functions.

moved src/misc/alloc.h to src/include/ngspice/alloc.h. This change was
done
because one of the builds (only MinGW) was having problems finding it in
one
case. The others were searching the include path while MinGW was using the
path of the including file as its base. While that issue may have been
corrected, this change was beneficial because there were many files
including
alloc.h through a long path of ../.. from include. As part of this change,
those includes were fixed also.

Loading code models and user-defined types was enhanced to handle
versioning.
Additionally, the copying of error messages along with a potential buffer
overrun was completely eliminated by using the string directly. Following
the
use, a macro FEEE_DLERR_MSG(msg) was added to free the string in Windows.
In
other OS where dlerror() does not require its string to be freed, the
macro
expands to nothing.

In cm_analog_alloc() the number of doubles required was corrected.

Fixed Maiefile.am to include new files.

Fixed the macro definition of strdup in Windows so that it will not
confilct
with the definition provided when CRT memory debugging is used.

Updated usage message for cmpp to provide information about the -p flag.

Added diagnostic messages when running cmpp if the macro DEBUG_CMPP is
enabled. These were entirely removed from the mainline code flow except
for a
single macro PRINT_CMPP_INFO(argc, argv)

Changed free functions in rm_ifs_table from txfree() to a regular free()
since
cmpp does not ever require mutex serialization. Also, its allocations are
done
using standard malloc(), calloc(), and realloc(), so free() is more
appropriate.

Modified change_extension() so that it will append a dot plus the new
extension
in the case where the original file does not have an extension. This case
is
not used in cmpp, but it seems more correct since the new extension being
supplied does not come with a leading dot.

Added check in call to change_extension() for failure.

Added function vprint_error() to cmpp/util.c and defined print_eror in
terms
of vprint_error(). The intent was to be able to call vprint_error()
directly.
Subsequent changes to the code removed the call to vprint_error(), but the
function was left since it is a useful utility function.

Modified src/xspice/icm/GNUmakefile.in to use cmpp -p to obtain a path
list.

Converted all code models supplied with ngspice to
1) Use the "talloc" functions so that their allocations will be serialized
    when necesary
    2) Check for allocation failure in all cases
    3) Free resources on exit
    4) Supply version information in the corresponding .lst file

    Modified icm/dlmain.c to include version 2 information.

    visualc/make-install-vngspiced.bat was changed in two ways. First sime
    actions
    were preceeded by checks to avoid error messages if they were
    unconditionally
    performed. Seond, code models were copied to a second location besides
    the
    destination used by a "production" ngspice. This second location along
    with an
    spinit file to use them allows debugging of multiple versions of
    ngspice
    concurrently.

    visualc/xspice/aux-cfunc.bat was modified to print additional
    diagnostic
    messages during a build, much like the compiler outputs file names.
    Also, cmpp
    -p was made the method to get the list of directories. Finally, the
    actions of
    visualc/xspice/aux-udnfunc.bat were added to aux-cfunc.bat since that
    file was
    already doing two of the three actions, and calling aux-udnfunc.bat
    alone or
    in the wrong order would cause an error. aux-udnfunc.bat was commented
    out and
    probably should be removed at some later time.
2020-01-28 23:56:07 -05:00
dwarning f53462dfd8 update vdmos with self-heating network and tj and tcase terminal 2020-01-25 16:12:05 +01:00
dwarning 9505711f06 Add missing files for resources 2020-01-13 16:43:21 +01:00
Jim Monte 52b3bf37e0 Fix of buffer overrun in interpolation at endpoint of interval. Made cfunc.mod for tables more modular. Prevented buffer overrun when building file name. Added error checking for allocation failures in many locations. Made binary search for interpolation more efficient. 2020-01-12 23:02:36 -05:00
Holger Vogt 5dfdf88ccc update to Visual Studio 2019 2020-01-05 14:34:57 +01:00
Jim Monte 0f5fccaa12 Reduced the number of configuration changes that must be made when a new version of ngspice is released. 2020-01-04 15:23:17 +01:00
Holger Vogt bdac21da03 Update to Visual Studio 2019 2020-01-04 10:59:50 +01:00
Jim Monte f55465935b Reduced the number of configuration changes that must be made when a new version of ngspice is released. 2019-12-10 15:04:24 -05:00
Holger Vogt fe0a896d03 add a manifest file
https://docs.microsoft.com/en-us/windows/win32/sbscs/application-manifests
one for i64 and x86 each
2019-11-06 22:16:47 +01:00
Holger Vogt dcb9aa26fe Replace deprecated GetVersionExA by version helper functions
Add new macro _MSC_PLATFORM_TOOLSET to check for toolset
2019-11-03 14:39:52 +01:00
Holger Vogt 6da88c3976 shared ngspice: add new resource files 2019-11-03 11:11:56 +01:00
Holger Vogt 4fa37979ae Complete redesign of memory monitoring in resource.c.
Acquiring memory size is done by four functions
getMemorySize, getAvailableMemorySize, getPeakRSS,
and getCurrentRSS.
Time data are still obtained without code modifications.
2019-10-19 18:45:52 +02:00
Holger Vogt 76c43c0593 We are beyond ngspice-31 now --> ngspice-31+ 2019-10-02 00:00:59 +02:00
Holger Vogt 8ca1c81f36 re-enable compiling with VC 2015 and up 2019-10-01 23:34:44 +02:00
Holger Vogt 96db9439f9 partially undo the previous commit 2019-10-01 23:34:34 +02:00
Holger Vogt e5ed6603f0 cmpp will not compile if ngspice is debug and cmpp is set to 64 bit.
Bad fix: This has to be analyzed.
2019-09-28 16:57:47 +02:00
Holger Vogt b5c5733769 Prepare ngspice-31 2019-09-15 21:13:28 +02:00
Holger Vogt 1c580c7b0a cmpp did not compile any more after applying patch #60
After reverting #60, this fix avoids warning about output locations
2019-09-14 12:43:36 +02:00
Holger Vogt 0814c71c2c Revert "[PATCH #60] Fixed build warnings about inconsistencies in the output"
This reverts commit 194e6d02e9.
2019-09-14 12:43:22 +02:00
Holger Vogt 1ba02f3c87 including hist_info files 2019-08-13 23:30:47 +02:00
Jim Monte 3874916948 [PATCH #56] New history buffering 2019-08-13 23:30:05 +02:00
Jim Monte a1ddfa3f82 [PATCH #60] Fixed build warnings about inconsistencies in the output
location for cmpp. The destination was not changed (due to dependencies of
 batch files on the location) but $(ProjectDir) was used to make the path
 absolute, which simplifies verifying the correct location.
2019-08-13 23:29:48 +02:00
dwarning f90295f46a remove last remainder of unused sensitivity analysis 2019-08-13 22:55:25 +02:00
Holger Vogt 54d4d9747a ngspice version is now 30+ 2019-08-13 22:54:01 +02:00
dwarning 4cc88a0b1b add resource file for fftw build 2019-08-13 22:52:22 +02:00
Holger Vogt d4c3d9ceb2 relieve the step size limitation (formerly set to TSTEP in tran simulation).
However not all examples will do without, thus the variable 'stepsizelimit'
is set in spinit. Unset it in .spiceinit to get the new behavior.
Of course then you might add the limit by setting TMAX in the tran command.
2019-03-21 20:22:42 +01:00
Holger Vogt c35879d3cf prepare ngspice-30 2018-12-23 13:55:45 +01:00
Holger Vogt 0089cc543a MSVC same stack size as with standard ngspice 2018-12-17 23:06:33 +01:00
Holger Vogt 55faba9e09 update path for ngspice.ico 2018-12-17 23:04:00 +01:00
Holger Vogt 9f40c2b584 add an icon to MS Windows VC exe 2018-12-17 23:03:27 +01:00
Holger Vogt 578a42e084 provide correct output path for cmpp.exe during 64 bit compilation 2018-10-27 17:57:14 +02:00
Holger Vogt 5ee1be955c Provide a suitable spinit, if ngspice is started
directly from the Visual Studio Debugger.
2018-10-18 00:22:58 +02:00
dwarning ca8481d9fc skip minor version in fftw path 2018-10-16 07:53:38 +02:00
Holger Vogt 0643a6eb57 Make cmpp with 64 bit in all 64 bit configurations 2018-10-13 23:48:10 +02:00
Holger Vogt 21f5b20951 Unify stack reserve 4194304 and stack commit 1048576
for all 64 bit configurations
2018-10-13 23:45:21 +02:00
Holger Vogt 24beadb11b VC++: make the library path for fftw independent from the actual version:
fftw-3.3.5-dll64 --> fftw-3.3-dll64
2018-10-13 23:39:50 +02:00