diff options
author | Tristan Gingold | 2015-09-10 20:24:33 +0200 |
---|---|---|
committer | Tristan Gingold | 2015-09-10 20:24:33 +0200 |
commit | a67ae38eeedd5d0ca5a75b8174aed201e5c801ad (patch) | |
tree | 9e24b723ab5c8d0d46041433bb3154ffed4527b4 /testsuite/gna/bug019/repro1.vhdl | |
parent | 0e257fe7341a44f097ea282c0cbabda42f4ecc41 (diff) | |
download | ghdl-a67ae38eeedd5d0ca5a75b8174aed201e5c801ad.tar.gz ghdl-a67ae38eeedd5d0ca5a75b8174aed201e5c801ad.tar.bz2 ghdl-a67ae38eeedd5d0ca5a75b8174aed201e5c801ad.zip |
Add bug019 testcase.
Diffstat (limited to 'testsuite/gna/bug019/repro1.vhdl')
-rw-r--r-- | testsuite/gna/bug019/repro1.vhdl | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/testsuite/gna/bug019/repro1.vhdl b/testsuite/gna/bug019/repro1.vhdl new file mode 100644 index 0000000..0e939f8 --- /dev/null +++ b/testsuite/gna/bug019/repro1.vhdl @@ -0,0 +1,51 @@ +entity repro1 is +end repro1; + +architecture arch of repro1 is + type wf_el is record + t : time; + v : bit; + end record; + + type wf_arr is array (natural range <>) of wf_el; + + function get_wf (bv : bit_vector; p : time) return wf_arr is + variable res : wf_arr (bv'range); + variable t : time; + begin + t := 0 ns; + for i in bv'range loop + res (i) := (t => t, v => bv (i)); + t := t + p; + end loop; + return res; + end get_wf; + + procedure play_wf (signal s : out bit; wf : wf_arr; init : bit) is + begin + s <= init; + for i in wf'range loop + wait for wf (i).t; + s <= wf (i).v; + end loop; + wait; + end play_wf; + + function get_str (l : natural; c : character) return string is + begin + return string'(1 to l => c); + end get_str; + + signal o : bit; +begin + play_wf (o, get_wf (b"0110100", 2 ns), '1'); + + process + begin + for i in 1 to 8 loop + report get_str (32 + 4 * i, character'val (64 + i)); + wait for 2 ns; + end loop; + wait; + end process; +end arch; |