Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

APBUART - APB UART

Table of Contents

Overview

The APBUART model creates an UART device, which is mapped to a TCP port on the host system. The class inherits from the classes gs::reg::gr_device, APBDevice and CLKDevice. This model can be used as a serial console for exchanging data or printing debug information. The model has several registers which are listed in table 45. Further information can be found in GRLIB IP Core User’s Manual (chapter 16).

Table 45 - APBUART Registers
APB address offsetRegister
0x0UART Data register
0x4UART Status register
0x8UART Control register
0xCUART Scaler register

Interface

The GRLIB VHDL model of the APBUART is configured using Generics. For the implementation of the TLM model most of these Generics were refactored to constructor parameters of class AHBUART. An overview about the available parameters is given in table 46.

Table 46 - APBUART Constructor Parameters
ParameterDescription
nameSystemC name of the module
backendSelects the IO backend to be used, currently only TCP available
pindexAPB slave index
paddrADDR field of the APB BAR
pmaskMASK field of the APB BAR
pirqIndex of the interrupt line
consolePrints output from the UART on console during VHDL simulation and speeds up simulation by always returning ‘1’ for Data Ready bit of UART Status register. Does not effect synthesis.
powmonEnable power monitoring

Example Instantiation

This example shows how to instantiate the module APBUART. In line 873 the constructor is called to create the new object. In line 882 the module is connected to the bus and in line 886 the clock is set. In line 884 the interrupts are connected via Signalkit.

APBUART *apbuart = new APBUART(sc_core::sc_gen_unique_name("apbuart", false), io,
index, // index
addr, // paddr
mask, // pmask
irq, // pirq
p_report_power // powmon
);
// Connecting APB Slave
apbctrl.apb(apbuart->bus);
// Connecting Interrupts
signalkit::connect(irqmp.irq_in, apbuart->irq, irq);
// Set clock
apbuart->set_clk(p_system_clock,SC_NS);