diff --git a/src/io_type_pkg.vhd b/src/io_type_pkg.vhd new file mode 100644 index 0000000..63a940c --- /dev/null +++ b/src/io_type_pkg.vhd @@ -0,0 +1,22 @@ +library IEEE; +use IEEE.MATH_REAL.all; + +package io_types is + + type interface_def_t is record + name: string (1 to 20); + payload_width, control_width: natural; + end record interface_def_t; + + type interface_arr_t is array (natural range <>) of interface_def_t; + + constant interface_arr : interface_arr_t := ( + 0 => ("SoCBridge x ", 8, 2), + 1 => ("SoCBridge x ", 8, 2), + 2 => ("SoCBridge x ", 8, 2), + 3 => ("SoCBridge x ", 8, 2), + 4 => ("SoCBridge x ", 8, 2), + 5 => ("SoCBridge x ", 8, 2) + ); + +end package io_types; diff --git a/src/test.vhd b/src/test.vhd new file mode 100644 index 0000000..fc65466 --- /dev/null +++ b/src/test.vhd @@ -0,0 +1,25 @@ +library IEEE; +library work; +use work.io_types.all; + +entity test is + port ( + t : in interface_arr_t(0 to interface_arr'length - 1) + ); +end entity test; + +architecture rtl of test is + +begin + + proc_name: process + begin + + for x in 0 to (interface_arr'length - 1) loop + report interface_arr(x).name ; + end loop; + wait; + end process proc_name; + + +end architecture rtl;