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.

Syntax error near "when"

Status
Not open for further replies.

mo.khairy.mo

Member level 2
Joined
Dec 17, 2008
Messages
47
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Location
Egypt
Activity points
1,548
hi all
what's the error in this vhdl code

Code:
when (opcode = addu) =>
	   I0 : int_2s_add_sub
      PORT MAP (
         clk           => clk,
	 enable      => '1',
         rst           => rst,
         opa         => opa,
         opb         => opb,
         M	       => '0',
         OVF 	       => flags(5),
         opc 	       => opc
      );


if i need to port map some components depend on conditions how can i do it?


thanks in advance
 

use block statement . depending on the "guarded " condition assignment will take place
 

Hi,

Use the generate statement instead of your when:

g0: if (opcode = addu) generate
I0 : int_2s_add_sub
PORT MAP (
clk => clk,
enable => '1',
rst => rst,
opa => opa,
opb => opb,
M => '0',
OVF => flags(5),
opc => opc
);
end generate;
 
thanks all
@balavinayagam
could u please support me with an example
@devas
i try what u suggest and i have the following error
"generate condition is not constant"
how can i fix it ?!
 

Hi,

That's a problem. The generate condition must be static, i.e. it cannot include signals. I was forgotten this. I do not know if you can change the condition so it becomes static. Maybe the block suggestion will work but I have never used block statements so I have no idea.

Success, Devas
 
Hi,

please could u explain what do u mean with static?!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top