top-level: ansatz fuer minimales setup inkl. geruest fuer history- und displaymodul...
[hwmod.git] / src / history.vhd
1 library ieee;
2 use ieee.std_logic_1164.all;
3 use ieee.numeric_std.all;
4 use work.gen_pkg.all;
5
6 entity history is
7         port (
8                 sys_clk : in std_logic;
9                 sys_res_n : in std_logic;
10                 -- PC-komm
11                 -- TODO: pins
12                 -- Scanner
13                 s_char : in hbyte;
14                 s_take : in std_logic;
15                 s_done : out std_logic;
16                 s_backspace : in std_logic;
17                 -- Display
18                 d_new_eingabe : out std_logic;
19                 d_new_result : out std_logic;
20                 d_zeile : in hzeile;
21                 d_spalte : in hspalte;
22                 d_get : in std_logic;
23                 d_done : out std_logic;
24                 d_char : out hbyte
25                 -- Parser
26                 -- TODO: pins
27         );
28 end entity history;
29
30 architecture beh of history is
31         type HISTORY_STATE is (SIDLE);
32         signal state_int, state_next : HISTORY_STATE;
33         signal s_done_int, s_done_next : std_logic;
34         signal d_new_eingabe_int, d_new_eingabe_next : std_logic;
35         signal d_new_result_int, d_new_result_next : std_logic;
36         signal d_done_int, d_done_next : std_logic;
37         signal d_char_int, d_char_next : hbyte;
38 begin
39         s_done <= s_done_int;
40         d_new_eingabe <= d_new_eingabe_int;
41         d_new_result <= d_new_result_int;
42         d_done <= d_done_int;
43         d_char <= d_char_int;
44
45         process(sys_clk, sys_res_n)
46         begin
47                 if sys_res_n = '0' then
48                         -- internal
49                         state_int <= SIDLE;
50                         -- out
51                         s_done_int <= '0';
52                         d_new_result_int <= '0';
53                         d_new_eingabe_int <= '0';
54                         d_done_int <= '0';
55                         d_char_int <= (others => '0');
56                 elsif rising_edge(sys_clk) then
57                         -- internal
58                         state_int <= state_next;
59                         -- out
60                         s_done_int <= s_done_next;
61                         d_new_result_int <= d_new_result_next;
62                         d_new_eingabe_int <= d_new_eingabe_next;
63                         d_done_int <= d_done_next;
64                         d_char_int <= d_char_next;
65                 end if;
66         end process;
67
68         -- next state
69         process(state_int)
70         begin
71                 state_next <= state_int;
72
73                 case state_int is
74                         when SIDLE =>
75                                 null;
76                 end case;
77         end process;
78
79         -- out
80         process(state_int)
81         begin
82                 case state_int is
83                         when SIDLE =>
84                                 null;
85                 end case;
86         end process;
87 end architecture beh;