OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [orpsocv2/] [bench/] [sysc/] [include/] [UartSC.h] - Blame information for rev 465

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 julius
// ----------------------------------------------------------------------------
2
 
3
// SystemC Uart: definition
4
 
5
// This file is part of the cycle accurate model of the OpenRISC 1000 based
6
// system-on-chip, ORPSoC, built using Verilator.
7
 
8
// This program is free software: you can redistribute it and/or modify it
9
// under the terms of the GNU Lesser General Public License as published by
10
// the Free Software Foundation, either version 3 of the License, or (at your
11
// option) any later version.
12
 
13
// This program is distributed in the hope that it will be useful, but WITHOUT
14
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
16
// License for more details.
17
 
18
// You should have received a copy of the GNU Lesser General Public License
19
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
 
21
// ----------------------------------------------------------------------------
22
 
23
// $Id: $
24
 
25
#ifndef UART_SC__H
26
#define UART_SC__H
27
 
28
#include "systemc.h"
29 63 julius
#include <stdint.h>
30 6 julius
 
31
//! Handle UART I/O
32
 
33 462 julius
class UartSC:public sc_core::sc_module {
34 6 julius
public:
35
 
36 462 julius
        // Constructor
37
        UartSC(sc_core::sc_module_name name);
38 6 julius
 
39 462 julius
        // The ports
40
        sc_in < bool > clk;
41
        sc_in < bool > uarttx;
42
        sc_out < bool > uartrx;
43 6 julius
 
44 462 julius
        // Init function
45
        void initUart(int clk_freq_hz, int uart_baud);
46
        // Transmit (from ORPSoC) handling function
47
        void checkTx();
48 6 julius
 
49
private:
50 462 julius
        int clocks_per_bit;
51
        uint8_t current_char;
52
        int counter;
53
        int bits_received;
54 6 julius
 
55 462 julius
};                              // UartSC ()
56 6 julius
 
57 462 julius
#endif // UART_SC__H

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.