EmbDev.net

Forum: FPGA, VHDL & Verilog vivado width mismatch error in synthesis


von Stefania M. (val_1010)


Rate this post
useful
not useful
Hi!
vivado gives me this error :
[Synth 8-690] width mismatch in assignment; target has 16 bits, source 
has 1 bits  for this line :  leds <= "0" & leds(length-1 to 1);
which is inserted in this contest :
1
if leds = led_left then
2
         direction <='1';
3
         leds <= "0" & leds(length-1 to 1);
the leds vector and the main constants are defined in this way :
1
kc: out STD_LOGIC_VECTOR(LENGTH-1 downto 0)
2
length : integer :=16;
3
4
constant kc_in : std_logic_vector(LENGTH-1 downto 0):=std_logic_vector(to_unsigned(2**kc'RIGHT,LENGTH));
5
6
constant led_left : std_logic_vector(LENGTH-1 downto 0) :=
7
std_logic_vector(to_unsigned(2**kc'LEFT,LENGTH));
8
signal leds : STD_LOGIC_VECTOR(length-1 downto 0):=kc_in;
Where is the problem?
thank you very much

: Edited by Moderator
von Lothar M. (Company: Titel) (lkmiller) (Moderator)


Rate this post
useful
not useful
Stefania M. wrote:
> leds <= "0" & leds(length-1 to 1);
Try that instead:
1
  leds <= '0' & leds(length-1 to 1);

: Edited by Moderator
von Christoph Z. (christophz)


Rate this post
useful
not useful
Lothar M. wrote:
> Try that instead:  leds <= '0' & leds(length-1 to 1);

I think, it also needs to be "downto" instead of "to".

von Stefania M. (val_1010)


Rate this post
useful
not useful
I put downto and it worked!! thank you very much I really didn't notice!

: Edited by User
Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.