CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
module Class Reference

#include <vlib.h>

Inheritance diagram for module:
function

Public Member Functions

SignalAddOutReg (Signal arg)
 
void create ()
 
int getchange ()
 
Signal getswitch ()
 
Signal ifelse (Signal, Signal, Signal)
 
void init (const char *, const char *)
 
void init (const char *, const char *, module *fixt)
 
void init (const char *, const char *, int)
 
 module ()
 
Signal negedge (Signal)
 
virtual void operator() ()
 
void popswitch ()
 
Signal posedge (Signal)
 
void pushswitch (Signal arg)
 
void setchange (int c)
 
void vbeginmodule ()
 
void vendmodule ()
 
virtual ~module ()
 

Protected Attributes

int change
 
std::string instname
 
int itern
 
int oldenmarg
 
int OuterIndPos
 
Signaloutreg [1000]
 
int outregn
 
rval passn
 
void(* runperiod )()
 
Signal switcharg [10]
 
int switchn
 
moduletfixt
 

Detailed Description

Definition at line 208 of file vlib.h.

Constructor & Destructor Documentation

module::module ( )
module::~module ( )
virtual

Definition at line 999 of file vlib.cc.

References mps_fire::i, NULL, and Signal::outreg.

1000 {
1001  for (unsigned int i = 0; i < sizeof(outreg)/sizeof(Signal*); ++i)
1002  {
1003  if (outreg[i] != NULL)
1004  delete outreg[i];
1005  }
1006 
1007 }
#define NULL
Definition: scimark2.h:8
Signal * outreg[1000]
Definition: vlib.h:245
Definition: vlib.h:39

Member Function Documentation

Signal * module::AddOutReg ( Signal  arg)

Definition at line 1128 of file vlib.cc.

References Signal::geth(), Signal::getl(), NULL, Signal::outreg, Signal::reg(), Signal::setr(), and Signal::Signal().

Referenced by Signal::clock(), Signal::input(), and Signal::output().

1129 {
1130  if (outreg[outregn] == NULL)
1131  {
1132  outreg[outregn] = new Signal;
1133  outreg[outregn]->setr(0);
1134  }
1135  outreg[outregn]->reg(arg.geth(), arg.getl(), "");
1136  outregn++;
1137  return outreg[outregn - 1];
1138 }
void reg(int, int, const char *)
Definition: vlib.cc:828
void setr(rval rv)
Definition: vlib.h:66
#define NULL
Definition: scimark2.h:8
int geth()
Definition: vlib.h:64
Signal * outreg[1000]
Definition: vlib.h:245
int outregn
Definition: vlib.h:246
int getl()
Definition: vlib.h:63
void module::create ( )

Definition at line 987 of file vlib.cc.

References mps_fire::i, NULL, and Signal::outreg.

988 {
989  for (unsigned int i = 0; i < sizeof(outreg)/sizeof(Signal*); ++i) outreg[i] = NULL;
990  outregn = 0;
991  runperiod = NULL;
992 }
#define NULL
Definition: scimark2.h:8
void(* runperiod)()
Definition: vlib.h:247
Signal * outreg[1000]
Definition: vlib.h:245
int outregn
Definition: vlib.h:246
Definition: vlib.h:39
int module::getchange ( )
inline

Definition at line 230 of file vlib.h.

References Signal::change, dataset::name, and AlCaHLTBitMon_QueryRunRegistry::string.

230 {return change;}
int change
Definition: vlib.h:249
Signal module::getswitch ( )
inline

Definition at line 225 of file vlib.h.

225 {return switcharg[switchn - 1];};
int switchn
Definition: vlib.h:243
Signal switcharg[10]
Definition: vlib.h:242
Signal module::ifelse ( Signal  condition,
Signal  iftrue,
Signal  iffalse 
)

Definition at line 1140 of file vlib.cc.

References Signal::getbool(), and lumiQTWidget::t.

1141 {
1142 
1143 #ifdef VGEN
1144  Signal t;
1145  string ln;
1146  ln = "(" + condition.getname() + ") ? " + iftrue.getname() + " : " + iffalse.getname();
1147  t.setname(ln);
1148  return t;
1149 #else
1150  if (condition.getbool()) return iftrue;
1151  else return iffalse;
1152 #endif
1153 
1154 }
bool getbool()
Definition: vlib.h:70
Definition: vlib.h:39
void module::init ( const char *  mname,
const char *  iname 
)

Definition at line 1009 of file vlib.cc.

References dataset::name.

1010 {
1011 #ifdef VGEN
1012  name = mname;
1013  instname = iname;
1014 #endif
1015 }
std::string instname
Definition: vlib.h:240
void module::init ( const char *  mname,
const char *  iname,
module fixt 
)

Definition at line 1017 of file vlib.cc.

References dataset::name.

1018 {
1019 #ifdef VGEN
1020  name = mname;
1021  instname = iname;
1022 #endif
1023  tfixt = fixt;
1024 }
module * tfixt
Definition: vlib.h:248
std::string instname
Definition: vlib.h:240
void module::init ( const char *  mname,
const char *  iname,
int  index 
)

Definition at line 1027 of file vlib.cc.

References gather_cfg::cout, TauDecayModes::dec, diffTreeTool::index, dataset::name, NULL, ntuplemaker::time, and indexGen::username.

1028 {
1029 #ifdef VGEN
1030  name = mname;
1031  ostringstream instnamestream;
1032  instnamestream << iname << dec << index;
1033  instname = instnamestream.str().c_str();
1034 #endif
1035 }
std::string instname
Definition: vlib.h:240
Signal module::negedge ( Signal  arg)

Definition at line 1112 of file vlib.cc.

References Signal::getnegedge(), Signal::init(), NULL, globcontrol::setce(), Signal::setchange(), and lumiQTWidget::t.

1113 {
1114  Signal t;
1115 #ifdef VGEN
1116  string ln = "";
1117  ln = "negedge " + arg.getname();
1118  t.init(NULL, 0, 0, ln.c_str());
1119 #else
1120  t.init(NULL, 0, 0, "");
1121 #endif
1122  if (arg.getnegedge()) glc.setce(0);
1123  t.setchange(arg.getnegedge());
1124  return t;
1125 }
void init(int, int, const char *)
Definition: vlib.cc:239
globcontrol glc
Definition: vlib.cc:6
#define NULL
Definition: scimark2.h:8
void setchange(int ch)
Definition: vlib.h:74
int getnegedge()
Definition: vlib.h:72
int setce(int c)
Definition: vlib.h:312
Definition: vlib.h:39
virtual void module::operator() ( )
inlinevirtual

Definition at line 217 of file vlib.h.

References Signal::init().

217 {};
void module::popswitch ( )
inline

Definition at line 226 of file vlib.h.

226 {switchn--;}
int switchn
Definition: vlib.h:243
Signal module::posedge ( Signal  arg)

Definition at line 1097 of file vlib.cc.

References Signal::getposedge(), Signal::init(), NULL, globcontrol::setce(), Signal::setchange(), and lumiQTWidget::t.

1098 {
1099  Signal t;
1100 #ifdef VGEN
1101  string ln = "";
1102  ln = "posedge " + arg.getname();
1103  t.init(NULL, 0, 0, ln.c_str());
1104 #else
1105  t.init(NULL, 0, 0, "");
1106 #endif
1107  if (arg.getposedge()) glc.setce(0);
1108  t.setchange(arg.getposedge());
1109  return t;
1110 }
void init(int, int, const char *)
Definition: vlib.cc:239
globcontrol glc
Definition: vlib.cc:6
#define NULL
Definition: scimark2.h:8
void setchange(int ch)
Definition: vlib.h:74
int getposedge()
Definition: vlib.h:71
int setce(int c)
Definition: vlib.h:312
Definition: vlib.h:39
void module::pushswitch ( Signal  arg)
inline

Definition at line 224 of file vlib.h.

224 {switcharg[switchn] = arg; switchn++;};
A arg
Definition: Factorize.h:36
int switchn
Definition: vlib.h:243
Signal switcharg[10]
Definition: vlib.h:242
void module::setchange ( int  c)
inline

Definition at line 229 of file vlib.h.

References EnergyCorrector::c, and Signal::change.

Referenced by Signal::clock(), Signal::initreg(), Signal::input(), and Signal::wire().

229 {change = c;}
int change
Definition: vlib.h:249
void module::vbeginmodule ( )

Definition at line 1062 of file vlib.cc.

References gather_cfg::cout, corrVsCorr::filename, dataset::name, and globcontrol::setfunction().

1063 {
1064  switchn = 0;
1065 #ifdef VGEN
1066  string filename = name + ".v";
1067  cout << glc.getmargin() << name << " " << instname << std::endl << flush;
1068  cout << glc.getmargin() << "(" << glc.PrintIO(true).c_str() << std::endl << flush;
1069  cout << glc.getmargin() << ");\n" << flush;
1070  vfile.open (filename.c_str());
1071  outbuf = std::cout.rdbuf(vfile.rdbuf());
1072  OuterIndPos = glc.getpos();
1073  oldenmarg = glc.getenablemargin();
1074  glc.enablemargin(1);
1075  glc.setpos(0);
1076  PrintHeader();
1077  cout << glc.getmargin() << "module " << name << std::endl << glc.getmargin() << "(" << flush;
1078  glc.setfunction(0);
1079  glc.Print();
1080  glc.setFileOpen(1);
1081 #endif
1082 }
globcontrol glc
Definition: vlib.cc:6
int switchn
Definition: vlib.h:243
int oldenmarg
Definition: vlib.h:244
int OuterIndPos
Definition: vlib.h:241
void setfunction(int i)
Definition: vlib.h:309
std::string instname
Definition: vlib.h:240
void module::vendmodule ( )

Definition at line 1084 of file vlib.cc.

References gather_cfg::cout.

1085 {
1086 #ifdef VGEN
1087  glc.Outdent();
1088  cout << glc.getmargin() << "endmodule\n" << flush;
1089  glc.setpos(OuterIndPos);
1090  cout.rdbuf(outbuf);
1091  vfile.close();
1092  glc.enablemargin(oldenmarg);
1093 #endif
1094  outregn = 0;
1095 }
globcontrol glc
Definition: vlib.cc:6
int oldenmarg
Definition: vlib.h:244
int OuterIndPos
Definition: vlib.h:241
int outregn
Definition: vlib.h:246

Member Data Documentation

int module::change
protected

Definition at line 249 of file vlib.h.

std::string module::instname
protected

Definition at line 240 of file vlib.h.

int module::itern
protected

Definition at line 250 of file vlib.h.

int module::oldenmarg
protected

Definition at line 244 of file vlib.h.

int module::OuterIndPos
protected

Definition at line 241 of file vlib.h.

Signal* module::outreg[1000]
protected

Definition at line 245 of file vlib.h.

int module::outregn
protected

Definition at line 246 of file vlib.h.

rval module::passn
protected

Definition at line 251 of file vlib.h.

void(* module::runperiod) ()
protected

Definition at line 247 of file vlib.h.

Signal module::switcharg[10]
protected

Definition at line 242 of file vlib.h.

int module::switchn
protected

Definition at line 243 of file vlib.h.

module* module::tfixt
protected

Definition at line 248 of file vlib.h.