Commit 7d144e0e authored by GuillemCabo's avatar GuillemCabo
Browse files

add specs RDC

parent 58b00157
\newpage
\section{General purpose of the module}
RDC stands by request duration counter. The purpose of this unit is track the length of a given event. At the core we assume that there are two types of events that are feed in to the PMU. On one hand there are single clock events, where each cycle that they are high means that a new event has occurred, and example of it would be instruction count for instance. On the other hand we have multiple-cycle events, in this case the event is risen at the begging of a given condition and remains high until the condition has finished, counting effectively the cycles that such condition is high rather than the number of events. An example of a multiple-cycle event would be the cache hold signal, that indicates the time the cache is waiting to get a response from memory.\\
\\
The RDC implements a mechanism to measure the length of multiple-cycle events and control that the length of a given event is not exceeded. If an event exceeds the set length an interruption is risen. A single interruption is provided for the whole unit.
\ No newline at end of file
\section{Design placement}
\label{chapter2}
This modules is meant to be instantiated by the interface agnostic PMU (PMU\_raw.sv). Only one instance of this module is required.
%This module is meant to be a blackbox inside the chisel code. It belongs to the Drac class in the \emph{rocket.scala} file. We can have as many instances of this module as cores are instantiated in the SoC. Currently only single core operation has been tested.
\section{Parameters}
\label{chapter3}
This unit uses several parameters. \textbf{DATA\_WIDTH} defines the size of the data registers.\\
\textbf{WEIGHTS\_WIDTH} defines the size of the registers that store the lengths of the requests and the maximum requests allowed.\textbf{ N\_CORES} is used to configured to replicate the internal logic of the RDC to support several cores. \textbf{CORE\_EVENTS} sets the number of events that are track for each core.\\
\\
Given the previous parameters the unit shall generate correct RTL without any manual modification to the source code.\\
\\
\ No newline at end of file
\section{Interface}\label{interface}
\label{chapter 4}
Interface signals of the module are listed in the table below.
%TODO
%\begin{table}[H]
% \centering
% \begin{tabular}{lllll}
% \hline
% Port\_Name & Direction & Width & Index & Description \\
% \hline
% CLK & INPUT & 1 & - & Main clock, up to 200MHz \\
% RST & INPUT & 1 & - & Hard reset. Active LOW \\
% SOFT\_RST & INPUT & 1 & - & Soft reset. Active LOW \\
% RESET\_ADDRESS & INPUT & 40 & - & Inital address of PC after soft or hard reset \\
% CSR\_RW\_RDATA & INPUT & 64 & - & - \\
% \end{tabular}
%\end{table}
\section{Reset behavior}
The module contains a single global reset, called rstn\_i it is asynchronous and active low.\\
\\
Any reset when active shall clear any internal register and set them to 0. Interruption shall become inactive while the unit is in reset or disabled.
\section{What could not happen}
No special restrictions have been considered other than specified in section \ref{behavior}
\ No newline at end of file
\section{Behavior}\label{behavior}
\subsection{Pulse counters}
The unit has a generate loop that will create for each input event of each core one counter, a max value hold register and update logic. While rstn\_is low the hold registers (max\_value) are set to 0.
If the unit is enabled and the event assigned to the counter is active the counter will increase by one and the result will be stored in the hold register. If the event is 0 the hold register is reset to 0.\\
\\
Each counter has overflow protection.
\subsection{Watermark}
The watermark logic assigns one register for each event of each core called watermark\_int. At reset the register is set to 0. If the unit is not enabled the values of watermark\_int are keept unchanged. If the unit is active the current value of watermark\_int is compared against the current value of the pulse counters (watermark\_int). When max\_value is larger than watermark\_int, the second is updated with the new value of the pulse counter (max\_value).\\
\\
\subsection{Interruption}
The RDC provides one interruption (interruption\_vector\_rdc\_o) for the whole unit an one interruption vector (interruption\_vector\_int) for each core. The interruption vector encodes in one hot encoding the signal exceeding the pulse width, the LSB of the vector is maps to the signal 0 of each core, and the remaining bits are filled in ascending order with the following signals.\\
\\
The interruption logic checks for each signal if its corresponding max\_value exceeds the respective events\_weights\_i. In other words if the current pulse been measured exceeds the weight currently assigned to it a bit in the interrupt vector of the corresponding core will be set to high.\\
\\
Interruptions are hold over time, until the init is disabled or reset. That is achieved by registering the output interruption vector (interruption\_vector\_rdc\_o) and applying an or operation between its past value and the current cycle internal interruption vector (interruption\_vector\_int).\\
\\
To decide if the RDC interruption needs to be risen all the interruption vectors are or-reduced along a bit that stores the previous state of the interrupt.
\subsection{Packages and structures}
No packages and structures are used in this module.
\section{Special cases, corner cases}
The interrupts shall be generated if the current pulse value is equal or larger than the event weigth. Otherwise if the event weight is set to the maximum value of the register, due to the overflow protection of the counters will prevent the interrupt to trigger, producing a non intuitive outcome. \\
\\
\ No newline at end of file
CC=pdflatex
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
clean:
rm *.aux *.log *.blg *.bbl *.out
clear:
rm *.aux *.log *.blg *.bbl *.out *.pdf
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\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{caption}
\usepackage{subcaption}
\usepackage{graphicx}
\usepackage{float}
\usepackage{blindtext} %for enumarations
\usepackage[]{hyperref} %link collor
%talbe layout to the right
%\usepackage[labelfont=bf]{caption}
%\captionsetup[table]{labelsep=space,justification=raggedright,singlelinecheck=off}
%\captionsetup[figure]{labelsep=quad}
\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
\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
\setlength\parskip{4pt}
%----------------------------------------------------------------------------------------
% TITLE SECTION
%----------------------------------------------------------------------------------------
\newcommand{\horrule}[1]{\rule{\linewidth}{#1}} % Create horizontal rule command with 1 argument of height
\title{
\normalfont \normalsize
\horrule{0.5pt} \\[0.4cm] % Thin top horizontal rule
\huge PMU\_RDC specification version v1 \\ % 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
\begin{document}
%\nocite{*}
\maketitle % Print the title
\newpage
\tableofcontents
%----------------------------------------------------------------------------------------
% Section 1
%----------------------------------------------------------------------------------------
\input{1-Section.tex}
%----------------------------------------------------------------------------------------
% Section 2
%----------------------------------------------------------------------------------------
\input{2-Section.tex}
\input{3-Section.tex}
\input{4-Section.tex}
\input{5-Section.tex}
\input{6-Section.tex}
\input{7-Section.tex}
\input{8-Section.tex}
\end{document}
......@@ -59,7 +59,6 @@
//Each clock cycle if the input signal (events_i) for a given counter is
//high at the positive edge of the clock the counter increases
localparam N_COUNTERS = CORE_EVENTS * N_CORES;
//reg [WEIGHTS_WIDTH-1 : 0] max_value [0 : N_COUNTERS-1];
reg [WEIGHTS_WIDTH-1 : 0] max_value [0 : N_COUNTERS-1];
//I need a bit to hold the interruption state until RCD is reset on
//disabled once the interrupt is risen
......
Markdown is supported
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