OpenCores
URL https://opencores.org/ocsvn/mytwoqcache/mytwoqcache/trunk

Subversion Repositories mytwoqcache

[/] [mytwoqcache/] [trunk/] [2QCache.vhd] - Diff between revs 12 and 13

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 12 Rev 13
Line 136... Line 136...
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,
signal enableram, enablequeue, queuedone, readsh, writesh, doneh, preempted,
       interrupt, readb, writeb, writec, writet, accdone, accqueue, accinterrupt: std_ulogic;
       interrupt, readb, writeb, writec, writet, accdone, accqueue, accinterrupt, serviced, oldint: std_ulogic;
 
 
begin
begin
 
 
 
 
 
 
Line 202... Line 202...
  if rising_edge(Clock) then
  if rising_edge(Clock) then
    if nReset /= '1' then
    if nReset /= '1' then
           statetag <= inittag;
           statetag <= inittag;
                writet <= '0';
                writet <= '0';
                enableram <= '0';
                enableram <= '0';
 
           oldint <= '0';
                found <= 15;
                found <= 15;
                free <= 15;
                free <= 15;
                done <= '0'; -- NEW
                done <= '0'; -- NEW
                initcount <= ( others => '0');
                initcount <= ( others => '0');
                AddressInt <= ( others => '0');
                AddressInt <= ( others => '0');
                IOCodeh <= ( others => '0');
                IOCodeh <= ( others => '0');
                AddressInh <= ( others => '0');
                AddressInh <= ( others => '0');
         else
         else
 
 
 
         oldint <= interrupt;
           case statetag is
           case statetag is
                  when inittag =>
                  when inittag =>
                    for i in tagRAMIn'range loop
                    for i in tagRAMIn'range loop
                           tagRAMIn(i).tagValid <= '0';
                           tagRAMIn(i).tagValid <= '0';
                           tagRAMIn(i).tag <= ( others => '0');
                           tagRAMIn(i).tag <= ( others => '0');
Line 262... Line 264...
                      statetag <= tagwait;
                      statetag <= tagwait;
                         end if;
                         end if;
                  when tagwait =>
                  when tagwait =>
                    writet <= '0';
                    writet <= '0';
 
 
                    if interrupt = '1' then
                    if interrupt = '1' and oldint = '0' then
                      enableram <= '0';
                      enableram <= '0';
                           AddressInt <= toFlush;
                           AddressInt <= toFlush;
                                statetag <= stateget;
                                statetag <= stateget;
                         elsif queuedone = '1' then
                         elsif queuedone = '1' then
                      enableram <= '0';
                      enableram <= '0';
Line 351... Line 353...
                FreeIn <= ( others => '0');
                FreeIn <= ( others => '0');
                firstf <= ( others => '0');
                firstf <= ( others => '0');
                lastf <= ( others => '0');
                lastf <= ( others => '0');
                counterf <= ( others => '0');
                counterf <= ( others => '0');
         else
         else
           hi := accinterrupt or interrupt;
           hi := accinterrupt or (interrupt and not oldint);
                acc := accqueue or queuedone;
                acc := accqueue or queuedone;
                en := enablequeue and ( hi nor acc);
                en := enablequeue and not acc;
 
 
                if ldCachedWords = 0 then
                if ldCachedWords = 0 then
                  index := 0;
                  index := 0;
                else
                else
                  index := to_integer( AddressInh( ldCachedWords + 1 downto 2));
                  index := to_integer( AddressInh( ldCachedWords + 1 downto 2));
Line 543... Line 545...
 
 
                         stateram <= ramflush1;
                         stateram <= ramflush1;
                  when ramflush1 =>
                  when ramflush1 =>
                         if writesh = '0' then
                         if writesh = '0' then
                           if del /= 15 and hi = '1' then
                           if del /= 15 and hi = '1' then
                                  doneh <= '1';
 
                                  en := '1';
 
                                  hi := '0';
                                  hi := '0';
                             stateram <= ramwait;
                             stateram <= ramwait;
                                else
                                else
                                  tagBuff( elim).tag <= AddressInh( tagBuff( elim).tag'range);
                                  tagBuff( elim).tag <= AddressInh( tagBuff( elim).tag'range);
                                  tagBuff( elim).tagValid <= '1';
                                  tagBuff( elim).tagValid <= '1';
Line 648... Line 648...
                getAm <= '0'; -- NEW
                getAm <= '0'; -- NEW
                removeA1 <= '0'; -- NEW
                removeA1 <= '0'; -- NEW
                removeAm <= '0'; -- NEW
                removeAm <= '0'; -- NEW
                putA1 <= '0'; -- NEW
                putA1 <= '0'; -- NEW
                putAm <= '0'; -- NEW
                putAm <= '0'; -- NEW
 
           serviced <= '0';
         else
         else
           hi := '0';
           hi := interrupt;
                acc := accdone or doneh;
                acc := accdone or doneh;
 
 
                diff := firstA1 - unsigned( RecBuff.FiFoAddr);
                diff := firstA1 - unsigned( RecBuff.FiFoAddr);
 
 
           case statequeue is
           case statequeue is
Line 685... Line 686...
                                         A1Inaddr <= RecBuff.FiFoAddr;
                                         A1Inaddr <= RecBuff.FiFoAddr;
                                         removeA1 <= '1';
                                         removeA1 <= '1';
                                         statequeue <= queuewaitAm1;
                                         statequeue <= queuewaitAm1;
                                  end if;
                                  end if;
                                elsif free /= 15 then
                                elsif free /= 15 then
                                  if fullA1 = '1' or (emptyf = '1' and emptyA1 = '0') then
                                  if fullA1 = '1' or (emptyf = '1' and emptyA1 = '0' and serviced = '0') then
                                    -- remove last entry from A1
                                    -- remove last entry from A1
                                         if A1Out.valid = '1' then
                                         if A1Out.valid = '1' then
                                           del <= to_integer( A1Out.way);
                                           del <= to_integer( A1Out.way);
                                           toFlush <= A1Out.word;
                                           toFlush <= A1Out.word;
                                           getA1 <= '1';
                                           getA1 <= '1';
                                           hi := '1';
                                           hi := '1';
 
                              serviced <= '1';
                                           statequeue <= queuewait;
                                           statequeue <= queuewait;
                                         end if;
                                         end if;
                                  elsif fullAm = '1' and emptyf = '1' then
                                  elsif fullAm = '1' and emptyf = '1' and serviced = '0' then
                                    -- remove last entry from Am
                                    -- remove last entry from Am
                                         if AmOut.valid = '1' then
                                         if AmOut.valid = '1' then
                                           del <= to_integer( AmOut.way);
                                           del <= to_integer( AmOut.way);
                                           toFlush <= AmOut.word;
                                           toFlush <= AmOut.word;
                                           getAm <= '1';
                                           getAm <= '1';
                                           hi := '1';
                                           hi := '1';
 
                              serviced <= '1';
                                           statequeue <= queuewait;
                                           statequeue <= queuewait;
                                         end if;
                                         end if;
                                  else
                                  else
                                    A1In.word <= AddressInh( 2 + ldCachedWords + blocksizeld - 1 downto 2 + ldCachedWords);
                                    A1In.word <= AddressInh( 2 + ldCachedWords + blocksizeld - 1 downto 2 + ldCachedWords);
                                         A1In.way <= std_ulogic_vector(to_unsigned( free, ldways + 1));
                                         A1In.way <= std_ulogic_vector(to_unsigned( free, ldways + 1));
                                         A1In.valid <= '1';
                                         A1In.valid <= '1';
                                         putA1 <= '1';
                                         putA1 <= '1';
 
                            serviced <= '0';
                                         statequeue <= queuewaitA11;
                                         statequeue <= queuewaitA11;
                                  end if;
                                  end if;
                                elsif elim /= 15 then
                                elsif elim /= 15 then
                                  if fullA1 = '1' then
                                  if fullA1 = '1' then
                                    if A1Out.valid = '1' then
                                    if A1Out.valid = '1' then
Line 740... Line 744...
                  when queuewait =>
                  when queuewait =>
                         removeA1 <= '0';
                         removeA1 <= '0';
                         removeAm <= '0';
                         removeAm <= '0';
                    getAm <= '0';
                    getAm <= '0';
                    getA1 <= '0';
                    getA1 <= '0';
                         queuedone <= '0';
 
 
 
               if acc = '1' then
             if hi = '1' then
 
                   hi := '0';
 
                           statequeue <= queuestart;
 
               elsif acc = '1' then
                           acc := '0';
                           acc := '0';
                                del <= 15;
                                del <= 15;
 
                           queuedone <= '0';
                           statequeue <= queuestart;
                           statequeue <= queuestart;
                         end if;
                         end if;
                  when queuewaitAm1 =>
                  when queuewaitAm1 =>
                    putAm <= '0';
                    putAm <= '0';
                         removeA1 <= '0';
                         removeA1 <= '0';

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.