DIPLOMARBEIT - FG Mikroelektronik, TU Berlin
DIPLOMARBEIT - FG Mikroelektronik, TU Berlin
DIPLOMARBEIT - FG Mikroelektronik, TU Berlin
Erfolgreiche ePaper selbst erstellen
Machen Sie aus Ihren PDF Publikationen ein blätterbares Flipbook mit unserer einzigartigen Google optimierten e-Paper Software.
Technische Universität <strong>Berlin</strong><br />
Institut für <strong>Mikroelektronik</strong><br />
Lukas Bauer<br />
S_HCNT<br />
entry<br />
A: HCOUNT :=0;<br />
HSYNC_out:=’0’;<br />
CSYNC_out:=’0’;<br />
VLINE :=0xFFFF;<br />
RELAREA :=’0’;<br />
HS_Enable:=’1’;<br />
HBLANK :=’0’;<br />
T1<br />
T4 #1<br />
T2 #2<br />
Diplomarbeit<br />
Hochleistungs-Grafikprozessor in Speedchart-VHDL<br />
C: HS_Wait=’1’ and HCOUNT=HTOTAL<br />
S1<br />
T3 #0<br />
C: HS_Coming=’1’<br />
A: HCOUNT:=SETHCNT;<br />
HSYNC_out:=’0’;<br />
HS_Enable:=’0’;<br />
CSYNC_out:=’0’;<br />
HBLANK :=’0’;<br />
A: -- HCOUNT, start HSYNC<br />
if HCOUNT=HTOTAL then<br />
HCOUNT:=0; -- reset counter<br />
HSYNC_out:=’0’; -- start sync<br />
HS_Enable:=’0’; -- ignore CSYNC_in<br />
else<br />
HCOUNT:=(HCOUNT+257) mod 65536<br />
when TEST=’1’ and HCOUNT mod 256/=255<br />
else (HCOUNT+1) mod 65536; -- count up<br />
end if;<br />
-- end HSYNC<br />
if HCOUNT=HESYNC then<br />
HSYNC_out:=’1’; -- end sync<br />
end if;<br />
-- start HBLANK<br />
if HCOUNT=HSBLNK then<br />
HBLANK:=’0’; -- start blank<br />
HS_Enable:=’1’; -- accept CSYNC_in<br />
-- initialize DPYNEXT and YZOOMCNT at start of field<br />
if (ILE=’0’ and VCOUNT=VEBLNK) -- noninter line 0<br />
or (ILE=’1’ and ODD=’0’ and VCOUNT=VEBLNK-1) then -- evenfield line 0<br />
VLINE:=0;<br />
RELAREA:=’1’;<br />
DPYNEXT:=DPYSTRT;<br />
RELOAD:=’1’;<br />
if ILE=’1’ then<br />
YZOOMCNT:=YZOOMST shr 1;<br />
else<br />
YZOOMCNT:=YZOOMST;<br />
end if;<br />
elsif ILE=’1’ and ODD=’1’ and VCOUNT=VEBLNK then -- oddfield line 1<br />
VLINE:=1;<br />
RELAREA:=’1’;<br />
if YZ="000" then<br />
DPYNEXT:=(DPYSTRT+DPYINC) mod 0x8000000;<br />
else<br />
DPYNEXT:=DPYSTRT;<br />
end if;<br />
RELOAD:=’1’;<br />
YZOOMCNT:=YZOOMST shr 1;<br />
-- end of field<br />
elsif VCOUNT=VSBLNK -- last line<br />
or (ILE=’1’ and ODD=’1’ and VCOUNT=VSBLNK+1) then -- last line ILE ODD<br />
VLINE:=0xFFFF;<br />
RELAREA:=’0’;<br />
-- in the field: increment DPYNEXT<br />
elsif RELAREA=’1’ then<br />
VLINE:=(VLINE+1) mod 65536 when ILE=’0’ -- next line noninter<br />
else (VLINE+2) mod 65536; -- next line interlaced<br />
RELOAD:=’1’;<br />
if YZOOMCNT=0 then<br />
if ILE=’1’ then<br />
YZOOMCNT:=YZOOMST shr 1;<br />
if YZ="000" then<br />
DPYNEXT:=(DPYNEXT+(DPYINC shl 1)) mod 0x8000000;-- line +2 ILE<br />
else<br />
DPYNEXT:=(DPYNEXT+DPYINC) mod 0x8000000; -- line +1 ILE zoom<br />
end if;<br />
else<br />
YZOOMCNT:=YZOOMST;<br />
DPYNEXT:=(DPYNEXT+DPYINC) mod 0x8000000; -- line +1 NI<br />
end if;<br />
else<br />
YZOOMCNT:=(YZOOMCNT+127) mod 128; -- repeat last line<br />
end if;<br />
end if;<br />
-- end HBLANK<br />
elsif HCOUNT=HEBLNK then<br />
RELOAD:=’0’;<br />
HBLANK:=’1’; -- end blank<br />
RELAT10:=’0’;<br />
RELAT6:=’0’;<br />
else<br />
RELOAD:=’0’;<br />
end if;<br />
-- reload attention<br />
if (ILE=’0’<br />
and (VCOUNT=VEBLNK<br />
or (RELAREA=’1’ and VCOUNT/=VSBLNK))) -- line preceding reload<br />
or (ILE=’1’<br />
and ((ODD=’0’ and VCOUNT=VEBLNK-1)<br />
or (ODD=’1’ and VCOUNT=VEBLNK)<br />
or (RELAREA=’1’ and VCOUNT/=VSBLNK and<br />
(ODD=’0’ or VCOUNT/=VSBLNK+1)))) then<br />
if HCOUNT=(HSBLNK+65526) mod 65536 then -- HSBLANK-10 reload att.<br />
RELAT10:=’1’;<br />
end if;<br />
if HCOUNT=(HSBLNK+65530) mod 65536 then -- HSBLANK-6 reload att.<br />
RELAT6:=’1’;<br />
end if;<br />
end if;<br />
-- start CSYNC<br />
if HCOUNT=HTOTAL -- start hs/eq/serr<br />
or (HCOUNT=HTOTAL shr 1 and ILE=’1’ -- midline eq/serr<br />
and ((IPhase(2)=’0’ and VCOUNT/=(VESYNC shr 1) + VTOTAL - VSBLNK)<br />
-- midline csync in eq1/serr/eq2 but not when starting posteq.<br />
or (IPhase="111" and ODD=’1’ and VCOUNT=VSBLNK))) then<br />
-- midline csync when starting eq1<br />
CSYNC_out:=’0’; --> start csync<br />
end if;<br />
-- end CSYNC<br />
if (IPhase(2 downto 1)="11" and HCOUNT=HESYNC) -- end hsync<br />
or (IPhase(2 downto 1)="01" -- end equalization<br />
and (HCOUNT=HESYNC shr 1<br />
or (ILE=’1’ and HCOUNT=((HTOTAL+1) shr 1) + (HESYNC shr 1))))<br />
or (IPhase(2 downto 1)="00" -- end serration<br />
and (HCOUNT=HESERR or HCOUNT=(HTOTAL+1) shr 1 + HESERR)) then<br />
CSYNC_out:=’1’; --> end csync<br />
end if;<br />
Abbildung 49: Speedchart-Diagramm VIDEO/SYNC/S HCNT<br />
Anhang C.2<br />
Seite 82