Guest
Hello folks,
thought I could save the effort of writing a function to pad strings
by using 'Others =>' in a concatenation assignment as follows.
--some VHDL signal declarations
signal Signal_Name: std_logic;
signal My_String: string(1 to 15);
....
....
....
-- some VHDL signal assignments
My_String <= Signal_Name'Simple_Name & (Others => ' ');
So I'm attempting to pad the remaining 4 chars with a space.
Now the compiler tells me I can't use the 'Others' clause with
unconstrained strings, but 'My_String' is constrained, and
Signal_Name'Simple_Name must be constrained, or is it?
Is the reason this fails due to the way the compiler evaluates the
'Simple_Name attribute?
Any ideas?
Regards
John
thought I could save the effort of writing a function to pad strings
by using 'Others =>' in a concatenation assignment as follows.
--some VHDL signal declarations
signal Signal_Name: std_logic;
signal My_String: string(1 to 15);
....
....
....
-- some VHDL signal assignments
My_String <= Signal_Name'Simple_Name & (Others => ' ');
So I'm attempting to pad the remaining 4 chars with a space.
Now the compiler tells me I can't use the 'Others' clause with
unconstrained strings, but 'My_String' is constrained, and
Signal_Name'Simple_Name must be constrained, or is it?
Is the reason this fails due to the way the compiler evaluates the
'Simple_Name attribute?
Any ideas?
Regards
John