2 use ieee.std_logic_1164.all;
3 use ieee.numeric_std.all;
9 sys_clk : in std_logic;
10 sys_res_n : in std_logic;
13 p_spalte : out hspalte;
14 p_rget : out std_logic;
15 p_rdone : in std_logic;
17 p_wtake : out std_logic;
18 p_wdone : in std_logic;
20 p_finished : out std_logic;
26 do_calc : out std_logic;
27 calc_done : in std_logic;
28 -- TODO: calc_error : in std_logic;
31 finished : out std_logic
35 architecture beh of parser is
36 type PARSER_STATE is (SIDLE, SREAD_CHAR1, SREAD_CHAR2, SWRITE_CHAR);
37 signal state_int, state_next : PARSER_STATE;
38 signal z_int, z_next : csigned;
39 signal rbyte_int, rbyte_next : hbyte;
40 signal p_write_int, p_write_next : hbyte;
41 signal p_rget_int, p_rget_next : std_logic;
42 signal p_wtake_int, p_wtake_next : std_logic;
43 signal p_finished_int, p_finished_next : std_logic;
45 p_write <= p_write_int;
47 p_wtake <= p_wtake_int;
48 p_finished <= p_finished_int;
50 process(sys_clk, sys_res_n)
52 if sys_res_n = '0' then
54 z_int <= (others => '0');
55 rbyte_int <= (others => '0');
58 p_spalte <= (others => '0');
60 p_write_int <= (others => '0');
62 p_finished_int <= '0';
64 op1 <= (others => '0');
65 op2 <= (others => '0');
68 elsif rising_edge(sys_clk) then
70 state_int <= state_next;
72 rbyte_int <= rbyte_next;
74 p_rget_int <= p_rget_next;
75 p_write_int <= p_write_next;
76 p_wtake_int <= p_wtake_next;
77 p_finished_int <= p_finished_next;
82 process(state_int, do_it, p_rdone, p_wdone, p_read)
84 state_next <= state_int;
89 state_next <= SREAD_CHAR1;
93 state_next <= SREAD_CHAR2;
97 state_next <= SWRITE_CHAR;
100 if rbyte_int = hbyte(to_unsigned(character'pos(character'val(0)), 8)) then
105 state_next <= SREAD_CHAR1;
110 process(state_int, p_read, p_write_int, z_int, rbyte_int, p_rget_int)
114 rbyte_next <= rbyte_int;
117 p_write_next <= p_write_int;
119 p_finished_next <= '0';
123 z_next <= (others => '0');
124 rbyte_next <= (others => '0');
125 p_write_next <= (others => '0');
128 p_write_next <= (others => '0');
130 rbyte_next <= p_read;
132 p_write_next <= p_read;
134 if rbyte_int = hbyte(to_unsigned(character'pos(character'val(0)), 8)) then
135 p_finished_next <= '1';
139 end architecture beh;