%! TEX root = ../thesis.tex


\chapter{Introduction}

\section{The BrainScale System}

    The BrainScale Wafer System, developed and used in the electronic visions group at Heidelberg University is a neuromorphic hardware implementation~\cite{waferembedding}.\\~\\
    For this thesis the following core components are of importance: 

    \begin{itemize}
        \item mixed-signal ASICs, named HICANNs, structured in packs of 8 into reticles
        \item Control Units for Reticles, short CURE boards
        \item Analog Breakout boards, AnaB for short
        \item and power supply, called PowerIt.
    \end{itemize}

    \begin{figure}[H]
        \centering
        \includegraphics[width=.9\textwidth]{pics/waferscale_system.png}
        \caption{The BrainScaleS wafer-scale hardware system, marked are the main components comprising a single wafer system.~\cite{hbpguidebook-brainscales}}\label{fig:wss}
    \end{figure}

\section{About the PowerIt Subsystem}

    The main subject of this thesis is the PowerIt board (\autoref{fig:pitteststand}). It functions as power supply inside of the WaferScale system (\autoref{fig:wss}). 
    In which it is providing the wafer with \SI{1.8}{\volt} and the FPGAs with \SI{9.6}{\volt}. Its maximum rated power draw is \SI{2}{\kilo\watt}.~\cite{poweritupgrade}

    \begin{figure}[h]
        \centering
        \includegraphics[width=.7\textwidth]{./tikz/powerit.pdf}
        \caption{PowerIt board, top view, receiving \SI{48}{\volt} as input (magenta) and outputting \SI{9.6}{\volt} (green) as well as \SI{1.8}{\volt} (analog: red, digital: blue)}\label{fig:pitteststand}
    \end{figure}

    The brain of these PowerIt boards is a STM32 Chip\footnote{STM32F405RGT~\cite{stm32f405xx}} which runs a custom firmware based on ChibiOS~\cite{chibios}.
    The PowerIt, while providing \SI{9.6}{\volt} and \SI{1.8}{\volt}, also is able to measure the following values:

    \begin{itemize}
        \item input voltage and current
        \item \SI{1.8}{\volt} output voltage and current
        \item and the \SI{9.6}{\volt} output Voltage
    \end{itemize}

    which can then be used inside the firmware.

    While the input voltage is given from outside it is still changeable if the power supply is able to vary its output voltage.
    Additionally the \SI{9.6}{\volt} are a set voltage obtained by the power supply modules\footnote{5:1 Bus converter IB0xxE096T48xx, 500W each}, which divide the input volatge by 5.
    Lastly the \SI{1.8}{\volt} output voltage is variable.


\newpage
\section{Contents in Detail}

    The first goal was to be able to change the calibration parameters.
    While this can be done at compiletime, these changes are board specific.
    Therefore they either need to be changed, before compiling, which would require a compilation per board.
    Or else the need to be able to change during runtime.
    For mainly maintainability reasons the second way was choosen.
    
    But these calibration changes could not be transferred to the PowerIt using the old communication protokol, referred to as PItCOMM version 1.
    A updated protocol was needed and it had to be able to accept not only the beforementioned values, but also any additional information or configuration.

    And while at it the protocol, now PItCOMM version 2, was made to be somewhat compliant with the SMBus specifications. 
    This was accomplished with a virtual memory map, which maps every parameter to a specific location in a virtual memeory.
    In this memory, any value which needed to be accessible, be it measurement, calibration or static board information, is mapped (see \autoref{registerbuffer}).

    Whith this as foundation, the PowerIt could be calibrated.
    And the calibration parameters were be stored in a database.
    The Calibration characterizes the voltage measuring circuit, whose voltages are either coming into or leaving the PowerIt.
    
    Lastly, with a now calibrated board, a power supplys behavior was observed and corrected for, with a regulation mechanism.
