aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue1420/repro4.vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-08-04 18:51:44 +0200
committerTristan Gingold <tgingold@free.fr>2020-08-04 18:51:44 +0200
commitc969350770eac2f54cf86284c5d3fd95fdcd762c (patch)
tree6e68b7375704578982192716d2fc173c3b9ed704 /testsuite/gna/issue1420/repro4.vhdl
parent75879f13fc03c1c8b3f78f1c415286ab84910e39 (diff)
downloadghdl-c969350770eac2f54cf86284c5d3fd95fdcd762c.tar.gz
ghdl-c969350770eac2f54cf86284c5d3fd95fdcd762c.tar.bz2
ghdl-c969350770eac2f54cf86284c5d3fd95fdcd762c.zip
testsuite/gna: add a test for #1420
Diffstat (limited to 'testsuite/gna/issue1420/repro4.vhdl')
-rw-r--r--testsuite/gna/issue1420/repro4.vhdl68
1 files changed, 68 insertions, 0 deletions
diff --git a/testsuite/gna/issue1420/repro4.vhdl b/testsuite/gna/issue1420/repro4.vhdl
new file mode 100644
index 000000000..2e9842eed
--- /dev/null
+++ b/testsuite/gna/issue1420/repro4.vhdl
@@ -0,0 +1,68 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+package repro4_pkg is
+ type t_av_st is record
+ data : std_ulogic_vector; -- src -> sink
+ valid : std_ulogic; -- src -> sink
+ empty : std_ulogic_vector; -- src -> sink
+ end record t_av_st;
+ type t_arr_av_st is array (NATURAL range <>) of t_av_st;
+end package repro4_pkg;
+
+library ieee;
+use ieee.std_logic_1164.all;
+use work.repro4_pkg.all;
+
+entity repro4_sub is
+ generic(
+ G_SINKS : positive;
+ G_SOURCES : positive
+ );
+ port(
+ avst_sink : inout t_arr_av_st(G_SINKS downto 1);
+ avst_source : inout t_arr_av_st(G_SOURCES downto 1);
+ source_sel : in std_ulogic_vector(G_SOURCES downto 1)
+ );
+end entity;
+
+architecture rtl of repro4_sub is
+-- signal avst_current_sink : t_av_st(data(avst_sink(avst_sink'low).data'range), empty(avst_sink(avst_sink'low).empty'range));
+begin
+
+-- sink_sel_gen: for i in sink_sel'range generate
+-- sink_sel_seq_proc: process(clk) is begin
+-- avst_current_sink.valid <= '0';
+-- end process;
+-- end generate;
+end architecture;
+
+
+library ieee;
+use ieee.std_logic_1164.all;
+use work.repro4_pkg.all;
+
+entity repro4 is
+end entity;
+
+architecture tb of repro4 is
+ constant C_VC_SOURCES : positive := 3;
+ constant C_VC_SINKS : positive := 3;
+
+ subtype vc_sources_range is natural range C_VC_SOURCES downto 1;
+ subtype vc_sinks_range is natural range C_VC_SINKS downto 1;
+
+ signal avst_snk : t_arr_av_st(vc_sinks_range)(data(8 downto 0), empty(0 downto 0));
+ signal avst_src : t_arr_av_st(vc_sources_range)(data(8 downto 0), empty(0 downto 0));
+ signal source_sel : std_ulogic_vector(C_VC_SINKS downto 1);
+begin
+ dut_inst: entity work.repro4_sub
+ generic map (
+ G_SINKS => C_VC_SOURCES,
+ G_SOURCES => C_VC_SINKS)
+ port map (
+ avst_sink => avst_src,
+ avst_source => avst_snk,
+ source_sel => source_sel
+ );
+end architecture tb;