aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue1346/memory_map.vhd
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/gna/issue1346/memory_map.vhd')
-rw-r--r--testsuite/gna/issue1346/memory_map.vhd68
1 files changed, 68 insertions, 0 deletions
diff --git a/testsuite/gna/issue1346/memory_map.vhd b/testsuite/gna/issue1346/memory_map.vhd
new file mode 100644
index 000000000..f55dd64a1
--- /dev/null
+++ b/testsuite/gna/issue1346/memory_map.vhd
@@ -0,0 +1,68 @@
+library ieee;
+ use ieee.std_logic_1164.all;
+ use ieee.numeric_std.all;
+ use ieee.MATH_REAL.all;
+
+library work;
+ use work.wb_rst_pkg.all;
+ use work.memory_map_pkg.all;
+
+entity memory_map is
+ generic
+ ( yes_g : std_logic :='1'
+ );
+ port
+ ( p_i : in memory_map_i_t;
+ p_o : out memory_map_o_t
+ );
+
+end memory_map;
+architecture rtl of memory_map is
+
+ alias clk_i : std_ulogic is p_i.dmn.clk;
+ alias rst_i : std_ulogic is p_i.dmn.rst;
+
+ type reg_t is record
+ p_o
+ : memory_map_o_t
+ ( wb_S2M
+ ( tgd( 0 downto 0 )
+ , dat( p_i.wb_M2S.dat'length - 1 downto 0 ) )
+ , en( p_o.en'length - 1 downto 0 )
+ , reg( 0 to p_o.en'length - 1 )( p_o.dat'length - 1 downto 0 )
+ );
+
+ end record;
+
+ signal a
+ , r
+ : reg_t;
+
+begin
+
+ p_o <= r.p_o;
+
+ process( p_i, r )
+ variable a_v : reg_t;
+ begin
+ a_v := r;
+
+ if rst_i = yes_g then
+ set_wb_rst( a_v.p_o.wb_S2M );
+ end if;
+
+ a <= a_v;
+ end process;
+
+ process( clk_i )
+ begin
+ if rising_edge ( clk_i ) then
+ r <= a;
+ end if;
+ end process;
+end rtl;
+--#######################################################################################
+--#######################################################################################
+--#######################################################################################
+--#######################################################################################
+--#######################################################################################