diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-02-02 04:07:58 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-02-02 04:08:35 +0100 |
commit | 06ad7f3fce8b0091c04e19445c5e921099821052 (patch) | |
tree | 31765a9208cc072bd262a5d270469a6b4621c534 /src/grt | |
parent | 5e2d13667462f3db6d7b4d1e8933c3ae7e41d1b1 (diff) | |
download | ghdl-06ad7f3fce8b0091c04e19445c5e921099821052.tar.gz ghdl-06ad7f3fce8b0091c04e19445c5e921099821052.tar.bz2 ghdl-06ad7f3fce8b0091c04e19445c5e921099821052.zip |
ghwlib: handle b2 range, fix print of multi-dim arrays.
Diffstat (limited to 'src/grt')
-rw-r--r-- | src/grt/ghwlib.c | 16 | ||||
-rw-r--r-- | src/grt/ghwlib.h | 1 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/grt/ghwlib.c b/src/grt/ghwlib.c index 2db63d9c9..658c6a6c4 100644 --- a/src/grt/ghwlib.c +++ b/src/grt/ghwlib.c @@ -426,6 +426,16 @@ get_range_length (union ghw_range *rng) return (rng->i32.left - rng->i32.right + 1); else return (rng->i32.right - rng->i32.left + 1); + case ghdl_rtik_type_b2: + if (rng->b2.dir) + return (rng->b2.left - rng->b2.right + 1); + else + return (rng->b2.right - rng->b2.left + 1); + case ghdl_rtik_type_e8: + if (rng->e8.dir) + return (rng->e8.left - rng->e8.right + 1); + else + return (rng->e8.right - rng->e8.left + 1); default: fprintf (stderr, "get_range_length: unhandled kind %d\n", rng->kind); abort (); @@ -1601,6 +1611,10 @@ ghw_disp_range (union ghw_type *type, union ghw_range *rng) { switch (rng->kind) { + case ghdl_rtik_type_b2: + printf ("%s %s %s", ghw_get_lit (type, rng->b2.left), + ghw_get_dir (rng->b2.dir), ghw_get_lit (type, rng->b2.right)); + break; case ghdl_rtik_type_e8: printf ("%s %s %s", ghw_get_lit (type, rng->e8.left), ghw_get_dir (rng->e8.dir), ghw_get_lit (type, rng->e8.right)); @@ -1711,7 +1725,7 @@ ghw_disp_type (struct ghw_handler *h, union ghw_type *t) { if (i != 0) printf (", "); - ghw_disp_range ((union ghw_type *)a->base, a->rngs[i]); + ghw_disp_range (a->base->dims[i], a->rngs[i]); } printf (");\n"); } diff --git a/src/grt/ghwlib.h b/src/grt/ghwlib.h index 0138267ed..100fb5b6f 100644 --- a/src/grt/ghwlib.h +++ b/src/grt/ghwlib.h @@ -129,6 +129,7 @@ struct ghw_range_f64 union ghw_range { enum ghdl_rtik kind : 8; + struct ghw_range_b2 b2; struct ghw_range_e8 e8; struct ghw_range_i32 i32; struct ghw_range_i64 i64; |