]> git.nickg.me.uk Git - nvc.git/commit
Rewrite the complile time evaluator to use vcode
authorNick Gasson <nick@nickg.me.uk>
Sat, 5 Nov 2016 19:46:17 +0000 (19:46 +0000)
committerNick Gasson <nick@nickg.me.uk>
Sat, 5 Nov 2016 19:46:17 +0000 (19:46 +0000)
commitd0dc00114b22167638b832ca1313f7026a6acdd3
tree1484485740cb3f640bb956acd1c9f5674fbec431
parent621350e6f8eb3c8002df2bdfef2f706bbc13e462
Rewrite the complile time evaluator to use vcode

Squashed commit of the following:

commit ca411a3ce23d8cde0f760d4041e64c3ebd204810
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Sat Nov 5 18:47:27 2016 +0000

    Fix crash emitting undefined value

commit bf49e3062bc92a1da7943050dc0126d98ed07a17
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Sat Nov 5 18:09:15 2016 +0000

    Fix evaluation use-after-free

commit 56190598b4d06fa844ffd082fb1543b1c0336986
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Sat Nov 5 13:30:18 2016 +0000

    Fix mistake in last commit

commit a0a419f45f9db1608ca1943aaf3867ec717ac711
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Sat Nov 5 13:24:37 2016 +0000

    Fix confusing name mangling with record references

commit 6d729bcd07b0f0ef1df9634ac30ea48a9f33b33f
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Sat Nov 5 10:09:50 2016 +0000

    Add vcode reference counting and fix memory leaks

commit 04804d5994e5e3fedb079bbc97cc399d94919402
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Sat Nov 5 09:13:10 2016 +0000

    Stop storing vcode units in trees

commit 205a8f1eebd7e7091eb14c7b7cab473f1685ad95
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Fri Oct 28 18:05:39 2016 +0100

    Start of attempt to get rid of tree_code

commit 5be3ec3ef6d70bbc121e8195e2ce883af413994e
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Fri Oct 28 14:37:02 2016 +0100

    Fix invalid value kind returned from eval_op_image

commit 8206e89977c4e1b9877d30de04df8a43614c43cc
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Fri Oct 28 14:24:33 2016 +0100

    Vcode evaluation for bit shift operator

commit 23bbaaeea9dfe522e7088bc3b2ad0d59c171ceb5
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Thu Oct 27 20:54:35 2016 +0100

    Fix Valgrind error

commit 97e89e8c212905b9f968c3b66b7a803fe7c48ba8
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Thu Oct 27 20:28:53 2016 +0100

    Evaluation for vcode memset operation

commit 1a61e019a415b1b66eb73856943237ffb20e956d
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Thu Oct 27 19:45:26 2016 +0100

    Handle constant folding better in lower_sched_event

commit 6bfeccca92375477290c304e87196a7bd2b22794
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Thu Oct 27 19:38:01 2016 +0100

    Fix global naming collision

commit 6279afb9bb752b1120a441e560058641ceb0d31e
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Thu Oct 27 19:12:38 2016 +0100

    Instance and path names are only available at elaboration time

commit aebf71ce0c759a27195a874bcdb06522d8161e20
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Thu Oct 27 19:09:52 2016 +0100

    Fix a few more bugs relating to "undefined" vcode operator

commit 31522356e7c652ec1da50b6155c95bff66e6d5da
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Thu Oct 27 18:54:05 2016 +0100

    Fix regression of protected3

commit 0bacb98b869d5fb7cc8771c8b505c69418608b20
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Thu Oct 27 17:05:20 2016 +0100

    Remove redundant elab_funcs function

commit 92e0c1a5db3ee74981eda89700fe2dd6ad6fe510
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Tue Oct 25 16:47:42 2016 +0100

    Vcode evaluation for record references and constant records

commit 1e6f8ef3cbf771f02d3e5e2a45c570963e60894c
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Mon Oct 24 19:13:20 2016 +0100

    Store a type with vcode_bookmark_t

commit 2a7b18e488ce9aa45326d9ef42f405ae0a7ce8c7
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Mon Oct 24 15:24:35 2016 +0100

    Evaluating vcode procedure calls

commit 7f3617736c4a62804c718c2b6d980088102085e6
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Mon Oct 24 12:51:26 2016 +0100

    Rewrite ieee4 to avoid constant folding

commit bc552f5b8c6228036a3a1e61483275cd90eb698b
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Mon Oct 24 11:40:01 2016 +0100

    Add final simplification pass after elaboration

commit d8493fee1bc118d40a7ae25d35952c5eb722d2dd
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Sun Oct 23 22:33:45 2016 +0100

    No fatal error if evaluation causes division by zero

commit d19dfccfec7593c4f02fab7c994c6a618300f39a
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Sun Oct 23 21:36:59 2016 +0100

    Avoid generating redundant code for always-true assertion

commit 3276cc289b6ad0894e5a36e51fde1e98fe7a18a0
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Sun Oct 23 21:27:04 2016 +0100

    Finish reading/writing vcode units

commit c77a614354cf70cf4bbbb5c5bdd728bf1fcef0f7
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Sun Oct 23 18:34:44 2016 +0100

    Complete vcode writing to disk

commit 8ff29ed06f9e57d9f9c3b85b4e13f0c6d93379c9
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Sun Oct 23 16:49:49 2016 +0100

    Do not save automatically after lowering

commit c826c31d19626174e0671b2bc3d469c35d5ba183
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Sun Oct 23 16:44:34 2016 +0100

    Start adding code to save vcode units

commit e7a97c0901315510e9aa64408f84c08c6df65f69
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Sun Oct 23 11:30:34 2016 +0100

    Use macros to identify which vcode ops have which fields

commit 68c670a995fd1ad869f92ca96ecedba5a564e963
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Sun Oct 23 10:58:57 2016 +0100

    Make EVAL_VERBOSE a little more useful

commit c8e636039af6ec7402c9a7419d389ce963fb3b54
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Sun Oct 23 10:57:38 2016 +0100

    Fix use-after-free in emit_index

commit 1740f9c7f6010d02d7bd62bcdc35bcdb13e98fd7
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Sat Oct 22 16:46:03 2016 +0100

    Evaluation for vcode op exp

commit 68648d486641e0984f0927fe7c49f9d18cf0bc74
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Sat Oct 22 14:49:12 2016 +0100

    Fix bug that caused real to be optimised away

commit 9d6d75a8062f3d74ea3b7c33813fe90e53c7b710
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Wed Oct 19 19:39:33 2016 +0100

    Vcode evaluation for uarray left/right

commit a887ff99881652b3bedcc72be12d0d811a89c626
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Wed Oct 19 19:33:41 2016 +0100

    No-op implementation for heap save/restore

commit c8d1d6d898f942564d26b2599d1f15c0882c01b5
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Wed Oct 19 18:21:30 2016 +0100

    Vcode evaluation for 'IMAGE attribute

commit 9af7b3529fc0b3e6d1297c701fc714bb86ea865e
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Wed Oct 19 09:29:01 2016 +0100

    Bounds elision for real variables

commit 5b321d2e633e1b055b7edffa5d5317f82a5ba32e
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Tue Oct 18 18:23:04 2016 +0100

    Implement abs in vcode evaluator

commit ba17bc0fa0bf1b2444ec51bfab0c54b43954aded
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Tue Oct 18 17:43:22 2016 +0100

    Bounds checking at evaluation time

commit 214b84da5ae2d1dc8ea6211772ed904f53619530
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Tue Oct 18 11:35:07 2016 +0100

    Vcode evaluation for alloca and index check operations

commit 9597ee6adfee92770b006947123c8c514f5ee598
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Tue Oct 18 10:51:43 2016 +0100

    Vcode elaboration for report and assert

commit 55048e269a1bfe8b0251473a01f0ac07daeb5e6a
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Tue Oct 18 10:16:33 2016 +0100

    Vcode bookmarks now store the tree directly

commit e88a69f6ef9fc0ac8518ed21c6a1ad20ecb1c08e
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Sun Oct 16 19:36:12 2016 +0100

    Improve lowering of if statements where the condition is constant

commit f05d644ee73c07f5d8933a18138f19412f281a07
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Sun Oct 16 19:05:36 2016 +0100

    Fix evaluation of integer to integer cast

commit f7a6cc267ad71195738ed7a8efb29565a22804ff
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Thu Oct 13 11:55:54 2016 +0100

    Evaluation of some operations on pointers and arrays

commit 79d1976f0d112f6b0030aa35f465ef9bd26d7cc7
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Thu Oct 13 10:22:32 2016 +0100

    Fix generation of useless heap save operations

commit 2869ad50d6dc54b91dfd28b71fc4f346fc20fe8a
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Thu Oct 13 10:13:33 2016 +0100

    Fix vcode evaluation of mod and rem operators

commit 780fc439888c7169cd70ebb85cf9d1650031e1da
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Wed Oct 12 20:50:51 2016 +0100

    Make fold_tree_fn also fold trivial constants

commit eedee901a4a8ea31ed8ea13f25484dbb2f905266
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Wed Oct 12 20:39:50 2016 +0100

    Evaluation for vcode dynamic bounds op

commit 9265c1b9504336cdfb0a79094ef6c318e40ee731
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Wed Oct 12 20:34:34 2016 +0100

    Remove duplicate call to lower_unit

commit f54574e4828b5f85b6e57d00aa95a2b28ee29e60
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Wed Oct 12 20:30:37 2016 +0100

    Split out constant folding from simplification pass

commit 89a5c5053162ea060816d5fb08eee26b5f19ccdd
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Wed Oct 12 20:21:54 2016 +0100

    Fix naming collisions

commit 0a9922a74c957c68678f0c589bf89619d8e35d5a
Author: Nick Gasson <nick@nickg.me.uk>
Date:   Wed Oct 12 14:58:56 2016 +0100

    Rewrite the complile time evaluator to use vcode

    Squashed commit of the following:

    commit d6106c2eb41b98b51560b2725e783c876b2e3577
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Wed Oct 12 14:47:58 2016 +0100

        Always lower before elaboration

    commit 87c6d715dda9b78759fd85882e55f54564663fae
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Wed Oct 12 13:50:54 2016 +0100

        New type vcode_bookmark_t to abstract tree index in vcode

    commit d0665b79b7407c379ff5333616055c5b36bcf1c9
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Tue Oct 11 14:37:20 2016 +0100

        New approach to early lowering

    commit c8aa4b2894e78bc41ea73835e3cac1a753664ccb
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Sun Oct 9 21:21:47 2016 +0100

        Add an undefined operation to simplify error handling when lowering

    commit 27c9cec0d591b191a861578bb738bc83d848916a
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Sun Oct 9 17:35:21 2016 +0100

        Fix crash in eval_possible

    commit d6525fae819d611bc1130aeceb0fe056788e1f88
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Sun Oct 9 17:07:25 2016 +0100

        Fix error when local function has not been lowered

    commit 50aebfe8c788997123fb3b53024ad5d3a169639b
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Thu Oct 6 17:52:23 2016 +0100

        The llvm.expect.i1 intrinsic breaks optimisation sometimes

    commit b74eea9c628694d6873b8435bdaa5bd81754c85c
    Merge: 24049a4 900193c
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Sun Oct 9 14:23:42 2016 +0100

        Merge branch 'master' into vcode-simp

    commit 24049a406b6d0792fa5cb06cf16c8199d52a05e9
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Thu Oct 6 10:49:43 2016 +0100

        Vcode evaluation for sub operator

    commit fd85f6c0fb2536a4babe9712a88f61c8d4089642
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Thu Oct 6 10:32:08 2016 +0100

        Fix rewriting non-scalar function calls to null

    commit 96aeef6acdf168d0dd0ca0d48a1bb0222d738514
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Thu Oct 6 10:09:44 2016 +0100

        Couple of test fixes

    commit d06578c0a754ad04793d898e1a9e0dc0628ebe7f
    Merge: f630db0 defb3f3
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Thu Oct 6 09:53:15 2016 +0100

        Merge branch 'master' into vcode-interp

    commit f630db0564f073025b9d6aa5821e5aa2d4d1ac5f
    Merge: bb247f9 116f1bf
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Sat Jun 11 12:25:29 2016 +0100

        Merge branch 'master' into vcode-interp

    commit 116f1bfd6b6b146567734cf85758a873f1591620
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Sat Jun 11 12:24:56 2016 +0100

        Improvements to VHPI tracing

    commit 31857d6f382c49d355a07734fc072809426a3b3b
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Sat Jun 11 10:14:44 2016 +0100

        Add --list command to print all units in a library

    commit c64438e2c2751e5de171f604ae2e113cabfee6bd
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Sat Jun 11 09:26:02 2016 +0100

        Update HISTORY.md

    commit bb247f9ffd221169730c5dd785cfa8395cfa5b5c
    Merge: a37defa 54dd15f
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Sat May 14 16:31:53 2016 +0100

        Merge branch 'master' into vcode-interp

    commit a37defa41d5caedb0908fc54cde86346846e753d
    Merge: 1f40ff0 c84b298
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Sun May 1 17:59:03 2016 +0100

        Merge branch 'master' into vcode-interp

    commit 1f40ff0fd5402dca3e5b1a39c9a5cdc116589aad
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Sun Apr 24 15:42:11 2016 +0100

        Keep track of heap memory allocated during evaluation

    commit a61890de59a762e46c9eeafae81c9e5cae88bd8d
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Sun Apr 24 15:32:07 2016 +0100

        Fix evaluation of uarray wrapping

    commit e5164ecb2323baa6a96ec3021537abf75b5c2ca3
    Merge: f1d80e9 e486477
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Wed Feb 17 20:46:45 2016 +0000

        Merge branch 'master' into vcode-interp

    commit f1d80e94881199f5f0c5366c26b11867fc837a75
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Sun Jan 31 10:56:00 2016 +0000

        Improve error reporting with builtins

    commit 8de29b4b3d18d8f7aa6fc08231fb0cf680817d42
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Thu Dec 31 21:45:04 2015 +0000

        Add missing comparison operators

    commit ddf0db65cf4e044743439630864b2afb279063a5
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Tue Dec 29 11:22:16 2015 +0000

        Vcode interpreter improvements

    commit fe600f471910f888331076b13470a8161041a933
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Thu Dec 24 15:52:53 2015 +0000

        Fix build after merge

    commit 649e18a80fce2b1b2060739208026634966bf79d
    Merge: 04663f1 f6cf322
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Thu Dec 24 15:49:35 2015 +0000

        Merge branch 'master' into vcode-interp

    commit 04663f1c7cfd85f734c43f76a9f7a67dae025c53
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Sun Sep 27 18:11:57 2015 +0100

        Add vcode evaluation for memcmp

    commit 4ee32841ac09da5fcc7f3025feff9582b207c1bc
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Fri Sep 25 21:30:19 2015 +0100

        Extend vcode evaluator to more operations

    commit 28c08a1fbefee68eadaef1adc5839c359820cbfd
    Merge: 82e03ac c39dd33
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Sat Sep 12 12:23:08 2015 +0100

        Merge branch 'master' into vcode-interp

    commit 82e03acc7f6b3baa959a248ba2e079e229f8806f
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Sat Sep 12 10:20:25 2015 +0100

        Initial version of vcode interpreter

    commit 42c769c7fbccfbbd49c76fd5237d2a6e85b76792
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Sat Sep 12 09:41:34 2015 +0100

        Various thunking fixes

    commit ddf0096362947d9bebd8efa046c1a4c41bd7167e
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Tue May 12 22:50:35 2015 +0100

        Start adding vcode operations for thunking

        Conflicts:
         src/lower.c

    commit 742772241f62e8296b36566b88cc2eebbafdbda7
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Sun Aug 9 09:06:35 2015 +0100

        Use a hash table to store vcode object mappings

    commit af2f01dbaca3091edf498a52bd59177b367f5143
    Author: Nick Gasson <nick@nickg.me.uk>
    Date:   Sun Aug 9 11:54:52 2015 +0100

        Dumping for NEXT statments
54 files changed:
nvc.1
src/array.h
src/cgen.c
src/common.c
src/common.h
src/dump.c
src/elab.c
src/eval.c
src/fbuf.c
src/fbuf.h
src/hash.c
src/hash.h
src/ident.c
src/ident.h
src/lower.c
src/nvc.c
src/object.c
src/object.h
src/phase.h
src/prim.h
src/simp.c
src/tree.c
src/tree.h
src/type.c
src/type.h
src/util.c
src/vcode.c
src/vcode.h
test/elab/eval1.vhd [new file with mode: 0644]
test/lower/assert1.vhd [new file with mode: 0644]
test/lower/iffold.vhd [new file with mode: 0644]
test/lower/real1.vhd [new file with mode: 0644]
test/lower/thunk.vhd [new file with mode: 0644]
test/lower/wait1.vhd
test/regress/arith1.vhd
test/regress/bitvec.vhd
test/regress/const6.vhd
test/regress/func8.vhd
test/regress/ieee4.vhd
test/regress/ieee5.vhd [new file with mode: 0644]
test/regress/issue143.vhd
test/regress/proc3.vhd
test/regress/real1.vhd
test/regress/record6.vhd
test/regress/shift2.vhd
test/regress/testlist.txt
test/simp/cfold.vhd
test/simp/ffold.vhd
test/simp/shift2.vhd [new file with mode: 0644]
test/test_elab.c
test/test_ident.c
test/test_lower.c
test/test_simp.c
test/test_util.c