24.12.2012 Aufrufe

Schaltungsdesign mit VHDL

Schaltungsdesign mit VHDL

Schaltungsdesign mit VHDL

MEHR ANZEIGEN
WENIGER ANZEIGEN

Sie wollen auch ein ePaper? Erhöhen Sie die Reichweite Ihrer Titel.

YUMPU macht aus Druck-PDFs automatisch weboptimierte ePaper, die Google liebt.

B Die Sprache <strong>VHDL</strong><br />

ARCHITECTURE arch_1 OF tb_3pin IS<br />

SIGNAL a,b,c,r,y: bit;<br />

COMPONENT mut_socket<br />

PORT (a,b,c: IN bit; y: OUT bit);<br />

END COMPONENT;<br />

FILE stimres : text IS IN "stimres";<br />

FILE errors : text IS OUT "errors";<br />

BEGIN<br />

model_under_test: mut_socket PORT MAP (a,b,c,y);<br />

read_stimuli: PROCESS --------- Lese Stimuli ----------<br />

VARIABLE lin : line; VARIABLE boo: boolean;<br />

VARIABLE t : time;<br />

VARIABLE str_var,space: character; VARIABLE data: bit;<br />

BEGIN<br />

WHILE (endfile(stimres) = false) LOOP<br />

readline (stimres, lin);<br />

read (lin,str_var,boo);<br />

ASSERT boo REPORT "Error reading file!";<br />

IF ((str_var = 'a') OR (str_var = 'b')<br />

OR (str_var = 'c') OR (str_var = 'r')) THEN<br />

read (lin,space); read (lin,data);<br />

read (lin,space); read (lin,t);<br />

CASE str_var IS<br />

WHEN 'a' => a b c r NULL;<br />

END CASE;<br />

END IF;<br />

END LOOP;<br />

WAIT;<br />

END PROCESS;<br />

write_errors : PROCESS ----- Schreibe Fehlermeldung ------<br />

VARIABLE lin : line;<br />

BEGIN<br />

WAIT ON r'TRANSACTION;<br />

IF (y /= r) THEN<br />

write (lin, string'("y isn't ")); write (lin, r);<br />

write (lin, string'(" at time ")); write (lin, now);<br />

writeline (errors,lin);<br />

END IF;<br />

END PROCESS;<br />

END arch_1;<br />

220 © G. Lehmann/B. Wunder/M. Selz

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!