copyleft: gplv3 added and set repo to public
[calu.git] / cpu / src / rs232_tx_arc.vhd
index ac431d874b3cefc2fa4affc37aba6d513b10b9cc..bdbf80d68599c42f084e0092dedb701f5c2cf571 100755 (executable)
@@ -1,21 +1,32 @@
----------------------------------------------------------------------------------
--- Filename : rs232_tx_arc.vhd
--- ========== 
--- 
--- Beschreibung : Versand von Daten ueber die RS232 Schnittstelle
--- ==============
+--   `Deep Thought', a softcore CPU implemented on a FPGA
 --
--- Autoren : Martin Perner, Schwarz Manfred
--- =========
-----------------------------------------------------------------------------------
+--  Copyright (C) 2010 Markus Hofstaetter <markus.manrow@gmx.at>
+--  Copyright (C) 2010 Martin Perner <e0725782@student.tuwien.ac.at>
+--  Copyright (C) 2010 Stefan Rebernig <stefan.rebernig@gmail.com>
+--  Copyright (C) 2010 Manfred Schwarz <e0725898@student.tuwien.ac.at>
+--  Copyright (C) 2010 Bernhard Urban <lewurm@gmail.com>
+--
+--  This program is free software: you can redistribute it and/or modify
+--  it under the terms of the GNU General Public License as published by
+--  the Free Software Foundation, either version 3 of the License, or
+--  (at your option) any later version.
+--
+--  This program is distributed in the hope that it will be useful,
+--  but WITHOUT ANY WARRANTY; without even the implied warranty of
+--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+--  GNU General Public License for more details.
+--
+--  You should have received a copy of the GNU General Public License
+--  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 library IEEE;
 use IEEE.std_logic_1164.all;
 use IEEE.numeric_std.all;
 
+use work.extension_uart_pkg.all;
+
 use work.common_pkg.all;
 use work.core_pkg.all;
-use work.extension_uart_pkg.all;
 
 architecture beh of rs232_tx is
        -- definierern der intern verwendeten Signale
@@ -85,8 +96,8 @@ begin
                                tx_rdy <= '1';
                                cnt_next <= 0;
                                -- TODO: wtf, typproblem
-                               -- baud_cnt_next <= to_integer(unsigned(bd_rate));
-                               baud_cnt_next <= CLK_PER_BAUD;
+                               baud_cnt_next <= to_integer(IEEE.numeric_std.unsigned(bd_rate));
+                               --baud_cnt_next <= CLK_PER_BAUD;
                        when SEND =>
                                -- Signalisiert dass gerade ein Byte versendet wird 
                                tx_rdy <= '0';
@@ -102,19 +113,19 @@ begin
                                                when 9 =>
                                                        -- counter = 9 => Stopbit versenden
                                                        bus_tx_nxt <= '1';
-                                                       -- stop_bit 0 heit 1 stop bit
-                                                       if stop_bit = '0' then 
-                                                               cnt_next <= 0;
-                                                               idle_sig_next <= '1';
-                                                       end if;         
                                                when 10 =>
                                                        bus_tx_nxt <= '1';
                                                        -- stop_bit 1 heit 2 stop bits
-                                                       if stop_bit = '1' then 
+                                                       if stop_bit = '0' then 
                                                                cnt_next <= 0;
                                                                -- Signalisieren dass der Sendevorgang beendet ist
                                                                idle_sig_next <= '1';
                                                        end if;
+                                               when 11 => 
+                                                       bus_tx_nxt <= '1';
+                                                       cnt_next <= 0;
+                                                       -- Signalisieren dass der Sendevorgang beendet ist
+                                                       idle_sig_next <= '1';
                                                when others =>
                                                        -- counter von 1 bis 8 => Datenbits versenden
                                                        bus_tx_nxt <= tx_data(cnt-1);