]> git.nickg.me.uk Git - nvc.git/log
nvc.git
10 months agovhpi: Add get/set support for selected names
Sean Anderson [Thu, 22 Jun 2023 01:00:43 +0000 (21:00 -0400)]
vhpi: Add get/set support for selected names

Inhomogenous types are create scopes instead of signals. Additionally,
inhomogenous arrays have nested scopes for their elements. Add the
necessary machinery to determine the scope for a name/objDecl, and look
up the signal at the final level.

In the style of vhpi7, assign a value to each element of the test
records, and try to change them. To avoid needing to repeat the same
code while recursing through records, we just print out the values and
check them against the golden output. We cheat a bit for
multidimensional arrays because array properties are checked properly in
vhpi7.

10 months agovhpi: Add support for selected names
Sean Anderson [Thu, 22 Jun 2023 00:42:18 +0000 (20:42 -0400)]
vhpi: Add support for selected names

The other major type of prefixed names is selected names. Add support
for them. In many ways they are simpler than indexed names, since we
don't have to keep track of multiple indices. Getting/setting is not
supported, but it will be addressed in the next commit.

10 months agovhpi: Support NumFields
Sean Anderson [Wed, 21 Jun 2023 23:40:38 +0000 (19:40 -0400)]
vhpi: Support NumFields

Add support for the NumFields property of record types.

10 months agovhpi: Support record elements
Sean Anderson [Wed, 21 Jun 2023 23:32:14 +0000 (19:32 -0400)]
vhpi: Support record elements

Add support for record elements. Convert the vhpi5 test to gold to make
it easier to check recursive structures, and change the record
definition to something a little more interesting.

10 months agovhpi: Add support for vhpiPrefixP
Sean Anderson [Wed, 21 Jun 2023 23:45:24 +0000 (19:45 -0400)]
vhpi: Add support for vhpiPrefixP

Back when prefixnames got added I forgot to add support for the prefix
property itself. Add it now.

10 months agovhpi: Pre-calculate names' offsets
Sean Anderson [Sun, 18 Jun 2023 21:29:01 +0000 (17:29 -0400)]
vhpi: Pre-calculate names' offsets

We have all the information necessary to determine the offset of indexed
names when creating them. To simplify the process of determining the
offset by pre-calculating them.

10 months agoFix another case of index-of-function-call parsed incorrectly
Nick Gasson [Wed, 21 Jun 2023 19:20:07 +0000 (20:20 +0100)]
Fix another case of index-of-function-call parsed incorrectly

Issue #727

10 months agoFix remaining instances where VHDL integers are passed as int32_t
Nick Gasson [Tue, 20 Jun 2023 19:38:46 +0000 (20:38 +0100)]
Fix remaining instances where VHDL integers are passed as int32_t

10 months agoChange calling convention for FILE_OPEN to handle different integer sizes
Nick Gasson [Tue, 20 Jun 2023 19:37:33 +0000 (20:37 +0100)]
Change calling convention for FILE_OPEN to handle different integer sizes

Fixes #724

10 months agoFix crash indexing protected function call that returns an array
Nick Gasson [Tue, 20 Jun 2023 19:14:28 +0000 (20:14 +0100)]
Fix crash indexing protected function call that returns an array

E.g. P.F(X) where F takes no argument and returns an array.

Issue #726

10 months agoAdd regression test for issue #725
Nick Gasson [Tue, 20 Jun 2023 19:05:44 +0000 (20:05 +0100)]
Add regression test for issue #725

10 months agoEnsure diagnostic messages are correctly ordered wrt. textio output
Nick Gasson [Tue, 20 Jun 2023 19:02:12 +0000 (20:02 +0100)]
Ensure diagnostic messages are correctly ordered wrt. textio output

10 months agoRemove pointless directory search in lib_get_aux
Nick Gasson [Tue, 20 Jun 2023 18:53:08 +0000 (19:53 +0100)]
Remove pointless directory search in lib_get_aux

10 months agoRevert to using timestamps to determine most recently analysed
Nick Gasson [Tue, 20 Jun 2023 18:49:54 +0000 (19:49 +0100)]
Revert to using timestamps to determine most recently analysed

11 months agoRemove separate PARALLEL_MAKEFLAGS variable
Nick Gasson [Mon, 19 Jun 2023 07:12:10 +0000 (08:12 +0100)]
Remove separate PARALLEL_MAKEFLAGS variable

11 months agoFix build warning on Windows
Nick Gasson [Sun, 18 Jun 2023 18:14:41 +0000 (19:14 +0100)]
Fix build warning on Windows

11 months agoFix command line parsing crash. Issue #722
Nick Gasson [Sun, 18 Jun 2023 18:11:21 +0000 (19:11 +0100)]
Fix command line parsing crash. Issue #722

11 months agoRemove dead code in lower_wrap_element. Fixes #721
Nick Gasson [Sun, 18 Jun 2023 17:50:08 +0000 (18:50 +0100)]
Remove dead code in lower_wrap_element. Fixes #721

11 months agoUse nanosecond-resolution timestamps consistently on all platforms
Nick Gasson [Sun, 18 Jun 2023 17:36:27 +0000 (18:36 +0100)]
Use nanosecond-resolution timestamps consistently on all platforms

11 months agoFix OSVMM workflow and schedule weekly
Nick Gasson [Sun, 18 Jun 2023 13:38:35 +0000 (14:38 +0100)]
Fix OSVMM workflow and schedule weekly

11 months agosrc: Use pedantic_diag to throw error that can be demoted to warning.
Ondrej Ille [Sun, 18 Jun 2023 17:12:15 +0000 (19:12 +0200)]
src: Use pedantic_diag to throw error that can be demoted to warning.

11 months agosrc: Turn non-explicit class or mode match to warning with FRELAXED.
Ondrej Ille [Sun, 18 Jun 2023 16:17:06 +0000 (18:17 +0200)]
src: Turn non-explicit class or mode match to warning with FRELAXED.

11 months agotest: Add test for issue660.
Ondrej Ille [Sun, 18 Jun 2023 16:10:44 +0000 (18:10 +0200)]
test: Add test for issue660.

11 months agosrc: strict subprogram specification and body matching.
Ondrej Ille [Sun, 18 Jun 2023 15:24:53 +0000 (17:24 +0200)]
src: strict subprogram specification and body matching.

11 months agovhpi: Support EndOfTimeStep callbacks
Sean Anderson [Sat, 17 Jun 2023 20:14:14 +0000 (16:14 -0400)]
vhpi: Support EndOfTimeStep callbacks

Add support for EndOfTimeStep callbacks, which are the final callbacks
to occur in a timestep.

11 months agovhpi: Support EnumLiterals
Sean Anderson [Sun, 11 Jun 2023 19:01:05 +0000 (15:01 -0400)]
vhpi: Support EnumLiterals

Add support for the various *Literals properties of enums. Although
`EnumLiteral`s are generalizations of both `expr`s and `decl`s, we only
really support single-inheritance at the moment. Make c_enumLiteral a
subtype of c_abstractDecl, since there are more properties in `decl`s
than in `expr`s. This should be the only exception in this area we need
to make, since other literals aren't generalizations of decl.

11 months agovhpi: Support getting/putting reals
Sean Anderson [Sun, 11 Jun 2023 16:11:48 +0000 (12:11 -0400)]
vhpi: Support getting/putting reals

Add support for getting/putting reals (aka doubles).

11 months agovhpi: Support char and string values
Sean Anderson [Sun, 11 Jun 2023 15:02:42 +0000 (11:02 -0400)]
vhpi: Support char and string values

The native format for character types is vhpiCharVal. Similarly, the
native format for 1-d character arrays is vhpiStrVal. Use these formats
instead of the short enum formats. Note that vhpiStrVals are
nul-terminated, and the terminator is not included in the numElems (but
it is included in bufSize).

11 months agovhpi: Support SigDecls
Sean Anderson [Sun, 11 Jun 2023 14:12:40 +0000 (10:12 -0400)]
vhpi: Support SigDecls

Add support for SigDecls to the root instance.

11 months agovhpi: Fix root region being an internal region of itself
Sean Anderson [Sun, 11 Jun 2023 15:09:31 +0000 (11:09 -0400)]
vhpi: Fix root region being an internal region of itself

The root region shouldn't contain itself. This can cause infinite
recursion in VHPI programs which try to recursively discover the
hierarchy.

Fixes: fb8e5f51 ("vhpi: Support iterators")
11 months agoprint-deps: Fix name for elaborated shared library
Sean Anderson [Sun, 18 Jun 2023 00:36:57 +0000 (20:36 -0400)]
print-deps: Fix name for elaborated shared library

The shared libraries created by elaboration are named *.elab.so, not
*.final.so. I'm not sure what commit this fixes.

11 months agoParallel make by default only when explicitly requested. Fixes #716
Nick Gasson [Sat, 17 Jun 2023 20:13:21 +0000 (21:13 +0100)]
Parallel make by default only when explicitly requested. Fixes #716

11 months agoFix pointer signedness warning in vhpi9.c
Nick Gasson [Sat, 17 Jun 2023 20:20:38 +0000 (21:20 +0100)]
Fix pointer signedness warning in vhpi9.c

11 months agoMerge analyse_vhdl/analyse_verilog into analyse_file
Nick Gasson [Sat, 17 Jun 2023 16:45:47 +0000 (17:45 +0100)]
Merge analyse_vhdl/analyse_verilog into analyse_file

11 months agoWrong bounds determination for unconstrained port. Fixes #714
Nick Gasson [Sat, 17 Jun 2023 16:15:13 +0000 (17:15 +0100)]
Wrong bounds determination for unconstrained port. Fixes #714

11 months agoRework determination of most recently analysed architecture
Nick Gasson [Sat, 17 Jun 2023 15:19:07 +0000 (16:19 +0100)]
Rework determination of most recently analysed architecture

Avoid using timestamps as well as loading every architecture and instead
establish a total order over all architectures in a library with a new
_sequence file.

Issue #715
Issue #710

11 months agoRewrite assume_int in terms of folded_int
Nick Gasson [Sat, 17 Jun 2023 09:13:46 +0000 (10:13 +0100)]
Rewrite assume_int in terms of folded_int

11 months agoAdd test for non-static generic formal name
Nick Gasson [Sat, 17 Jun 2023 08:53:43 +0000 (09:53 +0100)]
Add test for non-static generic formal name

11 months agoMissing error when generic type name appears in actual. Issue #713
Nick Gasson [Sat, 17 Jun 2023 08:50:07 +0000 (09:50 +0100)]
Missing error when generic type name appears in actual. Issue #713

11 months agoOnly enable parallel make on recent versions of GNU Make
Nick Gasson [Sat, 17 Jun 2023 07:52:21 +0000 (08:52 +0100)]
Only enable parallel make on recent versions of GNU Make

11 months agoRemove redundant folded_enum function
Nick Gasson [Sat, 17 Jun 2023 07:45:49 +0000 (08:45 +0100)]
Remove redundant folded_enum function

11 months agoHandle static expressions with deferred constants that are not folded
Nick Gasson [Sat, 17 Jun 2023 07:20:00 +0000 (08:20 +0100)]
Handle static expressions with deferred constants that are not folded

11 months agoBump OSVVM to 2023.05
Nick Gasson [Fri, 16 Jun 2023 21:02:52 +0000 (22:02 +0100)]
Bump OSVVM to 2023.05

11 months agoEnable make -j by default with GNU Make
Nick Gasson [Fri, 16 Jun 2023 07:57:08 +0000 (08:57 +0100)]
Enable make -j by default with GNU Make

11 months agoAvoid repeatedly re-evaluating array bounds
Nick Gasson [Fri, 16 Jun 2023 07:51:53 +0000 (08:51 +0100)]
Avoid repeatedly re-evaluating array bounds

11 months agoUse wrapped arrays consistently when bounds are non-constant
Nick Gasson [Thu, 15 Jun 2023 21:15:05 +0000 (22:15 +0100)]
Use wrapped arrays consistently when bounds are non-constant

11 months agoFix incorrect result bounds in lower_narrow
Nick Gasson [Thu, 15 Jun 2023 21:45:20 +0000 (22:45 +0100)]
Fix incorrect result bounds in lower_narrow

11 months agoFix copy/paste typo in 702a234
Nick Gasson [Thu, 15 Jun 2023 21:17:38 +0000 (22:17 +0100)]
Fix copy/paste typo in 702a234

11 months agoFix pointer aliasing warning
Nick Gasson [Thu, 15 Jun 2023 17:22:40 +0000 (18:22 +0100)]
Fix pointer aliasing warning

11 months agoLink with Mold if installed
Nick Gasson [Thu, 15 Jun 2023 17:14:34 +0000 (18:14 +0100)]
Link with Mold if installed

11 months agoRemove redundant lower_array_scalar_sub_elements
Nick Gasson [Wed, 14 Jun 2023 21:16:13 +0000 (22:16 +0100)]
Remove redundant lower_array_scalar_sub_elements

11 months agoRefactor calculation in lower_array_stride
Nick Gasson [Wed, 14 Jun 2023 21:05:40 +0000 (22:05 +0100)]
Refactor calculation in lower_array_stride

11 months agoMissing bounds checks for record ports with unconstrained elements
Nick Gasson [Mon, 12 Jun 2023 21:07:17 +0000 (22:07 +0100)]
Missing bounds checks for record ports with unconstrained elements

11 months agoError rather than crash with external name in package. Issue #709
Nick Gasson [Sun, 11 Jun 2023 20:34:32 +0000 (21:34 +0100)]
Error rather than crash with external name in package. Issue #709

11 months agovhpi: Add basic float support
Sean Anderson [Sun, 11 Jun 2023 04:40:45 +0000 (00:40 -0400)]
vhpi: Add basic float support

Add basic support for floating point types. Getting/putting them is not
supported, but this allows using VHPI on designs which contain floats.

11 months agovhpi: Simplify cast_* functions
Sean Anderson [Sat, 10 Jun 2023 21:26:09 +0000 (17:26 -0400)]
vhpi: Simplify cast_* functions

Simplify some cast_* functions by calling their corresponding is_*
functions instead of reimplementing the same logic.

11 months agovhpi: Fix use-after-free when removing callbacks (part 2)
Sean Anderson [Sun, 11 Jun 2023 03:54:26 +0000 (23:54 -0400)]
vhpi: Fix use-after-free when removing callbacks (part 2)

I made a first attempt at this back in commit a21a360e ("vhpi: Fix
use-after-free when removing callbacks"), but I didn't fix the global or
value callbacks. These can also have use-after-frees, which can be
triggered consistently with a pair of "mutually-removing" callbacks.
They are set up so that they trigger on the next cycle, and they try to
remove themselves. This fails without the fixes in this commit.

The main approach is to give rt_watch_t the same treatment that
c_callback got: adding a flag to free the watch after the callback
completes. Global callbacks are a bit simpler, and can mostly be treated
like timeout callbacks; if we don't find anything to remove, the
callback must be currently-enqueued, so we shouldn't free it.

Fixes: d6e523a4 ("vhpi: Free callbacks in remove")
11 months agovhpi: Check that we have enough space for values
Sean Anderson [Sat, 10 Jun 2023 23:34:15 +0000 (19:34 -0400)]
vhpi: Check that we have enough space for values

Add a bounds check for vhpi_put_values to ensure we have enough space in
the signal for the value.

11 months agovhpi: Fix incorrect range calculation
Sean Anderson [Sat, 10 Jun 2023 23:04:30 +0000 (19:04 -0400)]
vhpi: Fix incorrect range calculation

Null ranges have zero length. Detect them properly by basing the
direvction of the range on IsUp instead of whether LeftBound >
RightBound. The comparison in init_indexedName can stay the same since
it is guarded by build_indexedNames.

Fixes: 2052a42f ("vhpi: Rework size calculation")
Fixes: 9416eb6e ("vhpi: Add support for IndexedNames")
11 months agovhpi: Fix NULL-pointer dereference in vhpi_get_by_name
Sean Anderson [Sat, 10 Jun 2023 21:06:48 +0000 (17:06 -0400)]
vhpi: Fix NULL-pointer dereference in vhpi_get_by_name

strtok_r returns NULL when there are no more tokens in the string. When
passed a name matching scope's name, but without a colon or period, we
call strtok_r twice, getting NULL the second time. Because the name
matches the region, fix this by returning the region.

11 months agoAdd -f analysis option to analyse a list of files
Nick Gasson [Fri, 9 Jun 2023 08:47:21 +0000 (09:47 +0100)]
Add -f analysis option to analyse a list of files

11 months agoAdd selected signal and variable assignments
Nick Gasson [Tue, 6 Jun 2023 21:25:22 +0000 (22:25 +0100)]
Add selected signal and variable assignments

11 months agoImplement "ordering on any scalar array type" VHDL-2019 feature
Nick Gasson [Tue, 6 Jun 2023 18:49:52 +0000 (19:49 +0100)]
Implement "ordering on any scalar array type" VHDL-2019 feature

11 months agoSet relaxed mode when running JIT benchmarks
Nick Gasson [Tue, 6 Jun 2023 18:18:33 +0000 (19:18 +0100)]
Set relaxed mode when running JIT benchmarks

11 months agoAdding VHDL-2019 to OSVVM installation. (#622)
Brian Padalino [Mon, 5 Jun 2023 22:17:56 +0000 (18:17 -0400)]
Adding VHDL-2019 to OSVVM installation. (#622)

11 months agoFix visibility bug with VHDL-2019 interface lists. Fixes #708
Nick Gasson [Mon, 5 Jun 2023 21:04:26 +0000 (22:04 +0100)]
Fix visibility bug with VHDL-2019 interface lists. Fixes #708

11 months agoOptimise memory allocation for access-to-array
Nick Gasson [Mon, 5 Jun 2023 08:03:46 +0000 (09:03 +0100)]
Optimise memory allocation for access-to-array

11 months agoUpdate THANKS.md
Nick Gasson [Sun, 4 Jun 2023 22:18:52 +0000 (23:18 +0100)]
Update THANKS.md

11 months agoAdd a --no-collapse option to inhibit port collapsing. Issue #704
Nick Gasson [Sun, 4 Jun 2023 21:46:32 +0000 (22:46 +0100)]
Add a --no-collapse option to inhibit port collapsing. Issue #704

11 months agoAdd a textio WRITE benchmark
Nick Gasson [Sun, 4 Jun 2023 21:46:42 +0000 (22:46 +0100)]
Add a textio WRITE benchmark

11 months agovhpi: Add support for getting/putting IndexedNames
Sean Anderson [Mon, 29 May 2023 21:39:41 +0000 (17:39 -0400)]
vhpi: Add support for getting/putting IndexedNames

This allows getting/putting nested arrays, and individual elements of an
array. The final index calculation is done lazily, although this
could be done eagerly by moving it to init_indexedName.

The tests for indexednames and the various enum types are extended now
that it is easier to access them.

11 months agovhpi: Fix vhpi_get_value with EnumVecVal format
Sean Anderson [Mon, 29 May 2023 21:49:14 +0000 (17:49 -0400)]
vhpi: Fix vhpi_get_value with EnumVecVal format

The Logic, SmallEnum, and Enum formats were not treated consistently.
Sometimes the wrong value type was used to store signals, and the
variable signal size of Enum was not handled properly. The correct
relationships for these types may be seen in the following table:

Format           Value type     Signal size
================ ============== ===========
vhpiLogicVal     vhpiEnumT      8
vhpiSmallEnumVal vhpiSmallEnumT 8
vhpiEnumVal      vhpiEnumT      variable

In order to handle the variable size of Enum, we need to use FOR_ALL_SIZES
from model.c. Move it to util.h, and rename a conflicting macro with a
similar purpose. This also adds support for getting SmallEnumVecs.

This adds a test for the Vec versions of these formats; the non-vec
versions will be tested when indexedName get/put support is added.

11 months agovhpi: Trace the object name in more cases
Sean Anderson [Mon, 29 May 2023 21:36:22 +0000 (17:36 -0400)]
vhpi: Trace the object name in more cases

Print the object's name when tracing in more cases, adding support for
names and signals.

11 months agovhpi: Support BaseIndex
Sean Anderson [Sat, 3 Jun 2023 23:28:30 +0000 (19:28 -0400)]
vhpi: Support BaseIndex

This property is not used by cocotb, but it makes testing easier.

11 months agovhpi: Support staticness
Sean Anderson [Mon, 29 May 2023 21:40:49 +0000 (17:40 -0400)]
vhpi: Support staticness

Support querying the staticness of expressions. I'm not sure how this
would work for ranges, so I've left them out.

11 months agovhpi: Add support for IndexedNames
Sean Anderson [Mon, 29 May 2023 21:04:52 +0000 (17:04 -0400)]
vhpi: Add support for IndexedNames

IndexedNames (e.g. `a(0)` or `a(2, 3)`) are necessary to access elements
of nested or multidimensional arrays (which have too many dimensions for
vhpiLogicVecVal) or to set individual elements of single-dimensional
arrays. Add basic support for these objects.

Although objDecls are names too, they also include the decl properties
which we don't want. Therefore, we use a separate hierarchy for
exprs/names. For future work, it might be nice to use the object
framework (tree_t, type_t, etc) for VHPI as well.

IndexedNames are created lazily. This is useful for nested arrays. For
example, a signal like

   type a is array(0 to 9) of std_logic_vector(31 downto 0);
   signal b: a;

might only be accessed like `b(0)` and never like `b(2)(3)`.

The encoding of prefixedName varies slightly from the UML. To reuse the
above example, while the UML says that the prefix of `b(0)` is `b`,
we set prefix as NULL in this situation, using simpleName instead. This
makes it easier to walk nested prefixes, since we don't have to compare
prefix to simpleName.

To populate IndexedNames, we must iterate over all constraints on the
array, and create `c_indexedName`s for each. One option here would be to
pass BaseIndex to init_indexedName. However, this would require decoding
the BaseIndex into indices for each constraint. Indead, I chose to pass
the indices directly, and create BaseIndex from them. I think this is
easier, because it doesn't involve any division.

11 months agovhpi: Rework size calculation
Sean Anderson [Mon, 29 May 2023 20:11:56 +0000 (16:11 -0400)]
vhpi: Rework size calculation

IndexedNames represent a subset of the elements in a signal. Their size
is dependent on their type. In preparation for adding IndexedName
support, rework the size calculation to be based on the type of the
object instead of the width of the backing signal.

11 months agovhpi: Support NumDimensions
Sean Anderson [Mon, 29 May 2023 20:06:09 +0000 (16:06 -0400)]
vhpi: Support NumDimensions

Support NumDimensions for arrays.

11 months agovhpi: Support LeftBound and RightBound
Sean Anderson [Mon, 29 May 2023 20:04:13 +0000 (16:04 -0400)]
vhpi: Support LeftBound and RightBound

Support LeftBound and RightBound for IntRanges.

11 months agovhpi: Support IsUnconstrained
Sean Anderson [Mon, 29 May 2023 20:03:13 +0000 (16:03 -0400)]
vhpi: Support IsUnconstrained

Support the IsUnconstrained property for ranges and types.

11 months agovhpi: Support constraints
Sean Anderson [Mon, 29 May 2023 19:45:06 +0000 (15:45 -0400)]
vhpi: Support constraints

Add support for range constraints on arrays and subtypes. I think the
from/to on unconstrained ranges should reflect the from/to of the
underlying type, but I have left that out for now. Currently no
properties are supported, but that will change soon.

11 months agovhpi: Support ElemType
Sean Anderson [Mon, 29 May 2023 19:34:45 +0000 (15:34 -0400)]
vhpi: Support ElemType

Support the ElemType property of Arrays.

11 months agovhpi: Add support for subtypes
Sean Anderson [Mon, 29 May 2023 19:23:07 +0000 (15:23 -0400)]
vhpi: Add support for subtypes

Add very basic support for subtypes. This is just enough to place them
in the type hierarchy, and not much else. Array subtypes are always
created as arrayTypeDecls, since this will let us expose the element
subtype properly.

11 months agovhpi: Pass type directly to init_typeDecl
Sean Anderson [Mon, 29 May 2023 23:02:31 +0000 (19:02 -0400)]
vhpi: Pass type directly to init_typeDecl

Anonymous types can't be looked up by their ident, so the decl is for
their base type instead. Pass the type directly instead of using
tree_type to ensure the type matches what it represents.

11 months agovhpi: Support iterators in vhpi_handle_by_index
Sean Anderson [Mon, 29 May 2023 18:50:52 +0000 (14:50 -0400)]
vhpi: Support iterators in vhpi_handle_by_index

Refactor vhpi_handle_by_index to work with iterators, allowing it to
work with anything that vhpi_iterator does (and vice versa).

11 months agovhpi: Support single-element iterators
Sean Anderson [Mon, 29 May 2023 18:40:44 +0000 (14:40 -0400)]
vhpi: Support single-element iterators

Instead of creating a list with one element for relations with only one
target, support single-element iterators directly.

11 months agovhpi: Move iterator initialization to init_iterator
Sean Anderson [Mon, 29 May 2023 18:36:17 +0000 (14:36 -0400)]
vhpi: Move iterator initialization to init_iterator

In preparation for merging the logic in vhpi_iterator with
vhpi_handle_for_index, split off iterator initialization into its own
function. This replaces new_iterator so we can avoid a memory
allocation if possible in vhpi_handle_for_index.

11 months agovhpi: Don't scan non-iterators
Sean Anderson [Mon, 29 May 2023 18:11:24 +0000 (14:11 -0400)]
vhpi: Don't scan non-iterators

If we get a non-iterator in vhpi_scan, just return NULL.

Fixes: fb8e5f51 ("vhpi: Support iterators")
11 months agovhpi: Move BaseType to c_typeDecl
Sean Anderson [Mon, 29 May 2023 17:09:37 +0000 (13:09 -0400)]
vhpi: Move BaseType to c_typeDecl

Each Type has a BaseType. Except for subtypes, the BaseType is the Type
itself. In preparation for adding subTypeDecls, move BaseType to
typeDecl. This allows us to calculate the BaseType when necessary,
removing the need to have a redundant BaseType reference.

11 months agovhpi: Extend is_typeDecl to work on all typeDecls
Sean Anderson [Mon, 29 May 2023 16:55:28 +0000 (12:55 -0400)]
vhpi: Extend is_typeDecl to work on all typeDecls

Make is_typeDecl work on all sub-classes of c_typeDecl, instead of just
intTypeDecls.

11 months agoFix GMT offset calculation in GMTIME
Nick Gasson [Sun, 4 Jun 2023 20:54:09 +0000 (21:54 +0100)]
Fix GMT offset calculation in GMTIME

11 months agoMake sure $GALLOC opcode never returns a null pointer
Nick Gasson [Sun, 4 Jun 2023 17:19:20 +0000 (18:19 +0100)]
Make sure $GALLOC opcode never returns a null pointer

11 months agoSimplify logic in lower_incomplete_access
Nick Gasson [Sun, 4 Jun 2023 17:19:01 +0000 (18:19 +0100)]
Simplify logic in lower_incomplete_access

11 months agoChange default exit severity to FAILURE
Nick Gasson [Sun, 4 Jun 2023 09:04:48 +0000 (10:04 +0100)]
Change default exit severity to FAILURE

11 months agoImplement remaining VHDL-2019 date/time functions
Nick Gasson [Sat, 3 Jun 2023 17:29:37 +0000 (18:29 +0100)]
Implement remaining VHDL-2019 date/time functions

11 months agoReturn a non-empty string for TOOL_EDITION
Nick Gasson [Sat, 3 Jun 2023 12:11:44 +0000 (13:11 +0100)]
Return a non-empty string for TOOL_EDITION

11 months agoAvoid crash when exiting concurrently with LLVM code generation
Nick Gasson [Sat, 3 Jun 2023 11:53:05 +0000 (12:53 +0100)]
Avoid crash when exiting concurrently with LLVM code generation

11 months agoOptimise predefined attribute parsing
Nick Gasson [Sat, 3 Jun 2023 11:40:23 +0000 (12:40 +0100)]
Optimise predefined attribute parsing

11 months agoAttribute 'ASCENDING has a dimension parameter
Nick Gasson [Fri, 2 Jun 2023 22:13:51 +0000 (23:13 +0100)]
Attribute 'ASCENDING has a dimension parameter

11 months agoImplement 'INDEX attribute from VHDL-2019 (LCS-2016-018a)
Nick Gasson [Fri, 2 Jun 2023 21:12:38 +0000 (22:12 +0100)]
Implement 'INDEX attribute from VHDL-2019 (LCS-2016-018a)