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

Subversion Repositories mytwoqcache

[/] [mytwoqcache/] [trunk/] [2QCache.vhd] - Diff between revs 18 and 20

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

Rev 18 Rev 20
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,
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 354... Line 354...
                getf <= '0';
                getf <= '0';
                putf <= '0'; -- NEW inserted
                putf <= '0'; -- NEW inserted
                doneh <= '0';
                doneh <= '0';
                accinterrupt <= '0';
                accinterrupt <= '0';
                accqueue <= '0';
                accqueue <= '0';
 
                isfull <= '0';
 
                flag <= '0';
                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 383... Line 385...
                         else
                         else
                           putf <= '1';
                           putf <= '1';
                         end if;
                         end if;
                  when ramstart =>
                  when ramstart =>
                    if enableram = '1' then -- UPDATE
                    if enableram = '1' then -- UPDATE
 
                           if isfull = '0' then
                           tagBuff <= tagRAMOut;
                           tagBuff <= tagRAMOut;
 
                           end if;
                                if found /= 15 then
                                if found /= 15 then
                                  cindex <= tagRAMOut( found).cacheAddr;
                                  cindex <= tagRAMOut( found).cacheAddr;
 
                                  isfull <= '0';
                                  stateram <= ramupdate;
                                  stateram <= ramupdate;
                                elsif free /= 15 then
                                elsif free /= 15 then
                                  en := '1';
                                  en := '1';
 
                                  if emptyf = '1' and isfull = '0' then
 
                                    isfull <= '1';
                                  stateram <= ramwait;
                                  stateram <= ramwait;
                                else
                                else
                                  cindex <= tagRAMOut( elim).cacheAddr;
 
                                  stateram <= ramupdate;
 
                                end if;
 
                         end if;
 
                  when ramupdate =>
 
                    stateram <= ramupdate1;
 
                  when ramupdate1 =>
 
                    cacheIn <= cacheOut;
 
                         blockOut <= cacheOut.Words;
 
                         RecBuff <= cacheOut;
 
                         en := '1';
 
                         stateram <= ramwait;
 
                  when ramwait =>
 
                         doneh <= '0';
 
 
 
                    if hi = '1' then
 
                                stateram <= ramwait1;
 
                         elsif acc = '1' then
 
                           if found /= 15 then
 
                                  cindex <= tagBuff( found).cacheAddr;
 
                                  cacheIn <= RecBuff;
 
                                  blockOut <= RecBuff.Words;
 
                                  stateram <= ramupdate2;
 
                                elsif free /= 15 then
 
                                  cindex <= FreeOut;
                                  cindex <= FreeOut;
                                  tagBuff( free).cacheAddr <= FreeOut;
                                  tagBuff( free).cacheAddr <= FreeOut;
                                  tagBuff( free).cacheValid <= '1';
                                  tagBuff( free).cacheValid <= '1';
                                  tagBuff( free).tag <= AddressInh( tagBuff( free).tag'range);
                                  tagBuff( free).tag <= AddressInh( tagBuff( free).tag'range);
                                  tagBuff( free).tagValid <= '1';
                                  tagBuff( free).tagValid <= '1';
 
                                    isfull <= '0';
                                  getf <= '1';
                                  getf <= '1';
                                  if IOCodeh = "111" and ldCachedWords = 0 then
                                  if IOCodeh = "111" and ldCachedWords = 0 then
                                    stateram <= ramupdate2;
                                    stateram <= ramupdate2;
                                  else
                                  else
                                    readb <= '1';
                                    readb <= '1';
                               AddressOut <= AddressInh( AddressOut'range);
                               AddressOut <= AddressInh( AddressOut'range);
                                    stateram <= ramread;
                                    stateram <= ramread;
                                  end if;
                                  end if;
 
                                  end if;
 
                                else
 
                                  cindex <= tagRAMOut( elim).cacheAddr;
 
                                  isfull <= '0';
 
                                  stateram <= ramupdate;
 
                                end if;
 
                         end if;
 
                  when ramupdate =>
 
                    stateram <= ramupdate1;
 
                  when ramupdate1 =>
 
                     cacheIn <= cacheOut;
 
                         blockOut <= cacheOut.Words;
 
                         RecBuff <= cacheOut;
 
                         en := '1';
 
                         if found /= 15 then
 
                           stateram <= ramupdate2;
                                else
                                else
                                  cindex <= tagBuff( elim).cacheAddr;
 
                                  cacheIn <= RecBuff;
 
                                  blockOut <= RecBuff.Words;
 
                                  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';
                                  stateram <= ramflush;
                                  stateram <= ramflush;
                                end if;
                                end if;
 
                  when ramwait =>
 
                    if hi = '1' then
 
                          stateram <= ramwait1;
                         end if;
                         end if;
                  when ramwait1 =>
                  when ramwait1 =>
 
                         writec <= '0';
 
 
                         if del /= 15 and enableram = '1' then
                         if del /= 15 and enableram = '1' then
                           if toflush = AddressInh( toflush'range) then -- inserted, tagline could match flushing tagline !!!!
                           if toflush = AddressInh( toflush'range) then -- inserted, tagline could match flushing tagline !!!!
                        tagBuff( del).tagvalid <= '0';
                        tagBuff( del).tagvalid <= '0';
                             tagBuff( del).cacheValid <= '0';
                             tagBuff( del).cacheValid <= '0';
                             tagBuff( del).tag <= ( others => '0');
                             tagBuff( del).tag <= ( others => '0');
Line 502... Line 505...
                         cacheIn.FiFoAddr <= newFiFoAddr;
                         cacheIn.FiFoAddr <= newFiFoAddr;
                         cacheIn.Am <= newAm;
                         cacheIn.Am <= newAm;
 
 
                         getf <= '0';
                         getf <= '0';
                         writec <= '1';
                         writec <= '1';
                         doneh <= '1';
 
 
 
 
                         if hi = '1' then
 
                           stateram <= ramwait1;
 
                         elsif acc = '1' then
 
                           doneh <= '1';
                         stateram <= ramupdate3;
                         stateram <= ramupdate3;
 
                         end if;
                  when ramupdate3 =>
                  when ramupdate3 =>
                    hi := '0';
                    hi := '0';
                         acc := '0';
                         acc := '0';
                         en := '0';
                         en := '0';
                         writec <= '0';
                         writec <= '0';
Line 532... Line 539...
                         end loop;
                         end loop;
 
 
                         stateram <= ramflush1;
                         stateram <= ramflush1;
                  when ramflush1 =>
                  when ramflush1 =>
                         if writesh = '0' then
                         if writesh = '0' then
                           if del /= 15 and hi = '1' then
                           if flag = '1' then
                                  hi := '0';
 
                             stateram <= ramwait;
 
                                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';
 
                                 flag <= '0';
                                  if IOCodeh = "111" and ldCachedWords = 0 then
                                  if IOCodeh = "111" and ldCachedWords = 0 then
                                    stateram <= ramupdate2;
                                    stateram <= ramupdate2;
                                  else
                                  else
                                    readb <= '1';
                                    readb <= '1';
                                    AddressOut <= AddressInh( AddressOut'range);
                                    AddressOut <= AddressInh( AddressOut'range);
                                    stateram <= ramread;
                                    stateram <= ramread;
                                  end if;
                                  end if;
 
                           elsif isfull = '1' then
 
                             hi := '0';
 
                                 stateram <= ramstart;
 
                           elsif acc = '1' then
 
                                 doneh <= '1';
 
                             stateram <= ramupdate3;
                                end if;
                                end if;
                         end if;
                         end if;
                end case;
                end case;
 
 
                accinterrupt <= hi;
                accinterrupt <= hi;
Line 674... Line 685...
                                         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' and serviced = '0') then
                                  if fullA1 = '1' or (isfull = '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';
                              serviced <= '1';
                                           statequeue <= queuewait;
                                           statequeue <= queuewait;
                                         end if;
                                         end if;
                                  elsif fullAm = '1' and emptyf = '1' and serviced = '0' then
                                  elsif emptyAm = '0' and isfull = '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';

powered by: WebSVN 2.1.0

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