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 Parameterized GENERIC for port size declaration?

Status
Not open for further replies.

legendbb

Member level 1
Joined
Nov 16, 2013
Messages
34
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,516
I was working on some library component.

To make the module generic, signals and ports have variable size, defined by generic at preprocessing time.

It assume it's OK if I have the math inside STD_LOGIC_VECTOR((cSOME_GENERIC - A + B - C) DOWNTO 0);

But the code looks messy, I try to redefine the size derivation as another generic to clean up (ie. (cDERIVED_GENERIC : integer := A+B+C). But it doesn't seem to work.

What's the right technique for doing this in VHDL?

Regards,
 

Your origional method was correct for VHDL '93 - because you cannot use generics to define other generics.
In the 2008 version of VHDL, you can do what you're trying - but only the newest version of vivado supports it (the new versions of quartus will support it when it gets released soon).
 

Your origional method was correct for VHDL '93 - because you cannot use generics to define other generics.
In the 2008 version of VHDL, you can do what you're trying - but only the newest version of vivado supports it (the new versions of quartus will support it when it gets released soon).

Thanks a lot for your prompt reply, I quickly tried in Vivado 2015.1; Not able to make it to pass synthesis.

BTW, parameter in Verilog allows parameter to be defined by another parameter; which might serve as my alternative for now.
 

IIRC, Vivado 2015.1 supposrts this feature of VHDL 2008 if you change the setting
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top