From d341fe2f64356e4777c2775ec539fd0d701dc965 Mon Sep 17 00:00:00 2001 From: Alexander Oh Date: Wed, 26 May 2010 02:41:54 +0200 Subject: [PATCH] moved constants to generic package --- src/gen_pkg.vhd | 2 ++ src/pc_communication.test | 4 ++++ src/pc_communication.vhd | 15 +++++++-------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/gen_pkg.vhd b/src/gen_pkg.vhd index 11a40b1..44b1596 100644 --- a/src/gen_pkg.vhd +++ b/src/gen_pkg.vhd @@ -19,6 +19,8 @@ package gen_pkg is subtype cinteger is integer; -- 50 zeilen * 71 zeichen * 2 (berechnung + ergebnis) = 7100 bytes + constant hspalte_max : integer := 71; + constant hzeile_max : integer := 50; constant H_RAM_SIZE : integer := 7100; constant H_RAM_WIDTH : integer := log2c(H_RAM_SIZE); subtype hspalte is std_logic_vector(6 downto 0); diff --git a/src/pc_communication.test b/src/pc_communication.test index 201998d..bf285fa 100644 --- a/src/pc_communication.test +++ b/src/pc_communication.test @@ -98,3 +98,7 @@ abcdefghijklmnopqrstuvxyzabcdefghijklmnopqrstuvxyzabcdefghijklmnopqrstu ABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTU abcdefghijklmnopqrstuvxyzabcdefghijklmnopqrstuvxyzabcdefghijklmnopqrstu ABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTU +abcdefghijklmnopqrstuvxyzabcdefghijklmnopqrstuvxyzabcdefghijklmnopqrstu +ABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTU +abcdefghijklmnopqrstuvxyzabcdefghijklmnopqrstuvxyzabcdefghijklmnopqrstu +ABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTU diff --git a/src/pc_communication.vhd b/src/pc_communication.vhd index 4e2cc41..dea269b 100644 --- a/src/pc_communication.vhd +++ b/src/pc_communication.vhd @@ -17,7 +17,7 @@ entity pc_communication is tx_done : in std_logic; --uart_rx - rx_data : in std_logic_vector(7 downto 0); --not really required + rx_data : in std_logic_vector(7 downto 0); rx_new : in std_logic; -- History @@ -32,8 +32,8 @@ end entity pc_communication; architecture beh of pc_communication is signal push_history, push_history_next : std_logic; - signal spalte, spalte_next : integer range 1 to 73; - signal zeile , zeile_next : integer range 1 to 73; + signal spalte, spalte_next : integer range 1 to hspalte_max + 1; + signal zeile , zeile_next : integer range 1 to hzeile_max + 1; signal spalte_up, spalte_up_next : std_logic; signal get, get_next : std_logic; signal new_i, new_i_next : std_logic; @@ -111,13 +111,12 @@ begin spalte_next <= spalte; zeile_next <= zeile; - if (spalte_up = '1') then - if (spalte > 72) then - if zeile + 1 > 50 then + if spalte_up = '1' then + if spalte = hspalte_max then + if zeile = hzeile_max then spalte_next <= 1; zeile_next <= 1; - s_done_next <= '1'; --lets assume this false - --assert false severity failure; + s_done_next <= '1'; else spalte_next <= 1; zeile_next <= zeile + 1; -- 2.25.1