Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Re: in the absence of a pre-processor...

Reply
Thread Tools

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

 
 
Mike Treseler
Guest
Posts: n/a
 
      08-12-2010
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
During my absence Network Guru MCSE 21 05-15-2006 07:13 PM
Debugging ASP.NET in absence of VS.NET =?Utf-8?B?Um95?= ASP .Net 5 12-15-2005 02:55 AM
Visual Age for Java - java.awt.robot class absence? Rafal Majda Java 2 04-12-2005 10:03 AM
in wxPython, how to minimize the window in absence of minimize button? Erik Bethke Python 1 02-08-2005 03:35 PM
Java classes - conspicuous by their absence. taylorius Java 1 01-08-2004 04:59 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57