IOQ

advertisement
Below is the code that was running followed by the force file.
-Steen
168 stinky.ece.pdx.edu> cat ioq.vhd
package types is
-- different types of status the IOQ entry can be in
type IOQ_statii is (INIT,ARB,REQ,SNOOP,RESP,PEND_TRDY,DATA);
-- Description of the full IOQ record
type IOQ_field is record
IOQ_ID : integer range 0 to 7;
IOQ_status : IOQ_statii;
-- add other field elements here
end record;
end types;
use work.types.all;
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
entity IOQ_ent is
port (
TRDY, RESET,BCLK : in STD_LOGIC;
arb_start, arb_success, our_snoop, dxu_done : STD_LOGIC;
ff,fe : out STD_LOGIC;
data_out : out STD_LOGIC_VECTOR (7 downto 0 ));
end IOQ_ent;
architecture IOQ_arch of IOQ_ent is
type IOQ_MEM is array(0 to 7) of IOQ_field;
signal memory : IOQ_MEM;
signal wr_ptr,rd_ptr : STD_LOGIC_VECTOR(2 downto 0);
signal ifempty,iffull : STD_LOGIC;
begin
process(RESET, BCLK)
begin
if reset='0' then
iffull <= '0';
ifempty <= '1';
wr_ptr <= (others=>'0');
rd_ptr <= (others=>'0');
data_out <= (others=>'0');
for I in memory'range loop
memory(I).IOQ_ID <= 0;
memory(I).IOQ_status <= INIT;
end loop;
--Below are state transitions of IOQ buffer
elsif BCLK'event and BCLK='1' then
if arb_start='1' and iffull='0' then
memory(CONV_INTEGER(wr_ptr)).IOQ_status <= ARB;
wr_ptr <= wr_ptr+1;
ifempty <= '0';
if (wr_ptr+1)=rd_ptr then
iffull <= '1'; -- declare full!
end if; -- end fullcheck
elsif dxu_done='1' and ifempty ='0' then
-- transition to done
rd_ptr <= rd_ptr+1;
iffull <= '0';
if (rd_ptr+1)=wr_ptr then
ifempty <= '1'; -- declare empty!
end if; -- end emptycheck
end if; -- end state transistion
for I in memory'range loop
-- need to add for multiple pending ARB
if memory(I).IOQ_status = ARB and arb_success='1' then
memory(I).IOQ_status <= REQ;
end if;
-- need to add for multiple pending snoops
if memory(I).IOQ_status = REQ and our_snoop='1' then
memory(I).IOQ_status <= RESP;
end if;
if memory(I).IOQ_status = RESP and TRDY='0' then
memory(I).IOQ_status <= PEND_TRDY;
end if;
if memory(I).IOQ_status = PEND_TRDY and TRDY='1' then
memory(I).IOQ_status <= DATA;
end if;
end loop;
end if; -- end all
end process;
fe <= ifempty;
ff <= iffull;
end IOQ_arch;
169 stinky.ece.pdx.edu>
170 stinky.ece.pdx.edu> cat doit.do
project open /u/steenl/IOQ/IOQ
view *
vsim work.ioq_ent
force bclk -repeat 100 0 0, 1 50
force reset 0
force trdy 1
add wave bclk reset trdy
add wave arb_start arb_success our_snoop dxu_done
add wave memory(0).ioq_status
run 350
-- deassert reset
force reset 1
run 100
-- start an ADS arb sequence on bus
force arb_start 1
run 100
force arb_start 0
run 100
-- got bus, now get request out
-- and see snoop activity
force arb_success 1
run 100
force arb_success 0
run 200
force our_snoop 1
run 100
force our_snoop 0
-- getting response from chipset
force trdy 0
run 100
force trdy 1
run 100
-- now data appears on bus
run 100
171 stinky.ece.pdx.edu>
Download