C
captain
Guest
my module is as follows:
entity tri_state_bus is
Port ( data : inout STD_LOGIC_VECTOR (15 downto 0);
cs : in STD_LOGIC;
rd : in STD_LOGIC;
we : in STD_LOGIC;
clk: in STD_LOGIC;
din : in STD_LOGIC_VECTOR (15 downto 0);
dout : out STD_LOGIC_VECTOR (15 downto 0));
end tri_state_bus;
architecture dbus of tri_state_bus is
begin
process(clk)
begin
if(clk'event and clk='1') then
if(cs='1') then
data<=(others=>'Z');
elsif(rd='0') then
data<=din;
elsif(we='0') then
dout<=data;
end if;
end if;
end process;
end dbus;
------------------
the problem is: i can synthesis by ISE/XST,but i can't obtain the
correct results when simulated using modelsim, can anyone tell me
where is the problem?
entity tri_state_bus is
Port ( data : inout STD_LOGIC_VECTOR (15 downto 0);
cs : in STD_LOGIC;
rd : in STD_LOGIC;
we : in STD_LOGIC;
clk: in STD_LOGIC;
din : in STD_LOGIC_VECTOR (15 downto 0);
dout : out STD_LOGIC_VECTOR (15 downto 0));
end tri_state_bus;
architecture dbus of tri_state_bus is
begin
process(clk)
begin
if(clk'event and clk='1') then
if(cs='1') then
data<=(others=>'Z');
elsif(rd='0') then
data<=din;
elsif(we='0') then
dout<=data;
end if;
end if;
end process;
end dbus;
------------------
the problem is: i can synthesis by ISE/XST,but i can't obtain the
correct results when simulated using modelsim, can anyone tell me
where is the problem?