четверг, 24 сентября 2020 г., 23:47:01 UTC+3 пользователь Rick C написал:
type LED_RED_rng is range 23 downto 16;
subtype LED_RED_rng is integer range 23 downto 16;
On Friday, September 25, 2020 at 1:26:20 AM UTC-4, andrew_b wrote:написал:
четверг, 24 сентября 2020 г., 23:47:01 UTC+3 пользователь Rick C
Well I really think it does.type LED_RED_rng is range 23 downto 16;
subtype LED_RED_rng is integer range 23 downto 16;
That doesn't do what I want.
To use the subtype you've defined it would need to be
", Red = " & to_hstring(RGB(LED_RED_rng'range)) &
which is still more complexity than desired.
On 9/25/20 6:03 PM, Rick C wrote:
On Friday, September 25, 2020 at 1:26:20 AM UTC-4, andrew_b wrote:написал:
четверг, 24 сентября 2020 г., 23:47:01 UTC+3 пользователь Rick C
type LED_RED_rng is range 23 downto 16;
subtype LED_RED_rng is integer range 23 downto 16;
That doesn't do what I want.Well I really think it does.
[...]
To use the subtype you've defined it would need to be
", Red = " & to_hstring(RGB(LED_RED_rng'range)) &
which is still more complexity than desired.
No, the range attribute is only defined for objects of the array types. Again, I really think Andrew's suggestion is the way to go (I would have used natural instead of integer but it doesn't change anything)
Nicolas
On Friday, September 25, 2020 at 5:24:58 PM UTC-4, Nicolas Matringewrote:
subtype to select the bits 23 downto 16 in the array RGB. Is it justOn 9/25/20 6:03 PM, Rick C wrote:
> On Friday, September 25, 2020 at 1:26:20 AM UTC-4, andrew_b wrote:
>> четверг, 24 сентября 2020 г., 23:47:01 UTC+3 пользователь Rick C
написал:
>>> type LED_RED_rng is range 23 downto 16;
>>
>> subtype LED_RED_rng is integer range 23 downto 16;
>
> That doesn't do what I want.
Well I really think it does.
[...]
> To use the subtype you've defined it would need to be
>
> ", Red = " & to_hstring(RGB(LED_RED_rng'range)) &
>
> which is still more complexity than desired.
No, the range attribute is only defined for objects of the array types.
Again, I really think Andrew's suggestion is the way to go (I would have
used natural instead of integer but it doesn't change anything)
Nicolas
Please show me what you mean. I don't see how to use an integer
RGB(LED_RED_rng)Well I'm sorry I can't explain the reasons behind this, I'm not an LRM
???
I would not expect that to work. Perhaps you can explain?
On 9/26/20 1:24 AM, Rick C wrote:
On Friday, September 25, 2020 at 5:24:58 PM UTC-4, Nicolas Matringewrote:
On 9/25/20 6:03 PM, Rick C wrote:
> On Friday, September 25, 2020 at 1:26:20 AM UTC-4, andrew_b wrote:
>> четверг, 24 сентября 2020 г., 23:47:01 UTC+3 пользователь Rick C
написал:
>>> type LED_RED_rng is range 23 downto 16;
>>
>> subtype LED_RED_rng is integer range 23 downto 16;
>
> That doesn't do what I want.
Well I really think it does.
[...]
> To use the subtype you've defined it would need to be
>
> ", Red = " & to_hstring(RGB(LED_RED_rng'range)) &
>
> which is still more complexity than desired.
No, the range attribute is only defined for objects of the array types.
Again, I really think Andrew's suggestion is the way to go (I would have
used natural instead of integer but it doesn't change anything)
Nicolas
Please show me what you mean. I don't see how to use an integersubtype to select the bits 23 downto 16 in the array RGB. Is it just
RGB(LED_RED_rng)
???
I would not expect that to work. Perhaps you can explain?Well I'm sorry I can't explain the reasons behind this, I'm not an LRM expert. I am absolutely no authoritative source.
I know, because I've used it in the past, that you can define a subtype
and use it as a range, at least in the declaration of an array object :
subtype my_range is natural range 23 downto 16;
signal my_vector is std_logic_vector(my_range);
I see no reason why this wouldn't work in your case. Why don't you give
it a try ?
Nicolas
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 44:49:13 |
Calls: | 6,648 |
Files: | 12,197 |
Messages: | 5,329,717 |