On 8/11/2010 7:51 PM, Mark McDougall wrote:
> I have a bunch of constants that can change from build to build, depending
> on what I'm targeting. Right now I'm simply commenting/out a whole set of
> lines each time. eg:
>
> --constant A : std_logic_vector(3 downto 0) := X"0";
> --constant B : std_logic_vector(3 downto 0) := X"1";
> --constant C : std_logic_vector(3 downto 0) := X"2";
> --constant D : std_logic_vector(3 downto 0) := X"3";
>
> constant A : std_logic_vector(3 downto 0) := X"3";
> constant B : std_logic_vector(3 downto 0) := X"4";
> constant C : std_logic_vector(3 downto 0) := X"5";
> constant D : std_logic_vector(3 downto 0) := X"6";
>
> Short of diving into configurations etc, does anyone have a handy trick
> they use in these sorts of situations? The idea is to be able to
> change/comment only 1/2 lines to achieve the above...
I would declare an array: bunch_o_constants_t
That might give me only one line to comment.
If the values are computable from a parameter,
as in the example, I might use a function on the right side.
-- Mike Treseler
|