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 ()
 
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 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
 
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 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 ()
 
bool calculate (int debug_level)
 
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, 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_all (std::ofstream &fs, HLS)
 
void print_all (std::ofstream &fs, Verilog)
 
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_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_step (int step, std::ofstream &fs, HLS)
 
void print_step (int step, std::ofstream &fs, Verilog)
 
void print_truncation (std::string &t, const std::string &o1, const int ps, HLS) const
 
void print_truncation (std::string &t, const std::string &o1, const int ps, Verilog) 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 (std::vector< VarBase * > v, std::ofstream &fs, HLS)
 
static void design_print (std::vector< VarBase * > v, std::ofstream &fs, Verilog)
 
static void hls_print (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 (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.

1057  : VarBase(globals, "", nullptr, nullptr, nullptr, 0),
1060  parent_flag_(nullptr) {
1061  op_ = "cut";
1062  }

References trklet::VarBase::op_.

◆ 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.

1065  : VarCut(globals, lower_cut, upper_cut) {
1067  }

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

◆ ~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.

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 }

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().

◆ lower_cut()

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

◆ parent_flag()

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

Definition at line 1086 of file imath.h.

1086 { return parent_flag_; }

References parent_flag_.

Referenced by set_parent_flag().

◆ print() [1/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.

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 }

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_.

◆ print() [2/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.

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 }

References trklet::VarBase::cut_var_, trklet::VarBase::itos(), trklet::VarBase::K(), cmsLHEtoEOSManager::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().

◆ print() [3/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() [4/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  }

◆ 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.

365  {
366  cut_var_ = cut_var;
367  if (call_add_cut)
368  cut_var->add_cut(this, false);
369  if (parent_flag_)
371 }

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

Referenced by VarCut().

◆ set_parent_flag()

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

Definition at line 382 of file imath.cc.

382  {
384  if (call_add_cut)
385  parent_flag->add_cut(this, false);
386 }

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

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

◆ upper_cut()

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

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().

trklet::VarCut::upper_cut
double upper_cut() const
Definition: imath.h:1071
trklet::VarFlag::calculate_step
void calculate_step()
Definition: imath_calculate.cc:81
trklet::VarBase::name
std::string name() const
Definition: imath.h:207
step
step
Definition: StallMonitor.cc:94
trklet::VarBase::cut_var
VarBase * cut_var()
Definition: imath.cc:388
trklet::VarCut::upper_cut_
double upper_cut_
Definition: imath.h:1091
trklet::VarBase::add_cut
void add_cut(VarCut *cut, const bool call_set_cut_var=true)
Definition: imath.cc:359
trklet::VarBase::cut_var_
VarBase * cut_var_
Definition: imath.h:309
cms::cuda::assert
assert(be >=bs)
trklet::VarCut::VarCut
VarCut(imathGlobals *globals, double lower_cut, double upper_cut)
Definition: imath.h:1056
trklet::VarBase::VarBase
VarBase(imathGlobals *globals, std::string name, VarBase *p1, VarBase *p2, VarBase *p3, int l)
Definition: imath.h:161
trklet::VarCut::lower_cut
double lower_cut() const
Definition: imath.h:1070
trklet::VarBase::passes
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
trklet::VarCut::parent_flag
VarFlag * parent_flag()
Definition: imath.h:1086
trklet::VarBase::op_
std::string op_
Definition: imath.h:300
trklet::VarBase::step
int step() const
Definition: imath.h:250
trklet::VarCut::set_cut_var
void set_cut_var(VarBase *cut_var, const bool call_add_cut=true)
Definition: imath.cc:365
trklet::VarBase::latency
int latency() const
Definition: imath.h:251
trklet::VarBase::itos
static std::string itos(int i)
Definition: imath.cc:16
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
trklet::VarCut::parent_flag_
VarFlag * parent_flag_
Definition: imath.h:1092
trklet::VarBase::K
double K() const
Definition: imath.h:246
trklet::VarFlag::add_cut
void add_cut(VarBase *cut, const bool call_set_parent_flag=true)
Definition: imath.cc:373
trklet::VarBase::ival
long int ival() const
Definition: imath.h:213
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
trklet::VarCut::lower_cut_
double lower_cut_
Definition: imath.h:1090