Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- readcommands : process(DIHSTRB,DIDIR,DIRSTB,Cover_s,IO_READ,cmd) --read the COMMANDS from GC
- variable i : integer range 0 to 15:=0;
- variable latch : std_logic:='0';
- begin
- if(DIRSTB='0')then
- cmd(0)<=X"00";
- i:=0;
- elsif(DIHSTRB'Event and DIHSTRB='1')then
- if(DIDIR='0')then
- cmd(i)<=DID;
- if(i<12)then
- i:=i+1;
- end if;
- else
- i:=0;
- end if;
- end if;
- if(DIRSTB='0') then
- LBA_offset<=(others=>'0');
- latch:='0';
- elsif(cmd(0)&cmd(1)&cmd(2)&cmd(3)=X"AABBCCDD")then
- if(DIDIR='1' and latch='0') then
- LBA_offset<=cmd(8)&cmd(9)&cmd(10)&cmd(11);
- latch:='1';
- end if;
- end if;
- if(DIDIR='1') then
- if(Cover_s='0')then
- DIERRB<='1';
- else
- if(cmd(0)=X"E0")then
- DIERRB<='1';
- else
- DIERRB<='0';
- end if;
- end if;
- else
- DIERRB<='1';
- end if;
- if (DIDIR='0' and i<10) then
- DIDSTRB<='0';
- else
- DIDSTRB<=IO_READ;
- end if;
- end process readcommands;
Advertisement
Add Comment
Please, Sign In to add comment