simulate sll function with Modelsim - VHDL

OP (Company: mk_vhdl) #2619904
Rate this post
• ▲ useful
▼ not useful
Hello to all,

I am writing a VHDL code in ISE 9.2, using Modelsim PE 10 Student 
Edition for simulation. I want to use the sll function in order to 
rotate a std_logic_vector. When I synthesize the following code with ISE 
I do not get any errors. But when I am trying to simulate my program 
using Modelsim, I get only "U" signals. Could somebody tell me what I am 
doing wrong?

Thanks in advance

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
--use IEEE.numeric_std.ALL;

entity shifter is

    Port ( Bus_B : in  STD_LOGIC_VECTOR (31 downto 0);
           shamt_in : in  STD_LOGIC_VECTOR (4 downto 0);
           shift_out : out  STD_LOGIC_VECTOR (31 downto 0));
end shifter;

architecture Behavioral of shifter is
        signal B_32 : bit_vector(31 downto 0);
  signal temp : std_logic_vector(31 downto 0);
begin


process ( Bus_B, shamt_in)
begin

  B_32 <= to_bitvector(Bus_B) sll conv_integer(shamt_in);
  temp <= to_stdlogicvector(B_32);

end process;

shift_out <= temp;

end Behavioral;
Moderator (Company: Titel) #2619923
Rate this post
• ▲ useful
▼ not useful
> I want to use the sll function in order to rotate a std_logic_vector.
The sll performs a shift operation, not a rotate operation...

> But when I am trying to simulate my program using Modelsim,
> I get only "U" signals.
How does your testbench look like? Can you post it?
OP (Company: mk_vhdl) #2619963
Rate this post
• ▲ useful
▼ not useful
You have right. Thanks a lot for your response. I think that I have 
found my problem. I typed this process in my test bench

  tb : PROCESS
  BEGIN

    -- Wait 100 ns for global reset to finish
    wait for 100 ns;

    shamt_in<="00001";
    Bus_B<=X"111111110";

    wait; -- will wait forever
  END PROCESS;

But I have made mismatch of the amount of bits in the HEX number. I 
should have typed Bus_B<=X"11111110";
The strange thing is that while I was running Modelsim I didn't get any 
warnings or errors. But now that I have restarted Modelsim and rerun my 
project I got the warning message, so I managed to fix the problem. Do 
you know why that happened?

Thanks a lot again for your response

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.