Belle II Software development
TRGCDCJLUT Class Reference

A class to use LUTs for TRGCDC. More...

#include <JLUT.h>

Public Member Functions

 TRGCDCJLUT (const std::string &name="no_name")
 Contructor.
 
 TRGCDCJLUT (const TRGCDCJLUT &in)
 Copy constructor.
 
virtual ~TRGCDCJLUT ()
 Destructor.
 
std::string name (void) const
 Operators.
 
std::string version (void) const
 returns version.
 
void setData (int inputBitsize, int outputBitSize, const std::string &filename, bool twoscomplement=0)
 set LookUpTable(LUT) data.
 
void setFunction (std::function< int(int)> function)
 set LUT function directly using int values.
 
int setFloatFunction (std::function< double(double)> function, TRGCDCJSignal const &input, TRGCDCJSignal const &minInv, TRGCDCJSignal const &maxInv, double outputToReal, int lutInputBitwidth, int lutOutputBitwidth)
 set LUT function using JSignals.
 
void setOutputFlag (int outputFlag)
 set output flag.
 
void setBitsize (int inputBitsize, int outputBitsize)
 set input & output bitsize.
 
void setInputBitsize (int inputBitsize)
 set input bitsize.
 
void setOutputBitsize (int outputBitsize)
 set output bitsize.
 
std::string getFileName () const
 get LUT filename
 
int getInputBitsize () const
 get input bitsize
 
int getOutputBitsize () const
 get output bitsize
 
std::function< int(int)> getFunction ()
 get LUT function using int values.
 
std::function< double(double)> getFloatFunction ()
 get LUT function using float values.
 
int getOutputFlag () const
 get output type.
 
int getOutputType () const
 get output type.
 
int getOutput (int) const
 get output using int values.
 
double getFloatOutput (double) const
 get output using float values.
 
void dump ()
 Print variables for LUT.
 
void makeCOE (const std::string &fileName="")
 make COE file.
 
std::string operate (std::string out, std::string in, std::map< std::string, std::map< std::string, double > * > &m_intStorage)
 Operate on LUT. (Will be deprecated.)
 
TRGCDCJSignal const operate (const TRGCDCJSignal &in, TRGCDCJSignal &out)
 Returns LUT value. Out is LUT value + offset. (LUT value + offset do not obey addition bitsize rules.)
 
void operateNoOffset (TRGCDCJSignal const &in, TRGCDCJSignal &out) const
 Output is LUT Out + offset. Input is non offset input.
 
std::string const lutVhdlCode (std::string const &shiftOffsetInput) const
 Creates vhdlCode for lut.
 

Public Attributes

std::vector< double > m_const
 Storage for values used in function.
 

Private Attributes

std::string m_name
 Name.
 
std::vector< int > m_data
 LUT data.
 
std::string m_fileName
 LUT filename.
 
std::function< int(int)> m_function
 LUT function.
 
std::function< double(double)> m_floatFunction
 Float LUT function.
 
int m_outputFlag
 Flag for output. 0 is from function. 1 is from LUT file.
 
int m_inputBitsize
 input bitsize. Number of bits.
 
int m_outputBitsize
 output bitsize. Number of bits.
 
bool m_write
 VHDL write flag for signals. 1: Write is on. 0: Write is off.
 
double m_inputOffset
 Changing float function to int function variables.
 
double m_outputOffset
 The float offset of the output for LUT.
 
double m_outputIntMax
 The integer offset of the output for LUT.
 
double m_inputToReal
 The factor of the input integer to change to float value.
 
double m_toReal
 The factor to change integer to float value.
 
int m_inputShiftBits
 The number of bits to shift to make input the wanted bit width.
 
double m_outputType
 The output type of the LUT. (Will be deprecated.)
 
double m_outputNBitsWithOffset
 The output bit width with offset. (Will be deprecated.)
 
TRGCDCJSignal m_inputMin
 The minimum input signal.
 
TRGCDCJSignal m_inputMax
 The maximum input signal.
 
TRGCDCJSignal m_shiftOutputMin
 The minimum output signal that is bit shifted.
 
TRGCDCJSignal m_shiftOffsetOutputMax
 The maximum output value that is bit shifted.
 
TRGCDCJSignal m_shiftOffsetInput
 The bt shifted offset signal of input.
 

Detailed Description

A class to use LUTs for TRGCDC.

Definition at line 35 of file JLUT.h.

Member Data Documentation

◆ m_const

std::vector<double> m_const

Storage for values used in function.

Definition at line 117 of file JLUT.h.

◆ m_data

std::vector<int> m_data
private

LUT data.

Definition at line 137 of file JLUT.h.

◆ m_fileName

std::string m_fileName
private

LUT filename.

Definition at line 140 of file JLUT.h.

◆ m_floatFunction

std::function<double(double)> m_floatFunction
private

Float LUT function.

Definition at line 146 of file JLUT.h.

◆ m_function

std::function<int(int)> m_function
private

LUT function.

Definition at line 143 of file JLUT.h.

◆ m_inputBitsize

int m_inputBitsize
private

input bitsize. Number of bits.

Definition at line 152 of file JLUT.h.

◆ m_inputMax

TRGCDCJSignal m_inputMax
private

The maximum input signal.

Definition at line 188 of file JLUT.h.

◆ m_inputMin

TRGCDCJSignal m_inputMin
private

The minimum input signal.

Definition at line 185 of file JLUT.h.

◆ m_inputOffset

double m_inputOffset
private

Changing float function to int function variables.

Definition at line 161 of file JLUT.h.

◆ m_inputShiftBits

int m_inputShiftBits
private

The number of bits to shift to make input the wanted bit width.

Definition at line 176 of file JLUT.h.

◆ m_inputToReal

double m_inputToReal
private

The factor of the input integer to change to float value.

Definition at line 170 of file JLUT.h.

◆ m_name

std::string m_name
private

Name.

Definition at line 134 of file JLUT.h.

◆ m_outputBitsize

int m_outputBitsize
private

output bitsize. Number of bits.

Definition at line 155 of file JLUT.h.

◆ m_outputFlag

int m_outputFlag
private

Flag for output. 0 is from function. 1 is from LUT file.

Definition at line 149 of file JLUT.h.

◆ m_outputIntMax

double m_outputIntMax
private

The integer offset of the output for LUT.

Definition at line 167 of file JLUT.h.

◆ m_outputNBitsWithOffset

double m_outputNBitsWithOffset
private

The output bit width with offset. (Will be deprecated.)

Definition at line 182 of file JLUT.h.

◆ m_outputOffset

double m_outputOffset
private

The float offset of the output for LUT.

Definition at line 164 of file JLUT.h.

◆ m_outputType

double m_outputType
private

The output type of the LUT. (Will be deprecated.)

Definition at line 179 of file JLUT.h.

◆ m_shiftOffsetInput

TRGCDCJSignal m_shiftOffsetInput
private

The bt shifted offset signal of input.

Definition at line 197 of file JLUT.h.

◆ m_shiftOffsetOutputMax

TRGCDCJSignal m_shiftOffsetOutputMax
private

The maximum output value that is bit shifted.

Definition at line 194 of file JLUT.h.

◆ m_shiftOutputMin

TRGCDCJSignal m_shiftOutputMin
private

The minimum output signal that is bit shifted.

Definition at line 191 of file JLUT.h.

◆ m_toReal

double m_toReal
private

The factor to change integer to float value.

Definition at line 173 of file JLUT.h.

◆ m_write

bool m_write
private

VHDL write flag for signals. 1: Write is on. 0: Write is off.

Definition at line 158 of file JLUT.h.


The documentation for this class was generated from the following files: