EmbDev.net

Forum: FPGA, VHDL & Verilog Error: Range expressions could not be resolved to constant


von Rohan Narkhede (Guest)


Attached files:

Rate this post
0 useful
not useful
Hi all,

I get an error as : Range expressions could not be resolved to constant 
in the for loop:

for i in nshft-1 downto 0 loop

where - signal nshft : integer range 32 downto 1;

Is it because that I am assigning an integer with a range limit to a
constant iterator in for loop? In that case what would be the solution?
Please see the code and screenshot attached.

Thanks and regards,
Rohan Narkhede

von Lothar M. (lkmiller) (Moderator)


Rate this post
0 useful
not useful
Rohan Narkhede wrote in post #4372153:
> Is it because that I am assigning an integer with a range limit to a
> constant iterator in for loop?
"Range" in this error message is the loop range "nshft-1 downto 0".

A for-loop in VHDL is only allowed with constant values for synthesis. 
Obviously nshift is not a constant value...

Look at the barrel shifter in https://embdev.net/topic/346009

BTW: Only one thread with the same question pls.

: Edited by Moderator

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.