iverilog/tgt-vvp
Lars-Peter Clausen b11da7e16f tgt-vvp: Don't accidentally skip assignment pattern initialization
The `%store/dar/...` and `%store/qdar/...` instructions are used to load a
value into an entry in dynamic array or queue. These instructions will skip
the load if VVP flag 4 is 1.

For assignment pattern initialization these instructions are used to load
the value of the individual assignment pattern expressions into the dynamic
array.

For queues flag 4 is never cleared when generating the code for the
assignment pattern. This means the initialization might be skipped
depending on what value the flag had before.

```
int a = 1;
int q[$];
a = a == 1;
q = {1, 2, 3, 4};
```

For dynamic arrays it is cleared once in the beginning. But each item in
the assignment pattern can be an arbitrary expression.  Evaluating the
expression can cause the flag to get overwritten. E.g. the following code
will skip the assignments.

```
int a = 1;
int d[];
d = {a ? 1 : 1, 2, 3, 4};
```

To fix these issues make sure that the flag is cleared after evaluating
each initialization expression and before executing the `%store/...`
instruction.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2022-04-17 09:09:38 +02:00
..
COPYING.lesser Move GNU lesser to tgt-vvp since that is the only place where LGPL code is located 2020-11-14 19:03:27 -08:00
Makefile.in Update cppcheck to not run posix and add some -U flags 2021-01-02 13:23:59 -08:00
README.txt Spelling fixes in .txt files 2015-05-25 12:52:03 -07:00
cppcheck.sup Update tgt- directories with cppcheck suggested fixes 2021-01-02 13:31:26 -08:00
draw_class.c Allow class properties to be arrayed. 2014-09-15 17:37:30 -07:00
draw_delay.c Fix for GitHub issue #96 - support mixed constant/variable delays in vvp. 2016-04-02 19:55:56 +01:00
draw_enum.c updated FSF-address 2012-08-29 10:12:10 -07:00
draw_mux.c Fix for GitHub issue #96 - support mixed constant/variable delays in vvp. 2016-04-02 19:55:56 +01:00
draw_net_input.c Fix GitHub issue #356 - use pull strength for tri0/tri1 tie-offs. 2020-08-06 14:20:16 +01:00
draw_substitute.c Handle some tricky conditions assignments to parts. 2014-07-14 16:46:58 -07:00
draw_switch.c Increase the thread flag count from 256 to 512 2020-05-31 12:39:54 -07:00
draw_ufunc.c Functions that return strings pass the return value on the stack. 2016-03-01 15:38:28 -08:00
draw_vpi.c Fix some cppcheck warnings in tgt-vvp 2020-12-31 23:19:34 -08:00
eval_bool.c Remove dead stuff_ok_flags from draw_eval_vec4 functions. 2014-10-24 09:32:32 -07:00
eval_condit.c tgt-vvp: Short circuit logical operators 2021-12-30 18:56:39 +01:00
eval_expr.c A value of all X or Z can be an immediate number 2020-07-29 23:00:09 -07:00
eval_object.c tgt-vvp: Allow dynamic array new for vectors with multiple packed dimensions 2022-03-12 12:17:08 +01:00
eval_real.c Add support for pop_back/front without () 2020-07-25 22:16:54 -07:00
eval_string.c Add support for pop_back/front without () 2020-07-25 22:16:54 -07:00
eval_vec4.c Add support for logical implication 2022-02-13 18:48:16 -08:00
modpath.c Fix GitHub issue #315 - support modpath delays on multiply-driven nets. 2020-04-02 10:56:03 +01:00
stmt_assign.c tgt-vvp: Don't accidentally skip assignment pattern initialization 2022-04-17 09:09:38 +02:00
vvp-s.conf.in Remove redundant back-end selections. 2008-09-07 16:43:54 -07:00
vvp.c Update main component Copyright to 2021 2021-01-10 14:32:30 -08:00
vvp.conf.in Remove redundant back-end selections. 2008-09-07 16:43:54 -07:00
vvp_config.h.in Remove "using namespace std" from vvp header files and fix the fallout. 2021-11-04 17:02:07 +00:00
vvp_priv.h Add file/line information to procedural warnings and darray fixes 2020-08-10 22:01:55 -07:00
vvp_process.c Support recursive functions using `return` statement 2022-04-11 22:03:02 +02:00
vvp_scope.c Further fixes for vvp code generation for c. assign of an array word. 2022-03-19 10:22:49 +00:00

README.txt

THE VVP TARGET

SYMBOL NAME CONVENTIONS

There are some naming conventions that the vvp target uses for
generating symbol names.

* wires and regs

Nets and variables are named V_<full-name> where <full-name> is the
full hierarchical name of the signal.

* Logic devices

Logic devices (and, or, buf, bufz, etc.) are named L_<full_name>. In
this case the symbol is attached to a functor that is the output of
the logic device.


GENERAL FUNCTOR WEB STRUCTURE

The net of gates, signals and resolvers is formed from the input
design. The basic structure is wrapped around the nexus, which is
represented by the ivl_nexus_t.

Each nexus represents a resolved value. The input of the nexus is fed
by a single driver. If the nexus in the design has multiple drivers,
the drivers are first fed into a resolver (or a tree of resolvers) to
form a single output that is the nexus.

The nexus, then, feeds its output to the inputs of other gates, or to
the .net objects in the design.