Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

VHDL generics question - an error occurs

Status
Not open for further replies.

dohzer

Member level 1
Joined
Oct 25, 2008
Messages
39
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,636
vhdl generics

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?
 

VHDL generics question

Yes, a package is the only option, it can be also placed in the same file as the entity
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top