Commit 99f03d5b authored by GuillemCabo's avatar GuillemCabo
Browse files

add overflow spec

parent 38f74de0
\section{General purpose of the module}
This module shall detect if an overflow of a given counter is about to happen, if any counter reaches the maximum value an interrupt shall be risen by the overflow module. Only one interrupt is required, the counter causing the interrupt shall be identified by a signal called overflow interrupt vector (over\_intr\_vect\_o) that will encode in one-hot fashion the offending counter or counters.\\
Overflow detection shall be optional for each individual counter, hardware for overflow detection shall be present for all the counters but software shall be able to control through an overflow interrupt mask (over\_intr\_mask\_i) what counters can actually generate an interrupt.\\
A dedicated enable signal shall be provided. Enable is active high.\\
Interrupt can not be active if the unit is disabled. The unit is considered enabled if the unit is not in hard or soft reset and the enable is high.\\
The whole unit shall use combinational logic, inputs and outputs are registered externally at the rising edge of the clock. The required inputs and outputs will be wires, names, types and default sizes are provided in section \ref{interface}.\\
\section{Design placement}
This modules is meant to be instantiated by the interface agnostic PMU (PMU\ 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.
This module requires two integer parameters.REG\_WIDTH and N\_COUNTERS. \\
\textbf{REG\_WIDTH} defines the number of bits that a counter has.\\
\textbf{N\_COUNTERS} defines the amount of counters that are available in the PMU.\\
Given the previous parameters the unit shall generate correct RTL without any manual modification to the source code.
%The instance of this module takes no parameters, signal widths are hard-coded to match the SoC.
%Internal parameters and structures such as signals for requests and responses of the caches are imported from drac\_pkg.
\ No newline at end of file
\label{chapter 4}
Interface signals of the module are listed in the table below.
% \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}
\section{Reset behavior}
The module contains two reset signals. One synchronous active high reset enabled by software called softrst\_i, the other is the global reset, it is asynchronous and active low.\\
Any reset when active shall clear any internal register and set them to 0. Interruptions shall become inactive while the unit is in reset.
\section{What could not happen}
All signals except registers used to track previous state of the interrupts shall not be registered.\\
Interruptions shall be low while the unit is in reset.\\
Overflow interruption vector shall not decrease in value unless the unit is reset or soft-reset.\\
The overflow interruption shall not decrease unless the unit is reset or soft-reset.
\ No newline at end of file
The module identifies the overflow of a counter by performing an and reduction of the incoming counter signals. Detected overflowing counters will only be signaled to the output after applying a bit by bit and operation between the detected overflow signal and the current overflow mask.\\
The unit is considered disabled when rstn\_i is 0 or softrst\_i is 1 or en\_i is 0.\\
The previous state of the interrupt vector is stored to prevent missing the interrupt once the counter overflows. The output interrupt is te result of an or reduction of the masked overflow signals (masked\_overflow) and the past interruption vector (past\_intr\_vect) if the unit is enabled, otherwise the output is 0. In other words, if any bit in the past interruption vector or masked overflow signals the interuption while the unit is active the interrupt is active.\\
\subsection{Packages and structures}
No packages and structures are used in this module.
\section{Special cases, corner cases}
If the unit is disabled instead but soft reset is never activated the previous state of the interrupt vector will not be cleared and therefore the interrupt will trigger again as soon as the unit is enabled. Since the internal state is not visible for software developers if not used correctly it may lead to unexpected behavior.
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
\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 PMU\_overflow 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
\maketitle % Print the title
% Section 1
% Section 2
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