wtr
Full Member level 5
Hello all,
I could explicitly code the values I want but I was hoping to use attributes
Where line 242 is refering to the mid'length bit.
I know I can get rid of this error by doing
However this requires I have already declared a signal beforehand. Does anyone know of a way I can use the current signal that I'm trying to code up, or the record type? For example if constant cid_Reg_rst_t didn't exist yet.
Regards,
Wes
I could explicitly code the values I want but I was hoping to use attributes
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 -- The CID register -- DeviCe IDentification register. -- Stores information about device type cid_reg_t is record mid : byte_t; -- Manufacture ID cbx : std_logic_vector(1 downto 0); -- Device/BGA oid : byte_t; -- OEM/Application ID pnm : word48_t; -- Product Name prv : byte_T; -- Product Revision psn : dword_t; -- Product Serial number mdt : byte_t; -- Manufacturing Date crc : word7_t; -- CRC end record; constant cid_reg_rst_t : cid_reg_t := ( mid => (others => '0'), cbx => (others => '0'), oid => (others => '0'), pnm => (others => '0'), prv => (others => '0'), psn => (others => '0'), mdt => (others => '0'), crc => (others => '0')); constant cid_reg_w100_default : cid_reg_t := ( mid => std_logic_vector( to_unsigned( 16#70#, mid'length), cbx => std_logic_vector(to_unsigned(16#1#,cbx'length), oid => std_logic_vector(to_unsigned(16#0#,oid'length), pnm => std_logic_vector(to_unsigned(16#5731303332#,pnm'length), -- W10032 prv => std_logic_vector(to_unsigned(16#B9#,prv'length), psn => std_logic_vector(to_unsigned(16#A60366#,psn'length), mdt => std_logic_vector(to_unsigned(16#12#,mdt'length), crc => std_logic_vector(to_unsigned(16#5E#,crc'length));
Code:
# ** Error: ../tbench/eMMC/emmc_pkg.vhd(242): (vcom-1136) Unknown identifier "mid".
# ** Error: ../tbench/eMMC/emmc_pkg.vhd(242): Prefix of attribute "length" must be appropriate for an array object or must denote an array subtype.
I know I can get rid of this error by doing
Code VHDL - [expand] 1 16#70#, cid_reg_rst_t.mid'length),
However this requires I have already declared a signal beforehand. Does anyone know of a way I can use the current signal that I'm trying to code up, or the record type? For example if constant cid_Reg_rst_t didn't exist yet.
Regards,
Wes