Entity Generics Question

Joined
Aug 21, 2009
Messages
1
Reaction score
0
I'm declaring the following interface and getting the following error:

Code:
entity entity_a is
	generic 
	(
		SIG_A_WIDTH 		: integer := 16;
		SIG_B_WIDTH 		: integer := 2;
		SIG_C_WIDTH		: integer := SIG_WIDTH_A - SIG_WIDTH_B;
	);

	port 
	(
		...
		blah
		...
	);
end entity_a;

Code:
Object 'sig_a_width' cannot be used within the same interface as it is declared

I want to be able to define "SIG_C_WIDTH" as a function of the other two widths, so is there an easier and/or more correct way to do it? Should I be declaring it in a separate package or somewhere else in the code?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top