V
V.
Guest
Hello,
First off, thank you everyone for contributing to this discussion group, it has been very helpful and informative to me as I progress with learning VHDL.
I'm looking to convert a record that contains 16 std_logic types into a 16 bit std_logic_vector. I currently have a function call that manually assigns each element in the record to a specific bit location in the std_logic_vector :
function rec2slv(x : rec_type) return std_logic_vector is
variable result : std_logic_vector(15 downto 0) := (others => '0');
begin
result(15) := x.element1;
...
...
result(0) := x.element16;
return result;
end;
===
I have a large amount of records that I'd like to do this on, and it is very tedious to have to write a function for each of the record.
Is there something similar to the following that could automate it? :
for i in x'range loop
result := x(i);
end loop;
Thank you all!
First off, thank you everyone for contributing to this discussion group, it has been very helpful and informative to me as I progress with learning VHDL.
I'm looking to convert a record that contains 16 std_logic types into a 16 bit std_logic_vector. I currently have a function call that manually assigns each element in the record to a specific bit location in the std_logic_vector :
function rec2slv(x : rec_type) return std_logic_vector is
variable result : std_logic_vector(15 downto 0) := (others => '0');
begin
result(15) := x.element1;
...
...
result(0) := x.element16;
return result;
end;
===
I have a large amount of records that I'd like to do this on, and it is very tedious to have to write a function for each of the record.
Is there something similar to the following that could automate it? :
for i in x'range loop
result := x(i);
end loop;
Thank you all!