iverilog/tgt-vlog95
Lars-Peter Clausen 2e12e47a2b tgt-vlog95: Don't strip leading null-bytes from string literals
When a string literal is used in a context where it needs to be wider than
it is it will get left-padded with null-bytes. When the vlog95 backend
emits the string literal it will strip the leading null-bytes as it results
in much more legible code.

Unfortunately there are some corner cases where this results in a change of
behavior of the generated code compared to the original. E.g. if the
context that caused the width expansion has been removed by optimization.
`$display(0 ? "Yes" : "No")` should print " No" due to width expansion, but
when running through the vlog95 backend it will print "No".

Another scenario where there is a change in behavior is when a null byte
was explicitly added at the front of a string literal. E.g. $bits("\000ab")
should print 24, but will print 16 when running through the vlog95 backend.

To mitigate this remove the stripping of the leading null-bytes from the
vlog95 backend. This results in slightly less legible code being generated
in some cases, but makes sure that the code is always correct.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2023-01-02 16:22:33 -08:00
..
Makefile.in Update cppcheck to not run posix and add some -U flags 2021-01-02 13:23:59 -08:00
cppcheck.sup Update tgt- directories with cppcheck suggested fixes 2021-01-02 13:31:26 -08:00
event.c Add support for SV edge 2021-01-07 01:22:49 -08:00
expr.c Fix the vlog95 -> and <-> expression code for wide results 2020-12-01 00:04:00 -08:00
logic_lpm.c Cleanup some cppcheck warnings 2022-12-28 00:00:31 -08:00
misc.c Cleanup some cppcheck warnings 2022-12-28 00:00:31 -08:00
numbers.c tgt-vlog95: Don't strip leading null-bytes from string literals 2023-01-02 16:22:33 -08:00
scope.c Merge pull request #838 from larsclausen/ps-func-call-fix-width 2022-12-28 17:38:35 -08:00
stmt.c Cleanup some cppcheck warnings 2022-12-28 00:00:31 -08:00
udp.c vlog95: Major rework of nexus emitting code, etc. 2012-01-02 11:29:42 -08:00
vlog95-s.conf Renamed synthsplit to exposenodes. 2016-02-27 20:24:28 +00:00
vlog95.c Update main component Copyright to 2021 2021-01-10 14:32:30 -08:00
vlog95.conf vlog95: block generating a concat-Z LPM device in the compiler. 2013-02-13 19:19:21 -08:00
vlog95_priv.h Handle SV void functions in vlog95 target. 2019-11-09 16:14:09 +00:00