top-level: weiteres portmapping fuer minimalsetup
[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                 -- TODO: tmp only!
29                 do_it : in std_logic;
30                 finished : out std_logic
31         );
32 end entity history;
33
34 architecture beh of history is
35         type HISTORY_STATE is (SIDLE);
36         signal state_int, state_next : HISTORY_STATE;
37         signal s_done_int, s_done_next : std_logic;
38         signal d_new_eingabe_int, d_new_eingabe_next : std_logic;
39         signal d_new_result_int, d_new_result_next : std_logic;
40         signal d_done_int, d_done_next : std_logic;
41         signal d_char_int, d_char_next : hbyte;
42
43         signal finished_int, finished_next : std_logic;
44 begin
45         s_done <= s_done_int;
46         d_new_eingabe <= d_new_eingabe_int;
47         d_new_result <= d_new_result_int;
48         d_done <= d_done_int;
49         d_char <= d_char_int;
50
51         finished <= finished_int;
52
53         process(sys_clk, sys_res_n)
54         begin
55                 if sys_res_n = '0' then
56                         -- internal
57                         state_int <= SIDLE;
58                         -- out
59                         s_done_int <= '0';
60                         d_new_result_int <= '0';
61                         d_new_eingabe_int <= '0';
62                         d_done_int <= '0';
63                         d_char_int <= (others => '0');
64
65                         finished_int <= '0';
66                 elsif rising_edge(sys_clk) then
67                         -- internal
68                         state_int <= state_next;
69                         -- out
70                         s_done_int <= s_done_next;
71                         d_new_result_int <= d_new_result_next;
72                         d_new_eingabe_int <= d_new_eingabe_next;
73                         d_done_int <= d_done_next;
74                         d_char_int <= d_char_next;
75
76                         finished_int <= finished_next;
77                 end if;
78         end process;
79
80         -- next state
81         process(state_int)
82         begin
83                 state_next <= state_int;
84
85                 case state_int is
86                         when SIDLE =>
87                                 null;
88                 end case;
89         end process;
90
91         -- out
92         process(state_int)
93         begin
94                 case state_int is
95                         when SIDLE =>
96                                 null;
97                 end case;
98         end process;
99 end architecture beh;