Re: in the absence of a pre-processor...

Discussion in 'VHDL' started by Mike Treseler, Aug 12, 2010.

  1. 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
     
    Mike Treseler, Aug 12, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christopher Benson-Manica

    system() in the absence of a command processor

    Christopher Benson-Manica, Sep 19, 2006, in forum: C Programming
    Replies:
    9
    Views:
    283
    =?utf-8?B?SGFyYWxkIHZhbiBExLNr?=
    Oct 3, 2006
  2. brahatha
    Replies:
    1
    Views:
    665
  3. KJ
    Replies:
    2
    Views:
    559
  4. Jonathan Bromley

    Re: in the absence of a pre-processor...

    Jonathan Bromley, Aug 12, 2010, in forum: VHDL
    Replies:
    2
    Views:
    519
  5. Thomas Stanka
    Replies:
    1
    Views:
    608
    Thomas Stanka
    Aug 17, 2010
Loading...

Share This Page