projects
/
hwmod.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
scanner: beh- und post-tb angepasst
[hwmod.git]
/
src
/
beh_scanner_tb.vhd
diff --git
a/src/beh_scanner_tb.vhd
b/src/beh_scanner_tb.vhd
index e904d76024c941a461b090932b5742f68b5403ab..342b1c53752723fe197f1b8372d15ff07c2524d4 100644
(file)
--- a/
src/beh_scanner_tb.vhd
+++ b/
src/beh_scanner_tb.vhd
@@
-76,18
+76,15
@@
begin
return y;
end function;
return y;
end function;
- function valid_char (x : std_logic_vector(7 downto 0)
; last : std_logic_vector(7 downto 0)
) return boolean is
+ function valid_char (x : std_logic_vector(7 downto 0)) return boolean is
variable y : boolean;
begin
case x is
variable y : boolean;
begin
case x is
- -- nur gueltig wenn davor ein numpad-mod byte gekommen ist
- when SC_KP_DIV => y := last = x"e0";
-
- -- immer gueltig
when SC_KP_0 | SC_KP_1 | SC_KP_2 | SC_KP_3 |
SC_KP_4 | SC_KP_5 | SC_KP_6 | SC_KP_7 |
SC_KP_8 | SC_KP_9 | SC_KP_PLUS |
when SC_KP_0 | SC_KP_1 | SC_KP_2 | SC_KP_3 |
SC_KP_4 | SC_KP_5 | SC_KP_6 | SC_KP_7 |
SC_KP_8 | SC_KP_9 | SC_KP_PLUS |
- SC_KP_MINUS | SC_KP_MUL | SC_SPACE |
+ SC_KP_MINUS | SC_KP_MUL |
+ SC_KP_DIV | SC_SPACE |
SC_BKSP | SC_ENTER =>
y := true;
when others => y := false;
SC_BKSP | SC_ENTER =>
y := true;
when others => y := false;
@@
-107,7
+104,6
@@
begin
variable checkall : boolean := true;
variable run_tc, run_inner : boolean := true;
variable i, j, k, y : natural;
variable checkall : boolean := true;
variable run_tc, run_inner : boolean := true;
variable i, j, k, y : natural;
- variable last : std_logic_vector(7 downto 0);
begin
-- init & reset
sys_res_n <= '0';
begin
-- init & reset
sys_res_n <= '0';
@@
-127,7
+123,7
@@
begin
f1_loop : while not endfile(f) loop
readline (f, l);
input := (others => nul);
f1_loop : while not endfile(f) loop
readline (f, l);
input := (others => nul);
- if (l'length <= 7
1
) then
+ if (l'length <= 7
2
) then
input(1 to l'length) := l.all;
if (input(1) = '#') then
next f1_loop;
input(1 to l'length) := l.all;
if (input(1) = '#') then
next f1_loop;
@@
-143,7
+139,7
@@
begin
f2_loop : while not endfile(f) loop
readline (f, l);
expectedresult := (others => nul);
f2_loop : while not endfile(f) loop
readline (f, l);
expectedresult := (others => nul);
- if (l'length <= 7
1
) then
+ if (l'length <= 7
2
) then
expectedresult(1 to l'length) := l.all;
if (expectedresult(1) = '#') then
next f2_loop;
expectedresult(1 to l'length) := l.all;
if (expectedresult(1) = '#') then
next f2_loop;
@@
-168,7
+164,6
@@
begin
j := 0; k := 1;
mainl : while run_tc loop
j := 0; k := 1;
mainl : while run_tc loop
- last := data;
icwait(sys_clk, 1);
j := j + 1;
icwait(sys_clk, 1);
j := j + 1;
@@
-179,18
+174,24
@@
begin
end if;
new_data <= '1';
end if;
new_data <= '1';
+
case input(j) is
when nul => data <= ascii2sc(x"1c"); -- $ (enter)
when '!' => data <= ascii2sc(x"0e"); -- ! (backspace)
case input(j) is
when nul => data <= ascii2sc(x"1c"); -- $ (enter)
when '!' => data <= ascii2sc(x"0e"); -- ! (backspace)
- when '.' => data <= x"e0"; -- . (modifier fuer Numpad)
+ when '/' =>
+ data <= x"e0";
+ icwait(sys_clk, 1);
+ new_data <= '0';
+ icwait(sys_clk, 1);
+ new_data <= '1';
+ data <= SC_KP_DIV;
when others => data <= ascii2sc(std_logic_vector(to_unsigned(character'pos(input(j)),8)));
end case;
icwait(sys_clk, 1);
new_data <= '0';
when others => data <= ascii2sc(std_logic_vector(to_unsigned(character'pos(input(j)),8)));
end case;
icwait(sys_clk, 1);
new_data <= '0';
- -- ack'en skippen, falls es ein "spezielles" zeichen ist (steht
- -- in abhaengigkeit zum vorherigen zeichen)
- if(not valid_char(data, last)) then
+ -- ack'en skippen, falls es ein "spezielles" zeichen ist
+ if(not valid_char(data)) then
next mainl;
end if;
next mainl;
end if;