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.

why is this for loop not synthesizable

Status
Not open for further replies.

verilog2vhdl

Newbie level 6
Joined
Oct 22, 2007
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,350
for loop is synthesizable

for i in I_b'RANGE downto 0 LOOP
O_g_tmp(i - 1) <= I_b(i) XOR I_b(i - 1);
END LOOP;


I see the error as

Illegal use of 'range/'reverse_range attribute
 

is I_n(-1) defined?
or should you only go downto 1?
 

The code has been modified as follows and still see the same

for i in I_b'RANGE downto 1 LOOP
O_g_tmp(i - 1) <= I_b(i) XOR I_b(i - 1);
END LOOP;


I see the error as

Illegal use of 'range/'reverse_range attribute
 

for i in I_b'RANGE LOOP
O_g_tmp(i - 1) <= I_b(i) XOR I_b(i - 1);

end loop;

If u want range attribute this is the correct syntax, for range attribute no need to write down to. It will take range according your bit vector.
 

Hi,
'range operator returns whole range of std_logic_vector hence no need to specify 'downto x'.
Which synthesizer you are using ?

Added after 1 minutes:

Hi,
'range operator returns whole range of std_logic_vector hence no need to specify 'downto x'.
Which synthesizer you are using ?
 

I_b'RANGE
you can use different attributes for that

for i in I_b'RANGE loop

if range of I_b is 7 downto 0 then you can use
for i in I_b'high downto 0 loop
for i in I_b'left downto 0 loop

if range of I_b is 0 to 7 then you can use
for i in 0 to I_b'high loop
for i in 0 to I_b'right loop
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top