Line 135... |
Line 135... |
signal found, free, elim, del: myint;
|
signal found, free, elim, del: myint;
|
signal stateIO: IOType;
|
signal stateIO: IOType;
|
signal statetag: tType;
|
signal statetag: tType;
|
signal stateram: rType;
|
signal stateram: rType;
|
signal statequeue: fType;
|
signal statequeue: fType;
|
signal enableram, enablequeue, queuedone, readsh, writesh, doneh, preempted, isfull, flag, flag1,
|
signal enableram, enablequeue, queuedone, readsh, writesh, doneh, preempted, isfull, flag,
|
interrupt, readb, writeb, writec, writet, accdone, accqueue, accinterrupt, serviced, oldint: std_ulogic;
|
interrupt, readb, writeb, writec, writet, accdone, accqueue, accinterrupt, serviced, oldint: std_ulogic;
|
signal gal: std_ulogic_vector( 7 downto 0);
|
signal gal: std_ulogic_vector( 7 downto 0);
|
|
|
begin
|
begin
|
|
|
Line 356... |
Line 356... |
doneh <= '0';
|
doneh <= '0';
|
accinterrupt <= '0';
|
accinterrupt <= '0';
|
accqueue <= '0';
|
accqueue <= '0';
|
isfull <= '0';
|
isfull <= '0';
|
flag <= '0';
|
flag <= '0';
|
flag1 <= '1';
|
|
initcount1 <= ( others => '0');
|
initcount1 <= ( others => '0');
|
FreeIn <= ( others => '0');
|
FreeIn <= ( others => '0');
|
firstf <= ( others => '0');
|
firstf <= ( others => '0');
|
lastf <= ( others => '0');
|
lastf <= ( others => '0');
|
counterf <= ( others => '0');
|
counterf <= ( others => '0');
|
Line 399... |
Line 398... |
isfull <= '1';
|
isfull <= '1';
|
tagBuff <= tagRAMOut;
|
tagBuff <= tagRAMOut;
|
stateram <= ramwait;
|
stateram <= ramwait;
|
else
|
else
|
cindex <= FreeOut;
|
cindex <= FreeOut;
|
if isfull = '1' then
|
tagBuff <= tagRAMOut;
|
tagBuff( free).cacheAddr <= FreeOut;
|
stateram <= ramupdate1;
|
tagBuff( free).cacheValid <= '1';
|
|
tagBuff( free).tag <= AddressInh( tagBuff( free).tag'range);
|
|
tagBuff( free).tagValid <= '1';
|
|
else
|
|
tagRAMOut( free).cacheAddr <= FreeOut;
|
|
tagRAMOut( free).cacheValid <= '1';
|
|
tagRAMOut( free).tag <= AddressInh( tagRAMOut( free).tag'range);
|
|
tagRAMOut( free).tagValid <= '1';
|
|
flag1 <= '1';
|
|
end if;
|
|
isfull <= '0';
|
|
getf <= '1';
|
|
if IOCodeh = "111" and ldCachedWords = 0 then
|
|
stateram <= ramupdate2;
|
|
else
|
|
readb <= '1';
|
|
AddressOut <= AddressInh( AddressOut'range);
|
|
stateram <= ramread;
|
|
end if;
|
|
end if;
|
end if;
|
else
|
else
|
tagBuff <= tagRAMOut;
|
tagBuff <= tagRAMOut;
|
cindex <= tagRAMOut( elim).cacheAddr;
|
cindex <= tagRAMOut( elim).cacheAddr;
|
isfull <= '0';
|
isfull <= '0';
|
Line 437... |
Line 417... |
blockOut <= cacheOut.Words;
|
blockOut <= cacheOut.Words;
|
RecBuff <= cacheOut;
|
RecBuff <= cacheOut;
|
en := '1';
|
en := '1';
|
if found /= 15 then
|
if found /= 15 then
|
stateram <= ramupdate2;
|
stateram <= ramupdate2;
|
|
elsif free /= 15 then
|
|
tagBuff( free).cacheAddr <= FreeOut;
|
|
tagBuff( free).cacheValid <= '1';
|
|
tagBuff( free).tag <= AddressInh( tagBuff( free).tag'range);
|
|
tagBuff( free).tagValid <= '1';
|
|
getf <= '1';
|
|
if IOCodeh = "111" and ldCachedWords = 0 then
|
|
stateram <= ramupdate2;
|
|
else
|
|
readb <= '1';
|
|
AddressOut <= AddressInh( AddressOut'range);
|
|
stateram <= ramread;
|
|
end if;
|
else
|
else
|
AddressOut <= tagBuff( elim).tag & AddressInh( AddressInt'range) & ( ldCachedWords + 1 downto 0 => '0');
|
AddressOut <= tagBuff( elim).tag & AddressInh( AddressInt'range) & ( ldCachedWords + 1 downto 0 => '0');
|
writeb <= '1';
|
writeb <= '1';
|
flag <= '1';
|
flag <= '1';
|
stateram <= ramflush;
|
stateram <= ramflush;
|
Line 465... |
Line 458... |
stateram <= ramclean;
|
stateram <= ramclean;
|
end if;
|
end if;
|
when ramread =>
|
when ramread =>
|
readb <= '0';
|
readb <= '0';
|
getf <= '0';
|
getf <= '0';
|
if flag1 = '1' then
|
|
tagBuff <= tagRAMOut;
|
|
flag1 <= '0';
|
|
end if;
|
|
stateram <= ramread1;
|
stateram <= ramread1;
|
when ramread1 =>
|
when ramread1 =>
|
if readsh = '0' then
|
if readsh = '0' then
|
for i in blockIn'range loop
|
for i in blockIn'range loop
|
cacheIn.Words( i) <= blockIn( i);
|
cacheIn.Words( i) <= blockIn( i);
|
end loop;
|
end loop;
|
stateram <= ramupdate2;
|
stateram <= ramupdate2;
|
end if;
|
end if;
|
when ramupdate2 =>
|
when ramupdate2 =>
|
if flag1 = '1' then
|
|
tagBuff <= tagRAMOut;
|
|
flag1 <= '0';
|
|
end if;
|
|
if IOCodeh(2) = '1' then
|
if IOCodeh(2) = '1' then
|
if IOCodeh(1) = '1' then
|
if IOCodeh(1) = '1' then
|
If IOCodeh(0) = '1' then
|
If IOCodeh(0) = '1' then
|
cacheIn.Words( index).Word <= DataInh;
|
cacheIn.Words( index).Word <= DataInh;
|
cacheIn.Words( index).Modified <= "1111";
|
cacheIn.Words( index).Modified <= "1111";
|