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.

generic map in generate statement...

Status
Not open for further replies.

energy_baz

Junior Member level 1
Joined
Nov 24, 2010
Messages
18
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,413
hi,
could anyone please help me....i'm trying to edit my code to be a generate statement...However, I don't know whether is it correct to use this way to implement my code because there are lots of errors on it...
 
Last edited:

energy_baz,
Yes that code should work once you fix the "end GENERATE mo;" to match the declaration at it's start. The generic map statements seem to have too many brackets. Though I do not know why you would write this code, as it would be less to simply write the port maps.

Hope that helps
Sckoarn
 

the following are possible issues:
1.) you have a component with 1 port. It's possible it is an inout port and there is some actual reason for this, but more likely I'm guessing it is a mistake. This does not mean that the design will work if it is an inout port, just that it is the only thing that really would make even the smallest amount of sense, though even that scenario is difficult to believe.
2.) you have if generates inside a for generate which could only have the purpose of allowing 1-3 components to be generated. This seems like a forced use of generate statements that could only make sense if you were trying to determine how generate statement worked despite much easier solutions.
3.) you use "end generate mo" for i0, i1, and i2. this is a syntax error.
4.) you have unmatched parentheses.
5.) I'm not sure if the version of VHDL requires a begin for generates, it might.

it really seems like the entire design could be:
constant wire_a : std_logic_vector(2 downto 0) := "xxx"; -- fill in a value here.

for the generates you could just have a for generate, with adder_a. The select_mode could be set to 2*i+3.

for generates are typically used for duplicated structures, while if-generates are more common with optional functionality.
 
I noticed a bad habit to edit your original posts, deleting the code examples that the other contributions are referring too. In my opinion, it's a serious disregard of the forum members effort to solve your problems - and a pretty strong hint to keep away from it in the future.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top