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

Subversion Repositories openrisc

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

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
class UartSC
34
  : public sc_core::sc_module
35
{
36
public:
37
 
38
  // Constructor
39
  UartSC (sc_core::sc_module_name  name);
40
 
41
  // The ports
42
  sc_in<bool>   clk;
43
  sc_in<bool>   uarttx;
44
  sc_out<bool>   uartrx;
45
 
46
  // Init function
47
  void initUart (int clk_freq_hz, int uart_baud) ;
48
  // Transmit (from ORPSoC) handling function
49
  void checkTx();
50
 
51
private:
52
  int clocks_per_bit;
53
  uint8_t current_char;
54
  int counter;
55
  int bits_received;
56
 
57
};      // UartSC ()
58
 
59
#endif  // UART_SC__H

powered by: WebSVN 2.1.0

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