Hoffentlich hat sich jemand hier schon mal mit VHDL auseinandergesetzt, ansonsten bin ich aufgeschmissen. 
Im folgenden Code bleibt das Signal running undefined, obwohl der Simulator am Breakpoint auf der Zuweisung hält. Also es kommt der clock, mit steigender Flanke und start ist 1.
Testbench:
btw, ich muss mich mal wirklich beschweren: Warum haben wir keine VHDL-Tags! Frechheit
mfg benediktibk
Edit: Zum besseren Verständnis habe zwei Screenshots angehängt

Im folgenden Code bleibt das Signal running undefined, obwohl der Simulator am Breakpoint auf der Zuweisung hält. Also es kommt der clock, mit steigender Flanke und start ist 1.
Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity control is
Port ( clock : in STD_LOGIC;
start : in STD_LOGIC;
round : out STD_LOGIC_VECTOR (3 downto 0);
ready : out STD_LOGIC := '1';
enable : out STD_LOGIC;
s : out STD_LOGIC);
end control;
architecture Behavioral of control is
signal running : STD_LOGIC;
signal roundInternal : STD_LOGIC_VECTOR(3 downto 0);
begin
startProcess : process(clock)
begin
if clock = '1' and clock'Event
and start = '1' then
running <= '1';
roundInternal <= "0000";
s <= '0';
enable <= '1';
end if;
end process startProcess;
nextRound : process(clock)
begin
if running = '1' and clock'Event and clock = '1' then
roundInternal <= STD_LOGIC_VECTOR(unsigned(roundInternal) + 1);
s <= '1';
end if;
end process nextRound;
finishProcess : process(roundInternal)
begin
if roundInternal = "0111" then
roundInternal <= "1000";
running <= '0';
s <= 'U';
enable <= '0';
end if;
end process finishProcess;
round <= roundInternal;
ready <= not running;
end Behavioral;
Testbench:
Code:
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY tb_control IS
END tb_control;
ARCHITECTURE behavior OF tb_control IS
-- Component Declaration for the Unit Under Test (UUT)
COMPONENT control
PORT(
clock : IN std_logic;
start : IN std_logic;
round : OUT std_logic_vector(3 downto 0);
ready : OUT std_logic;
enable : OUT std_logic;
s : OUT std_logic
);
END COMPONENT;
--Inputs
signal clock : std_logic := '0';
signal start : std_logic := '1';
--Outputs
signal round : std_logic_vector(3 downto 0);
signal ready : std_logic;
signal enable : std_logic;
signal s : std_logic;
-- Clock period definitions
constant clock_period : time := 4 ps;
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: control PORT MAP (
clock => clock,
start => start,
round => round,
ready => ready,
enable => enable,
s => s
);
-- Clock process definitions
clock_process :process
begin
clock <= '0';
wait for clock_period/2;
clock <= '1';
wait for clock_period/2;
end process;
-- start <= '0', '1' after 5 ps, '0' after 7 ps,
-- '1' after 43 ps, '0' after 45 ps,
-- '1' after 57 ps, '0' after 59 ps, '1' after 73 ps, '0' after 81 ps,
-- '1' after 93 ps;
END;
btw, ich muss mich mal wirklich beschweren: Warum haben wir keine VHDL-Tags! Frechheit

mfg benediktibk
Edit: Zum besseren Verständnis habe zwei Screenshots angehängt
Zuletzt bearbeitet: