d***@gmail.com
2020-01-28 15:35:54 UTC
type PACKET_REG_TYPE is array (0 to 127) of std_logic_vector(7 downto 0);
signal common_stream_header : std_logic_vector(63 downto 0);
signal stream_1_tx_int : PACKET_REG_TYPE;
stream_1_tx_int(3 to 10) <= common_stream_header; -- FAIL. Same number bits on each side??
Target type dut_lib.spis_sclk_pkg.PACKET_REG_TYPE in signal assignment is different from expression type ieee.std_logic_1164.STD_LOGIC_VECTOR.
(vcom-1272) Length of expected is 8; length of actual is 64.
stream_1_tx_int(3 to 4) <= common_stream_header(63 downto 48); -- FAIL.
Target type dut_lib.spis_sclk_pkg.PACKET_REG_TYPE in signal assignment is different from expression type ieee.std_logic_1164.STD_LOGIC_VECTOR.
(vcom-1272) Length of expected is 2; length of slice name is 16.
stream_1_tx_int(3 to 4) <= PACKET_REG_TYPE(common_stream_header(63 downto 48)); -- FAIL.
(vcom-1583) Illegal type converson from 'ieee.std_logic_1164.STD_LOGIC_VECTOR' to 'dut_lib.spis_sclk_pkg.PACKET_REG_TYPE' (array element type difference).
(vcom-1272) Length of type "PACKET_REG_TYPE" is 1046; length of operand is 16.
(vcom-1272) Length of expected is 2; length of actual is 1046.
stream_1_tx_int(3 to 4) <= common_stream_header(63 downto 56) & common_stream_header(55 downto 48); -- PASS.
I have an array of bytes as defined above. I want to make assignments to multiple array elements at a time but am having a lot of trouble. In the first example I try to assign a 64-bit signal to 8 elements of the array which ends up being 64-bits as well. It doesn’t work.
I can’t figure why none of the examples of array assignment work?? I even tried type casting. I finally got my code to compile with the last example but it makes coding cumbersome.
Is there a better way to do this. As a note, I tried the VHDL 2008 switch in Modelsim but it just started complaining about my (others => (others => ‘0’) assignments.
signal common_stream_header : std_logic_vector(63 downto 0);
signal stream_1_tx_int : PACKET_REG_TYPE;
stream_1_tx_int(3 to 10) <= common_stream_header; -- FAIL. Same number bits on each side??
Target type dut_lib.spis_sclk_pkg.PACKET_REG_TYPE in signal assignment is different from expression type ieee.std_logic_1164.STD_LOGIC_VECTOR.
(vcom-1272) Length of expected is 8; length of actual is 64.
stream_1_tx_int(3 to 4) <= common_stream_header(63 downto 48); -- FAIL.
Target type dut_lib.spis_sclk_pkg.PACKET_REG_TYPE in signal assignment is different from expression type ieee.std_logic_1164.STD_LOGIC_VECTOR.
(vcom-1272) Length of expected is 2; length of slice name is 16.
stream_1_tx_int(3 to 4) <= PACKET_REG_TYPE(common_stream_header(63 downto 48)); -- FAIL.
(vcom-1583) Illegal type converson from 'ieee.std_logic_1164.STD_LOGIC_VECTOR' to 'dut_lib.spis_sclk_pkg.PACKET_REG_TYPE' (array element type difference).
(vcom-1272) Length of type "PACKET_REG_TYPE" is 1046; length of operand is 16.
(vcom-1272) Length of expected is 2; length of actual is 1046.
stream_1_tx_int(3 to 4) <= common_stream_header(63 downto 56) & common_stream_header(55 downto 48); -- PASS.
I have an array of bytes as defined above. I want to make assignments to multiple array elements at a time but am having a lot of trouble. In the first example I try to assign a 64-bit signal to 8 elements of the array which ends up being 64-bits as well. It doesn’t work.
I can’t figure why none of the examples of array assignment work?? I even tried type casting. I finally got my code to compile with the last example but it makes coding cumbersome.
Is there a better way to do this. As a note, I tried the VHDL 2008 switch in Modelsim but it just started complaining about my (others => (others => ‘0’) assignments.