B
Brad Smallridge
Guest
Hello group,
I have been updating some of my code and started using
records to try to organize and parameterize the code.
Specifically I have a record type, signals, and arrays
like this:
package blobleft_package is
type f1_type is record
left_edge : std_logic_vector(11 downto 0);
left_orig : std_logic_vector(11 downto 0);
done : std_logic;
height : std_logic_vector(8 downto 0);
age : std_logic_vector(8 downto 0);
end record;
end blobleft_package;
I like the way this has improved my code, and the way
the sigs look in ModelSim, except for the problem when I
need to connect to a module that has been previously
defined as an unconstrained std_logic_vector:
f1_di_std(11 downto 0) <= f1_di.left_edge;
f1_di_std(23 downto 12) <= f1_di.left_orig;
f1_di_std(24) <= f1_di.done;
f1_di_std(35 downto 27) <= f1_di.height;
f1_di_std(44 downto 36) <= f1_di.age;
f1_fifox: fifox
port map(
clk => clk,
reset => reset,
wr => f1_wr,
di => f1_di_std,
rd => f1_rd,
do => f1_do_std );
f1_do.left_edge <= f1_do_std(11 downto 0);
f1_do.left_orig <= f1_do_std(23 downto 12);
f1_do.done <= f1_do_std(24);
f1_do.height <= f1_do_std(35 downto 27);
f1_do.age <= f1_do_std(44 downto 36);
Fifox is a first_in_first_out register based
on an inferred RAM and counters.
I suppose I could make the input side of this
more automatic by using a concatenate operator,
but I don't see how to unconcatenate this
automatically on the output side.
I also do not know if it is possible to rewrite
the fifox module with unconstrained record type
inputs.
Some advise on what to do here would be greatly
appreciated.
Regards,
Brad Smallridge
Ai Vision
I have been updating some of my code and started using
records to try to organize and parameterize the code.
Specifically I have a record type, signals, and arrays
like this:
package blobleft_package is
type f1_type is record
left_edge : std_logic_vector(11 downto 0);
left_orig : std_logic_vector(11 downto 0);
done : std_logic;
height : std_logic_vector(8 downto 0);
age : std_logic_vector(8 downto 0);
end record;
end blobleft_package;
I like the way this has improved my code, and the way
the sigs look in ModelSim, except for the problem when I
need to connect to a module that has been previously
defined as an unconstrained std_logic_vector:
f1_di_std(11 downto 0) <= f1_di.left_edge;
f1_di_std(23 downto 12) <= f1_di.left_orig;
f1_di_std(24) <= f1_di.done;
f1_di_std(35 downto 27) <= f1_di.height;
f1_di_std(44 downto 36) <= f1_di.age;
f1_fifox: fifox
port map(
clk => clk,
reset => reset,
wr => f1_wr,
di => f1_di_std,
rd => f1_rd,
do => f1_do_std );
f1_do.left_edge <= f1_do_std(11 downto 0);
f1_do.left_orig <= f1_do_std(23 downto 12);
f1_do.done <= f1_do_std(24);
f1_do.height <= f1_do_std(35 downto 27);
f1_do.age <= f1_do_std(44 downto 36);
Fifox is a first_in_first_out register based
on an inferred RAM and counters.
I suppose I could make the input side of this
more automatic by using a concatenate operator,
but I don't see how to unconcatenate this
automatically on the output side.
I also do not know if it is possible to rewrite
the fifox module with unconstrained record type
inputs.
Some advise on what to do here would be greatly
appreciated.
Regards,
Brad Smallridge
Ai Vision