moved constants to generic package
authorAlexander Oh <oh.a@gmx.at>
Wed, 26 May 2010 00:41:54 +0000 (02:41 +0200)
committerAlexander Oh <oh.a@gmx.at>
Wed, 26 May 2010 01:35:01 +0000 (03:35 +0200)
src/gen_pkg.vhd
src/pc_communication.test
src/pc_communication.vhd

index 11a40b1339e1dd543712af78f2486a0eb3ce8b18..44b1596a5140c12a7d149ac42b18af5451dc4f4f 100644 (file)
@@ -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);
index 201998d322f2ff7dc1aa6c04545b893bde24ba40..bf285fa5936225e49fde751d59f695ec9a0b680a 100644 (file)
@@ -98,3 +98,7 @@ abcdefghijklmnopqrstuvxyzabcdefghijklmnopqrstuvxyzabcdefghijklmnopqrstu
 ABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTU
 abcdefghijklmnopqrstuvxyzabcdefghijklmnopqrstuvxyzabcdefghijklmnopqrstu
 ABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTU
+abcdefghijklmnopqrstuvxyzabcdefghijklmnopqrstuvxyzabcdefghijklmnopqrstu
+ABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTU
+abcdefghijklmnopqrstuvxyzabcdefghijklmnopqrstuvxyzabcdefghijklmnopqrstu
+ABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTU
index 4e2cc41a0de87b4291976f85c8b4da5b91d24d6f..dea269b6d13b4c8cd4f3b3205b86ea4839ef8f97 100644 (file)
@@ -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;