CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
trklet::VarCut Class Reference

#include <imath.h>

Inheritance diagram for trklet::VarCut:
trklet::VarBase

Public Member Functions

void local_passes (std::map< const VarBase *, std::vector< bool > > &passes, const std::map< const VarBase *, std::vector< bool > > *const previous_passes=nullptr) const
 
double lower_cut () const
 
VarFlagparent_flag ()
 
virtual void print (std::ofstream &fs, HLS, int l1=0, int l2=0, int l3=0)
 
virtual void print (std::ofstream &fs, Verilog, int l1=0, int l2=0, int l3=0)
 
void print (std::map< const VarBase *, std::set< std::string > > &cut_strings, const int step, Verilog, const std::map< const VarBase *, std::set< std::string > > *const previous_cut_strings=nullptr) const
 
void print (std::map< const VarBase *, std::set< std::string > > &cut_strings, const int step, HLS, const std::map< const VarBase *, std::set< std::string > > *const previous_cut_strings=nullptr) const
 
void set_cut_var (VarBase *cut_var, const bool call_add_cut=true)
 
void set_parent_flag (VarFlag *parent_flag, const bool call_add_cut)
 
double upper_cut () const
 
 VarCut (imathGlobals *globals, double lower_cut, double upper_cut)
 
 VarCut (imathGlobals *globals, VarBase *cut_var, double lower_cut, double upper_cut)
 
 ~VarCut () override=default
 
- Public Member Functions inherited from trklet::VarBase
void add_cut (VarCut *cut, const bool call_set_cut_var=true)
 
void add_delay (int i)
 
void add_latency (unsigned int l)
 
void analyze ()
 
bool calculate (int debug_level)
 
bool calculate ()
 
VarBasecut_var ()
 
std::string dump ()
 
void dump_msg ()
 
double fval () const
 
bool has_delay (int i)
 
void inputs (std::vector< VarBase *> *vd)
 
long int ival () const
 
double K () const
 
std::map< std::string, int > Kmap () const
 
std::string kstring () const
 
int latency () const
 
virtual void local_calculate ()
 
bool local_passes () const
 
void makeready ()
 
double maxval () const
 
double minval () const
 
std::string name () const
 
int nbits () const
 
std::string op () const
 
VarBasep1 () const
 
VarBasep2 () const
 
VarBasep3 () const
 
void passes (std::map< const VarBase *, std::vector< bool > > &passes, const std::map< const VarBase *, std::vector< bool > > *const previous_passes=nullptr) const
 
int pipe_counter ()
 
std::string pipe_delays (const int step)
 
void pipe_increment ()
 
virtual void print (std::ofstream &fs, Verilog, int l1=0, int l2=0, int l3=0)
 
virtual void print (std::ofstream &fs, HLS, int l1=0, int l2=0, int l3=0)
 
void print_all (std::ofstream &fs, Verilog)
 
void print_all (std::ofstream &fs, HLS)
 
void print_cuts (std::map< const VarBase *, std::set< std::string > > &cut_strings, const int step, Verilog, const std::map< const VarBase *, std::set< std::string > > *const previous_cut_strings=nullptr) const
 
void print_cuts (std::map< const VarBase *, std::set< std::string > > &cut_strings, const int step, HLS, const std::map< const VarBase *, std::set< std::string > > *const previous_cut_strings=nullptr) const
 
void print_step (int step, std::ofstream &fs, Verilog)
 
void print_step (int step, std::ofstream &fs, HLS)
 
void print_truncation (std::string &t, const std::string &o1, const int ps, Verilog) const
 
void print_truncation (std::string &t, const std::string &o1, const int ps, HLS) const
 
double range () const
 
void reset ()
 
int shift () const
 
int step () const
 
 VarBase (imathGlobals *globals, std::string name, VarBase *p1, VarBase *p2, VarBase *p3, int l)
 
virtual ~VarBase ()
 

Protected Attributes

double lower_cut_
 
VarFlagparent_flag_
 
double upper_cut_
 
- Protected Attributes inherited from trklet::VarBase
VarBasecut_var_
 
std::vector< VarBase * > cuts_
 
double fval_
 
imathGlobalsglobals_
 
long int ival_
 
double K_
 
std::map< std::string, int > Kmap_
 
int latency_
 
double maxval_
 
double minval_
 
std::string name_
 
int nbits_
 
std::string op_
 
VarBasep1_
 
VarBasep2_
 
VarBasep3_
 
int pipe_counter_
 
std::vector< int > pipe_delays_
 
bool readytoanalyze_
 
bool readytoprint_
 
int step_
 
bool usedasinput_
 
double val_
 

Additional Inherited Members

- Static Public Member Functions inherited from trklet::VarBase
static void design_print (const std::vector< VarBase *> &v, std::ofstream &fs, Verilog)
 
static void design_print (const std::vector< VarBase *> &v, std::ofstream &fs, HLS)
 
static void hls_print (const std::vector< VarBase *> &v, std::ofstream &fs)
 
static std::string itos (int i)
 
static std::string pipe_delay (VarBase *v, int nbits, int delay)
 
static std::string pipe_delay_wire (VarBase *v, std::string name_delayed, int nbits, int delay)
 
static void verilog_print (const std::vector< VarBase *> &v, std::ofstream &fs)
 
- Static Public Attributes inherited from trklet::VarBase
static struct trklet::VarBase::HLS hls
 
static struct trklet::VarBase::Verilog verilog
 

Detailed Description

Definition at line 1054 of file imath.h.

Constructor & Destructor Documentation

◆ VarCut() [1/2]

trklet::VarCut::VarCut ( imathGlobals globals,
double  lower_cut,
double  upper_cut 
)
inline

Definition at line 1056 of file imath.h.

References trklet::VarBase::op_.

1057  : VarBase(globals, "", nullptr, nullptr, nullptr, 0),
1060  parent_flag_(nullptr) {
1061  op_ = "cut";
1062  }
VarFlag * parent_flag_
Definition: imath.h:1092
VarBase(imathGlobals *globals, std::string name, VarBase *p1, VarBase *p2, VarBase *p3, int l)
Definition: imath.h:161
std::string op_
Definition: imath.h:300
double lower_cut_
Definition: imath.h:1090
double upper_cut() const
Definition: imath.h:1071
double upper_cut_
Definition: imath.h:1091
double lower_cut() const
Definition: imath.h:1070

◆ VarCut() [2/2]

trklet::VarCut::VarCut ( imathGlobals globals,
VarBase cut_var,
double  lower_cut,
double  upper_cut 
)
inline

Definition at line 1064 of file imath.h.

References trklet::VarBase::cut_var(), and set_cut_var().

1065  : VarCut(globals, lower_cut, upper_cut) {
1067  }
void set_cut_var(VarBase *cut_var, const bool call_add_cut=true)
Definition: imath.cc:365
VarBase * cut_var()
Definition: imath.cc:388
double upper_cut() const
Definition: imath.h:1071
VarCut(imathGlobals *globals, double lower_cut, double upper_cut)
Definition: imath.h:1056
double lower_cut() const
Definition: imath.h:1070

◆ ~VarCut()

trklet::VarCut::~VarCut ( )
overridedefault

Member Function Documentation

◆ local_passes()

void VarCut::local_passes ( std::map< const VarBase *, std::vector< bool > > &  passes,
const std::map< const VarBase *, std::vector< bool > > *const  previous_passes = nullptr 
) const

Definition at line 304 of file imath.cc.

References trklet::VarBase::cut_var_, trklet::VarBase::ival(), trklet::VarBase::K(), lower_cut(), lower_cut_, trklet::VarBase::passes(), upper_cut(), and upper_cut_.

Referenced by trklet::VarFlag::passes().

305  {
306  const int lower_cut = lower_cut_ / cut_var_->K();
307  const int upper_cut = upper_cut_ / cut_var_->K();
308  if (!previous_passes || (previous_passes && !previous_passes->count(cut_var_))) {
309  if (!passes.count(cut_var_))
310  passes[cut_var_];
311  passes.at(cut_var_).push_back(cut_var_->ival() > lower_cut && cut_var_->ival() < upper_cut);
312  }
313 }
VarBase * cut_var_
Definition: imath.h:309
void passes(std::map< const VarBase *, std::vector< bool > > &passes, const std::map< const VarBase *, std::vector< bool > > *const previous_passes=nullptr) const
Definition: imath.cc:332
double lower_cut_
Definition: imath.h:1090
double upper_cut() const
Definition: imath.h:1071
double K() const
Definition: imath.h:246
double upper_cut_
Definition: imath.h:1091
long int ival() const
Definition: imath.h:213
double lower_cut() const
Definition: imath.h:1070

◆ lower_cut()

double trklet::VarCut::lower_cut ( ) const
inline

Definition at line 1070 of file imath.h.

References lower_cut_.

Referenced by trklet::VarBase::local_passes(), local_passes(), trklet::VarBase::passes(), print(), and trklet::VarBase::print_cuts().

1070 { return lower_cut_; }
double lower_cut_
Definition: imath.h:1090

◆ parent_flag()

VarFlag* trklet::VarCut::parent_flag ( )
inline

Definition at line 1086 of file imath.h.

References parent_flag_.

Referenced by set_parent_flag().

1086 { return parent_flag_; }
VarFlag * parent_flag_
Definition: imath.h:1092

◆ print() [1/4]

virtual void trklet::VarBase::print
inline

Definition at line 256 of file imath.h.

256  {
257  fs << "// VarBase here. Soemthing is wrong!! " << l1 << ", " << l2 << ", " << l3 << "\n";
258  }

◆ print() [2/4]

virtual void trklet::VarBase::print
inline

Definition at line 259 of file imath.h.

259  {
260  fs << "// VarBase here. Soemthing is wrong!! " << l1 << ", " << l2 << ", " << l3 << "\n";
261  }

◆ print() [3/4]

void VarCut::print ( std::map< const VarBase *, std::set< std::string > > &  cut_strings,
const int  step,
Verilog  ,
const std::map< const VarBase *, std::set< std::string > > *const  previous_cut_strings = nullptr 
) const

Definition at line 26 of file imath_Verilog.cc.

References trklet::VarBase::cut_var_, trklet::VarBase::itos(), trklet::VarBase::K(), MainPageGenerator::l, trklet::VarBase::latency(), lower_cut(), lower_cut_, trklet::VarBase::name(), trklet::VarBase::step(), AlCaHLTBitMon_QueryRunRegistry::string, upper_cut(), and upper_cut_.

Referenced by trklet::VarFlag::print().

29  {
30  int l = step - cut_var_->latency() - cut_var_->step();
32  if (l > 0)
33  name += "_delay" + itos(l);
34 
35  const int lower_cut = lower_cut_ / cut_var_->K();
36  const int upper_cut = upper_cut_ / cut_var_->K();
37  if (!previous_cut_strings || (previous_cut_strings && !previous_cut_strings->count(cut_var_))) {
38  if (!cut_strings.count(cut_var_))
39  cut_strings[cut_var_];
40  cut_strings.at(cut_var_).insert(name + " > " + itos(lower_cut) + " && " + name + " < " + itos(upper_cut));
41  }
42 }
std::string name() const
Definition: imath.h:207
VarBase * cut_var_
Definition: imath.h:309
double lower_cut_
Definition: imath.h:1090
int step() const
Definition: imath.h:250
int latency() const
Definition: imath.h:251
static std::string itos(int i)
Definition: imath.cc:16
double upper_cut() const
Definition: imath.h:1071
double K() const
Definition: imath.h:246
double upper_cut_
Definition: imath.h:1091
double lower_cut() const
Definition: imath.h:1070
step
Definition: StallMonitor.cc:98

◆ print() [4/4]

void VarCut::print ( std::map< const VarBase *, std::set< std::string > > &  cut_strings,
const int  step,
HLS  ,
const std::map< const VarBase *, std::set< std::string > > *const  previous_cut_strings = nullptr 
) const

Definition at line 23 of file imath_HLS.cc.

References cms::cuda::assert(), trklet::VarBase::cut_var_, trklet::VarBase::itos(), trklet::VarBase::K(), lower_cut(), lower_cut_, trklet::VarBase::name(), AlCaHLTBitMon_QueryRunRegistry::string, upper_cut(), and upper_cut_.

26  {
27  assert(step > -1);
29 
30  const int lower_cut = lower_cut_ / cut_var_->K();
31  const int upper_cut = upper_cut_ / cut_var_->K();
32  if (!previous_cut_strings || (previous_cut_strings && !previous_cut_strings->count(cut_var_))) {
33  if (!cut_strings.count(cut_var_))
34  cut_strings[cut_var_];
35  cut_strings.at(cut_var_).insert(name + " > " + itos(lower_cut) + " && " + name + " < " + itos(upper_cut));
36  }
37 }
std::string name() const
Definition: imath.h:207
VarBase * cut_var_
Definition: imath.h:309
assert(be >=bs)
double lower_cut_
Definition: imath.h:1090
static std::string itos(int i)
Definition: imath.cc:16
double upper_cut() const
Definition: imath.h:1071
double K() const
Definition: imath.h:246
double upper_cut_
Definition: imath.h:1091
double lower_cut() const
Definition: imath.h:1070
step
Definition: StallMonitor.cc:98

◆ set_cut_var()

void VarCut::set_cut_var ( VarBase cut_var,
const bool  call_add_cut = true 
)

Definition at line 365 of file imath.cc.

References trklet::VarBase::add_cut(), trklet::VarFlag::calculate_step(), trklet::VarBase::cut_var(), trklet::VarBase::cut_var_, and parent_flag_.

Referenced by VarCut().

365  {
366  cut_var_ = cut_var;
367  if (call_add_cut)
368  cut_var->add_cut(this, false);
369  if (parent_flag_)
371 }
VarFlag * parent_flag_
Definition: imath.h:1092
void add_cut(VarCut *cut, const bool call_set_cut_var=true)
Definition: imath.cc:359
VarBase * cut_var()
Definition: imath.cc:388
VarBase * cut_var_
Definition: imath.h:309

◆ set_parent_flag()

void VarCut::set_parent_flag ( VarFlag parent_flag,
const bool  call_add_cut 
)

Definition at line 382 of file imath.cc.

References trklet::VarFlag::add_cut(), parent_flag(), and parent_flag_.

Referenced by trklet::VarFlag::add_cut().

382  {
384  if (call_add_cut)
385  parent_flag->add_cut(this, false);
386 }
VarFlag * parent_flag_
Definition: imath.h:1092
void add_cut(VarBase *cut, const bool call_set_parent_flag=true)
Definition: imath.cc:373
VarFlag * parent_flag()
Definition: imath.h:1086

◆ upper_cut()

double trklet::VarCut::upper_cut ( ) const
inline

Definition at line 1071 of file imath.h.

References upper_cut_.

Referenced by trklet::VarBase::local_passes(), local_passes(), trklet::VarBase::passes(), print(), and trklet::VarBase::print_cuts().

1071 { return upper_cut_; }
double upper_cut_
Definition: imath.h:1091

Member Data Documentation

◆ lower_cut_

double trklet::VarCut::lower_cut_
protected

Definition at line 1090 of file imath.h.

Referenced by local_passes(), lower_cut(), and print().

◆ parent_flag_

VarFlag* trklet::VarCut::parent_flag_
protected

Definition at line 1092 of file imath.h.

Referenced by parent_flag(), set_cut_var(), and set_parent_flag().

◆ upper_cut_

double trklet::VarCut::upper_cut_
protected

Definition at line 1091 of file imath.h.

Referenced by local_passes(), print(), and upper_cut().