5#ifndef GLOBALSIM_AP_INT_H
6#define GLOBALSIM_AP_INT_H
22 template <std::
size_t n_dig,
typename T=
int16_t>
31 m_value = T(d + (d >= 0 ? 0.5 : -0.5));
41 ap_int k; k.m_value = v; k.test_overflow();
return k;
45 return form(this->m_value + f.m_value);
50 this->m_value +=f.m_value;
56 return form(this->m_value - f.m_value);
61 this->m_value -= f.m_value;
67 return form(this->m_value * f.m_value);
71 this->m_value -= this->m_value * f.m_value;
78 return form(this->m_value / f.m_value);
82 this->m_value /= this->m_value / f.m_value;
89 return form(-this->m_value);
95 if (val > (1<< n_dig)) {
97 throw std::runtime_error(
"ap_int overflow " + std::to_string(
m_value));
AlgTool that to test whether expected the TIP values generated by data supplied by eEmMultTestBench c...
ap_int operator*(const ap_int &f) const
const ap_int & operator*=(const ap_int &f)
const ap_int & operator+=(const ap_int &f)
const ap_int & operator/=(const ap_int &f)
const ap_int operator+(const ap_int &f) const
ap_int operator/(const ap_int &f) const
const ap_int & operator-=(const ap_int &f)