CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 198 of file vlib.h.

Constructor & Destructor Documentation

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

Definition at line 915 of file vlib.cc.

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

915  {
916  for (unsigned int i = 0; i < sizeof(outreg) / sizeof(Signal*); ++i) {
917  if (outreg[i] != nullptr)
918  delete outreg[i];
919  }
920 }
Signal * outreg[1000]
Definition: vlib.h:237
Definition: vlib.h:28

Member Function Documentation

Signal * module::AddOutReg ( Signal  arg)

Definition at line 1034 of file vlib.cc.

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

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

1034  {
1035  if (outreg[outregn] == nullptr) {
1036  outreg[outregn] = new Signal;
1037  outreg[outregn]->setr(0);
1038  }
1039  outreg[outregn]->reg(arg.geth(), arg.getl(), "");
1040  outregn++;
1041  return outreg[outregn - 1];
1042 }
void reg(int, int, const char *)
Definition: vlib.cc:756
void setr(rval rv)
Definition: vlib.h:57
int geth()
Definition: vlib.h:55
Signal * outreg[1000]
Definition: vlib.h:237
int outregn
Definition: vlib.h:238
int getl()
Definition: vlib.h:54
void module::create ( )

Definition at line 906 of file vlib.cc.

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

906  {
907  for (unsigned int i = 0; i < sizeof(outreg) / sizeof(Signal*); ++i)
908  outreg[i] = nullptr;
909  outregn = 0;
910  runperiod = nullptr;
911 }
void(* runperiod)()
Definition: vlib.h:239
Signal * outreg[1000]
Definition: vlib.h:237
int outregn
Definition: vlib.h:238
Definition: vlib.h:28
int module::getchange ( )
inline

Definition at line 222 of file vlib.h.

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

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

Definition at line 217 of file vlib.h.

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

Definition at line 1044 of file vlib.cc.

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

1044  {
1045 #ifdef VGEN
1046  Signal t;
1047  string ln;
1048  ln = "(" + condition.getname() + ") ? " + iftrue.getname() + " : " + iffalse.getname();
1049  t.setname(ln);
1050  return t;
1051 #else
1052  if (condition.getbool())
1053  return iftrue;
1054  else
1055  return iffalse;
1056 #endif
1057 }
bool getbool()
Definition: vlib.h:65
Definition: vlib.h:28
void module::init ( const char *  mname,
const char *  iname 
)

Definition at line 922 of file vlib.cc.

References Skims_PA_cff::name.

922  {
923 #ifdef VGEN
924  name = mname;
925  instname = iname;
926 #endif
927 }
std::string instname
Definition: vlib.h:232
void module::init ( const char *  mname,
const char *  iname,
module fixt 
)

Definition at line 929 of file vlib.cc.

References Skims_PA_cff::name.

929  {
930 #ifdef VGEN
931  name = mname;
932  instname = iname;
933 #endif
934  tfixt = fixt;
935 }
module * tfixt
Definition: vlib.h:240
std::string instname
Definition: vlib.h:232
void module::init ( const char *  mname,
const char *  iname,
int  index 
)

Definition at line 937 of file vlib.cc.

References gather_cfg::cout, TauDecayModes::dec, Skims_PA_cff::name, NULL, ntuplemaker::time, and personalPlayback::username.

937  {
938 #ifdef VGEN
939  name = mname;
940  ostringstream instnamestream;
941  instnamestream << iname << dec << index;
942  instname = instnamestream.str().c_str();
943 #endif
944 }
std::string instname
Definition: vlib.h:232
Signal module::negedge ( Signal  arg)

Definition at line 1019 of file vlib.cc.

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

1019  {
1020  Signal t;
1021 #ifdef VGEN
1022  string ln = "";
1023  ln = "negedge " + arg.getname();
1024  t.init(NULL, 0, 0, ln.c_str());
1025 #else
1026  t.init(nullptr, 0, 0, "");
1027 #endif
1028  if (arg.getnegedge())
1029  glc.setce(0);
1030  t.setchange(arg.getnegedge());
1031  return t;
1032 }
void init(int, int, const char *)
Definition: vlib.cc:208
globcontrol glc
Definition: vlib.cc:5
#define NULL
Definition: scimark2.h:8
void setchange(int ch)
Definition: vlib.h:69
int getnegedge()
Definition: vlib.h:67
int setce(int c)
Definition: vlib.h:341
Definition: vlib.h:28
virtual void module::operator() ( )
inlinevirtual

Definition at line 206 of file vlib.h.

References Signal::init().

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

Definition at line 218 of file vlib.h.

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

Definition at line 1004 of file vlib.cc.

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

1004  {
1005  Signal t;
1006 #ifdef VGEN
1007  string ln = "";
1008  ln = "posedge " + arg.getname();
1009  t.init(NULL, 0, 0, ln.c_str());
1010 #else
1011  t.init(nullptr, 0, 0, "");
1012 #endif
1013  if (arg.getposedge())
1014  glc.setce(0);
1015  t.setchange(arg.getposedge());
1016  return t;
1017 }
void init(int, int, const char *)
Definition: vlib.cc:208
globcontrol glc
Definition: vlib.cc:5
#define NULL
Definition: scimark2.h:8
void setchange(int ch)
Definition: vlib.h:69
int getposedge()
Definition: vlib.h:66
int setce(int c)
Definition: vlib.h:341
Definition: vlib.h:28
void module::pushswitch ( Signal  arg)
inline

Definition at line 213 of file vlib.h.

213  {
214  switcharg[switchn] = arg;
215  switchn++;
216  };
A arg
Definition: Factorize.h:36
int switchn
Definition: vlib.h:235
Signal switcharg[10]
Definition: vlib.h:234
void module::setchange ( int  c)
inline
void module::vbeginmodule ( )

Definition at line 971 of file vlib.cc.

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

971  {
972  switchn = 0;
973 #ifdef VGEN
974  string filename = name + ".v";
975  cout << glc.getmargin() << name << " " << instname << std::endl << flush;
976  cout << glc.getmargin() << "(" << glc.PrintIO(true).c_str() << std::endl << flush;
977  cout << glc.getmargin() << ");\n" << flush;
978  vfile.open(filename.c_str());
979  outbuf = std::cout.rdbuf(vfile.rdbuf());
980  OuterIndPos = glc.getpos();
981  oldenmarg = glc.getenablemargin();
982  glc.enablemargin(1);
983  glc.setpos(0);
984  PrintHeader();
985  cout << glc.getmargin() << "module " << name << std::endl << glc.getmargin() << "(" << flush;
986  glc.setfunction(0);
987  glc.Print();
988  glc.setFileOpen(1);
989 #endif
990 }
globcontrol glc
Definition: vlib.cc:5
int switchn
Definition: vlib.h:235
int oldenmarg
Definition: vlib.h:236
int OuterIndPos
Definition: vlib.h:233
void setfunction(int i)
Definition: vlib.h:334
std::string instname
Definition: vlib.h:232
void module::vendmodule ( )

Definition at line 992 of file vlib.cc.

References gather_cfg::cout.

992  {
993 #ifdef VGEN
994  glc.Outdent();
995  cout << glc.getmargin() << "endmodule\n" << flush;
996  glc.setpos(OuterIndPos);
997  cout.rdbuf(outbuf);
998  vfile.close();
999  glc.enablemargin(oldenmarg);
1000 #endif
1001  outregn = 0;
1002 }
globcontrol glc
Definition: vlib.cc:5
int oldenmarg
Definition: vlib.h:236
int OuterIndPos
Definition: vlib.h:233
int outregn
Definition: vlib.h:238

Member Data Documentation

int module::change
protected

Definition at line 241 of file vlib.h.

std::string module::instname
protected

Definition at line 232 of file vlib.h.

int module::itern
protected

Definition at line 242 of file vlib.h.

int module::oldenmarg
protected

Definition at line 236 of file vlib.h.

int module::OuterIndPos
protected

Definition at line 233 of file vlib.h.

Signal* module::outreg[1000]
protected

Definition at line 237 of file vlib.h.

int module::outregn
protected

Definition at line 238 of file vlib.h.

rval module::passn
protected

Definition at line 243 of file vlib.h.

void(* module::runperiod) ()
protected

Definition at line 239 of file vlib.h.

Signal module::switcharg[10]
protected

Definition at line 234 of file vlib.h.

int module::switchn
protected

Definition at line 235 of file vlib.h.

module* module::tfixt
protected

Definition at line 240 of file vlib.h.