Guest User

GC Readcommands (Destop)

a guest
Jul 1st, 2012
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.92 KB | None | 0 0
  1. readcommands : process(DIHSTRB,DIDIR,DIRSTB,Cover_s,IO_READ,cmd)     --read the COMMANDS from GC
  2. variable i : integer range 0 to 15:=0;
  3. variable latch : std_logic:='0';
  4. begin
  5.  
  6.  
  7.     if(DIRSTB='0')then
  8.         cmd(0)<=X"00";
  9.         i:=0;
  10.     elsif(DIHSTRB'Event and DIHSTRB='1')then
  11.         if(DIDIR='0')then
  12.             cmd(i)<=DID;
  13.             if(i<12)then
  14.                 i:=i+1;
  15.             end if;
  16.         else
  17.             i:=0;
  18.         end if;
  19.     end if;
  20.  
  21.     if(DIRSTB='0') then
  22.         LBA_offset<=(others=>'0');
  23.         latch:='0';
  24.     elsif(cmd(0)&cmd(1)&cmd(2)&cmd(3)=X"AABBCCDD")then
  25.         if(DIDIR='1' and latch='0') then
  26.         LBA_offset<=cmd(8)&cmd(9)&cmd(10)&cmd(11);
  27.         latch:='1';
  28.         end if;
  29.     end if;
  30.  
  31.     if(DIDIR='1') then
  32.         if(Cover_s='0')then
  33.         DIERRB<='1';
  34.         else
  35.             if(cmd(0)=X"E0")then
  36.                 DIERRB<='1';
  37.             else
  38.                 DIERRB<='0';
  39.             end if;
  40.         end if;
  41.     else
  42.             DIERRB<='1';
  43.     end if;
  44.  
  45.  
  46.     if (DIDIR='0' and i<10) then
  47.         DIDSTRB<='0';
  48.     else
  49.         DIDSTRB<=IO_READ;
  50.     end if;
  51.  
  52.  
  53. end process readcommands;
Advertisement
Add Comment
Please, Sign In to add comment