Commit 2b6aff07 authored by GuillemCabo's avatar GuillemCabo
Browse files

add GRLIB like documentation for SELENE integration

parent 7c2dc500
The SafePMU (Safe Performance Monitoring Unit) is an AHB slave capable of monitoring SoC events, enforce contention control, and identifying profiling errors on run-time.
Figure "\ref{fig:blkdia}" shows the structure of the unit. It is composed of an ahb wrapper (\textit{ahb\_wrapper.vhd}) that maps the SystemVerilog implementation into a VHDL module that can be instanced in SELENE and De-RISC SoCs. The SystemVerilog AHB interface (\textit{pmu\}) offers support for a subset of AHB requests. This module also instances the interface agnostic PMU (\textit{PMU\}). The latter is used as the generator of the statistic unit. It generates the memory map and the instances for each of the features.\\
The main features are:\\
\item \textbf{Self-test:} Allows to configure the counters' inputs to a fixed value bypassing the crossbar and ignoring the inputs. This mode allows for tests of the software and the unit under known conditions.
\item \textbf{Crossbar:} Allows to route any input event to any counter.
\item \textbf{Counters:} Group of simple counters with settable initial values and general control register.
\item \textbf{Overflow:} Detection of overflow for counters, interrupt capable with dedicated interruption vector and per counter interrupt enable.
\item \textbf{Quota:} Deprecated \textit{(It may be excluded in a future release)}
\item \textbf{MCCU }(Maximum Contention Control Unit) : Contention control measures for each core. Interruption capable after a threshold of contention is exceeded. It accepts real contention signals or estimation through weights.
\item \textbf{RDC }(Request Duration Counters): Provides measures of the pulse length of a given input signal (watermark). It can be used to determine maximum latency and cycles of uninterrupted contentions. Each of the counters can trigger an interrupt at a user-defined threshold.
The default configuration of this unit supports 4 cores and 32 input signals. In future releases such parameters (VHDL generics) will be exposed to the top level.
\caption{Block diagram statistics unit structure}
This diff is collapsed.
\section{Configuration options}
\label{chapter 4}
Table \ref{generics} shows the configuration parameters exposed by \textit{ahb\_wrapper.vhd}. Given the current development status, changes to the configuration options may require manual modifications to internal modules and software drivers. Future releases will expose parameters to enable individual PMU features and allow for more flexibility.\\
\caption{Configuration options (VHDL ports)}
\textbf{Generic} & \textbf{Function} & \textbf{Allowed range} & \textbf{Default}\\
HADDR & AHB base address &0 to 16\#fff\# & 0\\
HMASK & AHB address mask &0 to 16\#fff\# & 16\#fff\#\\
N\_REGS & Total of accessible registers & 2 to 64 & 43\\
PMU\_COUNTERS & Number of generic counters. Same as crossbar outputs& 1 to 32 &24 \\
N\_SOC\_EV &SoC signals. Inputs to the crossbar& 1 to 64 & 32 \\
REG\_WIDTH &Size of registers and counters & 32 \textbf{or} 64 & 32 \\
\section{Signal descriptions}
Table \ref{t_ports} shows the interface of the core (VHDL ports).
\caption{Signal descriptions (VHDL ports)}
\textbf{Signal name} & \textbf{Field} & \textbf{Type} & \textbf{Function} & \textbf{Active}\\
RST & &Input &Reset & Low\\
CLK & &Input &AHB master bus clock & -\\
PMU\_EVENTS & &Input & Input for regular SoC events & -\\
CCS\_CONTENTION & &Input & Input for contention cycle stack signals that measure contention & -\\
CCS\_LATENCY & &Input & Input for contention cycle stack signals that measure access latency & -\\
AHBSI & * &Input & AHB slave input signals& -\\
AHBSO & * &Output &AHB slave output signals, includes interrupts & - \\
\section{Library dependences}
Table \ref{dep_tab} shows the libraries used when instantiating the core (VHDL libraries).\\
%%TODO: check if the libraries are actually needed
\caption{Library dependencies}
\textbf{Library} & \textbf{Package} & \textbf{Imported units} & \textbf{Description} \\
IEEE & std\_logic\_1164 & Types & Standard logic types\\
GRLIB & amba & Signals & AMBA signal definitions\\
GRLIB & config & Types & Amba P\&P types\\
GRLIB & devices & Types & Device names and vendors \\
GRLIB & stdlib & All & Common VHDL functions\\
GAISLER & noelv & Signals & Counter vectors and types \\
BSC & pmu\_module & Instances and signals & Instances and signal definitions for the PMU\\
\ No newline at end of file
An example design is provided in the context of SELENE and De-RISC. Integration examples of earlier releases of the unit along LEON3MP can be provided under demand.\\
\begin{lstlisting}[label=ins-prot,caption=SafePMU instance example for gpp\_sys,style=vhdl]
-- Include BSC library
library bsc;
use bsc.pmu_module.all;
--Provide a non-overlaping hsidx
constant hsidx_pmu : integer := 6;
--Update the hsidx of the next slave
constant nextslv : integer := hsidx_pmu + 1;
--Declare events and signals of interest. They may change
--for each use case. Route such events to pmu_events,
--ccs_contention and ccs_latency ports
--Instance of the unit
PMU_inst : ahb_wrapper
generic map(
ncpu => CFG_NCPU,
hindex => hsidx_pmu,
haddr => 16#801#,
hmask => 16#FFF#
port map(
rst => rstn,
clk => clkm,
pmu_events => pmu_events,
ccs_contention => ccs_contention,
ccs_latency => ccs_latency,
ahbsi => ahbsi,
ahbso => ahbso(hsidx_pmu));
Given the development status of the module and drivers it is recommended to not modify the internal parameters of the module.\\
\section{Special cases, corner cases}
After reset of a top module (PMU\_raw for instance) you may experience that all the outputs route the event in the first position of vector\_i. This is intended behavior and happens due to the reset of the configuration registers (cfg\_i).\\
In the default integration with PMU\ there is a self-test capability that bypasses the crossbar with certain test patterns. This \textbf{self-test capability} is configured in the main configuration register of PMU\ Be sure to have this function disabled if you plan to use the crossbar.
\ No newline at end of file
all: spec
spec: main.tex 1-Section.tex 2-Section.tex 3-Section.tex 4-Section.tex 5-Section.tex 6-Section.tex 7-Section.tex 8-Section.tex
$(CC) main.tex
rm *.aux *.log *.blg *.bbl *.out
rm *.aux *.log *.blg *.bbl *.out *.pdf
% License:
% CC BY-NC-SA 3.0 (
\documentclass[paper=a4, fontsize=11pt]{scrartcl} % A4 paper and 11pt font size
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{fourier} % Use the Adobe Utopia font for the document - comment this line to return to the LaTeX default
\usepackage[english]{babel} % English language/hyphenation
\usepackage{amsmath,amsfonts,amsthm} % Math packages
\usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template
\usepackage{blindtext} %for enumarations
\usepackage[]{hyperref} %link collor
%talbe layout to the right
\usepackage{sectsty} % Allows customizing section commands
\allsectionsfont{\centering \normalfont\scshape} % Make all sections centered, the default font and small caps
\usepackage{fancyhdr} % Custom headers and footers
\usepackage{register} % Custom headers and footers
\pagestyle{fancyplain} % Makes all pages in the document conform to the custom headers and footers
\fancyhead{} % No page header - if you want one, create it in the same way as the footers below
\fancyfoot[L]{} % Empty left footer
\fancyfoot[C]{} % Empty center footer
\fancyfoot[R]{\thepage} % Page numbering for right footer
\renewcommand{\headrulewidth}{0pt} % Remove header underlines
\renewcommand{\footrulewidth}{0pt} % Remove footer underlines
\setlength{\headheight}{13.6pt} % Customize the height of the header
\numberwithin{equation}{section} % Number equations within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{figure}{section} % Number figures within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{table}{section} % Number tables within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
%\setlength\parindent{0pt} % Removes all indentation from paragraphs - comment this line for an assignment with lots of text
\newcommand{\horrule}[1]{\rule{\linewidth}{#1}} % Create horizontal rule command with 1 argument of height
\normalfont \normalsize
\horrule{0.5pt} \\[0.4cm] % Thin top horizontal rule
\huge SafePMU User's Manual\\ % The assignment title
\horrule{2pt} \\[0.5cm] % Thick bottom horizontal rule
\author{ Guillem Cabo Pitarch} % Your name
\date{\today} % Today's date or a custom date
language = VHDL,
basicstyle = \ttfamily,
keywordstyle = \color{keyword}\bfseries,
commentstyle = \color{comment},
framexleftmargin = 15pt
\maketitle % Print the title
% Section 1
% Section 2
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment