Sprungnavigation:

zum Inhalt

FPGA mit VHDL

Instanziierung des 8-Bit Registers

process (CLK, RST)
begin
   if (RST='1') then
      Q <= (others => '0');
   elsif (CLK'event and CLK='1') then -- CLK rising edge
      Q <= D;
   end if;
end process;

Der komplette VHDL-Quelltext der Logikschaltung kann auch downgeloaded werden.

Instanziierung der Testbench

Die Stimulation für Clock und Reset:

RESET_PROC : PROCESS
BEGIN
   RST <= '1';
   wait for 2*clk_period;
   RST <= '0';
   wait for 10*clk_period;
END PROCESS;

CLOCK_PROC : PROCESS
BEGIN
   CLK <= '0';
   wait for clk_period/2;
   CLK <= '1';
   wait for clk_period/2;
END PROCESS;

Und die Stimulation für den Dateneingang:

STIMULI_PROC : PROCESS
BEGIN
-- Init
D <= x"00";
wait until RST = '0';
-- durchtesten aller Eingangszustaende
D <= x"AA";
wait for clk_period;
D <= x"55";
wait for clk_period;
D <= x"01";
wait for clk_period;
D <= x"23";
wait for clk_period;
D <= x"45";
wait for clk_period;
D <= x"67";
wait for clk_period;
D <= x"89";
wait for clk_period;
D <= x"AB";
wait for clk_period;
D <= x"CD";
wait for clk_period;
D <= x"EF";
wait;
END PROCESS;

Der komplette VHDL-Quelltext der Testbench für die Logikschaltung kann auch downgeloaded werden.

im 3. Teil Simulation weiterlesen.

Alle Informationen und Dateien zu diesem Beispiel

 
Qualitätsmanagement-Stempel von YASKO
Qualitätsmanagement nach
DIN EN ISO 9001:2015
Logo des FED
Mitglied im Fachverband für
Elektronik-Design e.V. (FED)