CMS 3D CMS Logo

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

#include <FWCore/ServiceRegistry/interface/Signal.h>

Inheritance diagram for Signal:
parameter

Public Member Functions

Signal asgn (Signal)
 
void clock (const char *rname)
 
void create ()
 
int getalwaysn ()
 
bool getbool ()
 
int getchange ()
 
int geth ()
 
int getint ()
 
int getl ()
 
rval getmask ()
 
int getnegedge ()
 
int getposedge ()
 
rval getr ()
 
rval getval ()
 
void init (int, int, const char *)
 
void init (const char *rname)
 
void init (Signal *shost, int h, int l, const char *rname)
 
void initreg (int, int, const char *)
 
void inout (int, int, const char *)
 
void inout (const char *rname)
 
void input (int, int, const char *)
 
void input (const char *rname)
 
void makemask ()
 
Signal operator! ()
 
Signal operator!= (Signal)
 
Signal operator% (Signal)
 
Signal operator& (Signal)
 
Signaloperator& ()
 
Signal operator&& (Signal)
 
Signal operator() (Signal, Signal)
 
Signal operator() (Signal)
 
Signal operator* (Signal)
 
Signal operator+ (Signal)
 
Signal operator++ ()
 
Signal operator++ (int)
 
Signal operator, (Signal)
 
Signal operator- (Signal)
 
Signal operator-- ()
 
Signal operator-- (int)
 
Signal operator/ (Signal)
 
Signal operator< (Signal)
 
Signal operator<< (Signal)
 
Signal operator<= (Signal)
 
Signal operator= (Signal)
 
Signal operator== (Signal)
 
Signal operator> (Signal)
 
Signal operator>= (Signal)
 
Signal operator>> (Signal)
 
Signal operator^ (Signal)
 
Signal operator| (Signal)
 
Signal operator|| (Signal)
 
Signal operator~ ()
 
void output (int, int, const char *)
 
void output (const char *rname)
 
void output (int high, int low, const char *rname, module *parent)
 
void output (const char *rname, module *parent)
 
void reg (int, int, const char *)
 
void reg (const char *rname)
 
Signal set (Signal)
 
void setalwaysn (int n)
 
void setchange (int ch)
 
void sethlmask (int high, int low, rval imask)
 
void setnegedge (int ch)
 
void setposedge (int ch)
 
void setprintable (int p)
 
void setr (rval rv)
 
void setrc (rval rv)
 
 Signal ()
 
 Signal (rval)
 
 Signal (int)
 
 Signal (unsigned int)
 
 Signal (const char *)
 
 Signal (int bits, rval value)
 
void wire (int, int, const char *)
 
void wire (int, int, const char *, int)
 
void wire (const char *rname)
 

Protected Attributes

int alwaysn
 
Signalca1
 
Signalca2
 
int change
 
int h
 
Signalhost
 
int hostl
 
int inited
 
int l
 
rval mask
 
int mode
 
int nedge
 
Signalouthost
 
Signaloutreg
 
int pedge
 
int printable
 
rval r
 
rval rc
 
Signalsource
 

Friends

std::ostream & operator<< (std::ostream &stream, Signal s)
 
Signal rand (Signal)
 
Signal ror (Signal)
 
Signal rxor (Signal)
 

Detailed Description

Description: A simple implementation of the signal/slot pattern

Usage: This is a simple version of the signal/slot pattern and is used by the Framework. It is safe to call 'emit' from multiple threads simultaneously. Assumptions: -The attached slots have a life-time greater than the last 'emit' call issued from the Signal. -'connect' is not called simultaneously with any other methods of the class.

Definition at line 39 of file vlib.h.

Constructor & Destructor Documentation

Signal::Signal ( )

Definition at line 43 of file vlib.cc.

References create().

Referenced by module::AddOutReg(), and setprintable().

44 {
45  create();
46 }
void create()
Definition: vlib.cc:25
Signal::Signal ( rval  n)

Definition at line 184 of file vlib.cc.

References create(), TauDecayModes::dec, init(), inited, mnum, mode, gen::n, r, rc, and Sizeofrval.

185 {
186  create();
187  mode = mnum;
188 #ifdef VGEN
189  ostringstream ln;
190  ln << dec << n;
191  init (8*Sizeofrval - 1, 0, ln.str().c_str());
192 #else
193  init (8*Sizeofrval - 1, 0, "");
194 #endif
195  inited = 0;
196  rc = n;
197  r = n;
198 }
rval r
Definition: vlib.h:144
void init(int, int, const char *)
Definition: vlib.cc:239
int inited
Definition: vlib.h:168
Definition: vlib.h:35
#define Sizeofrval
Definition: vlib.h:23
void create()
Definition: vlib.cc:25
rval rc
Definition: vlib.h:149
int mode
Definition: vlib.h:170
Signal::Signal ( int  n)

Definition at line 200 of file vlib.cc.

References create(), TauDecayModes::dec, init(), inited, mnum, mode, gen::n, r, rc, and Sizeofrval.

201 {
202  create();
203  mode = mnum;
204 #ifdef VGEN
205  ostringstream ln;
206  ln << dec << n;
207  init (Sizeofrval * 8 - 1, 0, ln.str().c_str());
208 #else
209  init (Sizeofrval * 8 - 1, 0, "");
210 #endif
211  inited = 0;
212  r = (rval)n;
213  rc = r;
214 }
rval r
Definition: vlib.h:144
void init(int, int, const char *)
Definition: vlib.cc:239
int inited
Definition: vlib.h:168
Definition: vlib.h:35
#define Sizeofrval
Definition: vlib.h:23
void create()
Definition: vlib.cc:25
unsigned long long int rval
Definition: vlib.h:22
rval rc
Definition: vlib.h:149
int mode
Definition: vlib.h:170
Signal::Signal ( unsigned int  n)

Definition at line 216 of file vlib.cc.

References create(), TauDecayModes::dec, init(), inited, mnum, mode, gen::n, r, rc, and Sizeofrval.

217 {
218  create();
219  mode = mnum;
220 #ifdef VGEN
221  ostringstream ln;
222  ln << dec << n;
223  init (Sizeofrval * 8 - 1, 0, ln.str().c_str());
224 #else
225  init (Sizeofrval * 8 - 1, 0, "");
226 #endif
227  inited = 0;
228  r = (rval)n;
229  rc = r;
230 }
rval r
Definition: vlib.h:144
void init(int, int, const char *)
Definition: vlib.cc:239
int inited
Definition: vlib.h:168
Definition: vlib.h:35
#define Sizeofrval
Definition: vlib.h:23
void create()
Definition: vlib.cc:25
unsigned long long int rval
Definition: vlib.h:22
rval rc
Definition: vlib.h:149
int mode
Definition: vlib.h:170
Signal::Signal ( const char *  sval)

Definition at line 61 of file vlib.cc.

References bits, create(), mps_fire::i, init(), mask, mnum, mode, r, rc, AlCaHLTBitMon_QueryRunRegistry::string, heppy_batch::val, and relativeConstraints::value.

62 {
63  create();
64  mode = mnum;
65  std::string val = sval;
66  int bits;
67  unsigned int i;
68  char radix;
69  rval value = 0;
70  int dig;
71 
72  sscanf(val.c_str(), "%d'%c", &bits, &radix);
73  switch (radix)
74  {
75  case 'h':
76  case 'H':
77 // sscanf (val.c_str(), "%d'%c%x", &bits, &radix, &value);
78  for (i = 0; val[i] != 'h' && val[i] != 'H'; ++i);
79  for (; i < val.length(); ++i)
80  {
81  switch (val[i])
82  {
83  case '0':
84  case '1':
85  case '2':
86  case '3':
87  case '4':
88  case '5':
89  case '6':
90  case '7':
91  case '8':
92  case '9':
93  dig = val[i] - '0';
94  break;
95  case 'a':
96  case 'b':
97  case 'c':
98  case 'd':
99  case 'e':
100  case 'f':
101  dig = val[i] - 'a' + 10;
102  break;
103  case 'A':
104  case 'B':
105  case 'C':
106  case 'D':
107  case 'E':
108  case 'F':
109  dig = val[i] - 'A' + 10;
110  break;
111  default:
112  dig = -1;
113  break;
114  }
115  if (dig >= 0)
116  {
117  value = value << 4;
118  value = value | dig;
119  }
120  }
121 
122 
123  break;
124  case 'd':
125  case 'D':
126  sscanf (val.c_str(), "%d'%c%d", &bits, &radix, reinterpret_cast<int *>(&value));
127  break;
128  case 'o':
129  case 'O':
130 // sscanf (val.c_str(), "%d'%c%o", &bits, &radix, &value);
131  for (i = 0; val[i] != 'o' && val[i] != 'O'; ++i);
132  for (; i < val.length(); ++i)
133  {
134  switch (val[i])
135  {
136  case '0':
137  case '1':
138  case '2':
139  case '3':
140  case '4':
141  case '5':
142  case '6':
143  case '7':
144  dig = val[i] - '0';
145  break;
146  default:
147  dig = -1;
148  break;
149  }
150  if (dig >= 0)
151  {
152  value = value << 3;
153  value = value | dig;
154  }
155  }
156 
157  break;
158 
159  case 'b':
160  case 'B':
161 
162  for (i = 0; val[i] != 'b' && val[i] != 'B'; ++i);
163  for (; i < val.length(); ++i)
164  {
165  switch (val[i])
166  {
167  case '0':
168  value = value << 1;
169  break;
170  case '1':
171  value = value << 1;
172  value = value | 1;
173  break;
174  }
175  }
176  break;
177  }
178  Signal::init(bits - 1, 0, val.c_str());
179  rc = value & mask;
180  r = rc;
181 
182 }
rval mask
Definition: vlib.h:152
rval r
Definition: vlib.h:144
void init(int, int, const char *)
Definition: vlib.cc:239
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
Definition: vlib.h:35
void create()
Definition: vlib.cc:25
Definition: value.py:1
unsigned long long int rval
Definition: vlib.h:22
rval rc
Definition: vlib.h:149
int mode
Definition: vlib.h:170
Signal::Signal ( int  bits,
rval  value 
)

Definition at line 48 of file vlib.cc.

References create(), TauDecayModes::dec, init(), mask, r, rc, and relativeConstraints::value.

49 {
50  create();
51 #ifdef VGEN
52  ostringstream sval;
53  sval << dec << bits << "'d" << value;
54  Signal::init(bits - 1, 0, sval.str().c_str());
55 #else
56  Signal::init(bits - 1, 0, "");
57 #endif
58  r = rc = value & mask;
59 }
rval mask
Definition: vlib.h:152
rval r
Definition: vlib.h:144
void init(int, int, const char *)
Definition: vlib.cc:239
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
void create()
Definition: vlib.cc:25
rval rc
Definition: vlib.h:149

Member Function Documentation

Signal Signal::asgn ( Signal  other)

Definition at line 533 of file vlib.cc.

References ca1, ca2, change, gather_cfg::cout, globcontrol::getalwaysn(), getl(), getval(), h, host, hostl, AnalysisDataFormats_SUSYBSMObjects::hr, l, mask, minout, mode, moutput, dataset::name, nedge, outhost, outreg, pedge, r, rc, set(), setalwaysn(), globcontrol::setchange(), and protons_cff::t.

Referenced by operator=(), set(), and setprintable().

534 {
535  Signal t;
536 
537 #ifdef VGEN
538  t.name = lb + name + rb + " = " + other.getcatname();
539  if (glc.printassign()) std::cout << glc.getmargin() << t.name << ";\n" << flush;
540 #endif
541  rval hr, portionr, portionmask, otr;
542  int shn;
543 
544  otr = other.getval() & mask;
545 
546  if (otr != r)
547  {
549  glc.setchange(1);
550  }
551 
552  rc = otr;
553  if (host) // is this a portion of the other register?
554  {
555  hr = host->rc;
556  if (hostl > 0) shn = (hostl - host->getl());
557  else shn = (l - host->getl());
558  portionr = rc << shn;
559  portionmask = mask << shn;
560  host->set((hr & (~portionmask)) | portionr);
561  }
562 
563  if (ca1 != nullptr && ca2 != nullptr) // is this a concatenation of the two registers?
564  {
565  ca2->set(other);
566  ca1->set(other >> (ca2->h - ca2->l + 1));
567  }
568  if (outhost != nullptr && outhost != this && (mode == moutput || mode == minout))
569  {
570  outhost->set(other);
571  }
572  if (outreg)
573  {
574  outreg->set(other);
575  }
576 
577  t.h = h;
578  t.l = l;
579  t.mask = mask;
580  t.pedge = pedge;
581  t.nedge = nedge;
582  t.change = change;
583  t.r = rc;
584 #ifdef VGEN
585  glc.setprintassign(1);
586 #endif
587  return t;
588 }
rval mask
Definition: vlib.h:152
rval r
Definition: vlib.h:144
Signal * outhost
Definition: vlib.h:165
int pedge
Definition: vlib.h:163
Signal set(Signal)
Definition: vlib.cc:525
Definition: vlib.h:34
rval getval()
Definition: vlib.cc:481
Signal * ca1
Definition: vlib.h:161
globcontrol glc
Definition: vlib.cc:6
int getalwaysn()
Definition: vlib.h:303
int hostl
Definition: vlib.h:151
int h
Definition: vlib.h:150
int nedge
Definition: vlib.h:163
susybsm::HSCParticleRef hr
Definition: classes.h:26
Definition: vlib.h:33
void setchange(int i)
Definition: vlib.cc:1324
int l
Definition: vlib.h:150
unsigned long long int rval
Definition: vlib.h:22
void setalwaysn(int n)
Definition: vlib.h:77
Signal * host
Definition: vlib.h:160
rval rc
Definition: vlib.h:149
Signal * outreg
Definition: vlib.h:166
int mode
Definition: vlib.h:170
Signal * ca2
Definition: vlib.h:162
int getl()
Definition: vlib.h:63
int change
Definition: vlib.h:163
Definition: vlib.h:39
void Signal::clock ( const char *  rname)

Definition at line 677 of file vlib.cc.

References module::AddOutReg(), change, dbgmsg, TauDecayModes::dec, globcontrol::getparent(), h, host, init(), inited, l, minput, mode, dataset::name, nedge, obnames, outhost, outreg, pedge, printable, r, rc, module::setchange(), setr(), and setrc().

Referenced by input().

678 {
679 #ifdef VGEN
680  if (lb == "{") glc.AddIO(lb + name + rb);
681  else glc.AddIO(name);
682 #else
683 #ifdef _VDEBUG
684  if (h-l != 0 && inited) // inited is analysed in case the passed parameter is a temp var. Actually, every operator should return temp with the proper mask,h,l inherited from operands
685  {
686  dbgmsg("Different port length for clock argument: declared [" << 0 << ":" << 0 << "], passed: [" << h << ":" << l <<"]. ");
687  }
688 #endif
689 #endif
690  Signal::init(0, 0, rname);
691  h = l = 0;
692  mode = minput;
693 #ifdef VGEN
694  obname = obnames[mode];
695  ostringstream ln;
696  glc.AddParameter(name);
697  if (h == l) ln << obname << name << ";\n";
698  else ln << obname << "[" << dec << h << ":" << l << "] " << name << ";\n";
699  glc.AddDeclarator(ln.str());
700  printable = 0;
701 #else
702  outreg = glc.getparent()->AddOutReg((Signal)(*this));
703  if (rc != r)
704  {
705  change = 1;
706  glc.getparent()->setchange(1);
707  if (rc == 1 && r == 0) pedge = 1; else pedge = 0;
708  if (rc == 0 && r == 1) nedge = 1; else nedge = 0;
709  }
710  else change = pedge = nedge = 0;
711  outreg->setr(r);
712  outreg->setrc(r);
713  outhost = host = nullptr;
714 #endif
715 
716 }
rval r
Definition: vlib.h:144
void init(int, int, const char *)
Definition: vlib.cc:239
Signal * outhost
Definition: vlib.h:165
void setr(rval rv)
Definition: vlib.h:66
int pedge
Definition: vlib.h:163
globcontrol glc
Definition: vlib.cc:6
char const * obnames[]
Definition: vlib.cc:8
int inited
Definition: vlib.h:168
void setrc(rval rv)
Definition: vlib.h:67
void setchange(int c)
Definition: vlib.h:229
#define dbgmsg(a)
Definition: vlib.cc:21
int h
Definition: vlib.h:150
int nedge
Definition: vlib.h:163
Definition: vlib.h:32
Signal * AddOutReg(Signal arg)
Definition: vlib.cc:1128
int printable
Definition: vlib.h:169
int l
Definition: vlib.h:150
Signal * host
Definition: vlib.h:160
module * getparent()
Definition: vlib.h:308
rval rc
Definition: vlib.h:149
Signal * outreg
Definition: vlib.h:166
int mode
Definition: vlib.h:170
int change
Definition: vlib.h:163
Definition: vlib.h:39
void Signal::create ( )

Definition at line 25 of file vlib.cc.

References alwaysn, ca1, ca2, change, h, host, hostl, inited, l, mask, mode, dataset::name, nedge, outhost, outreg, pedge, printable, r, rc, and Sizeofrval.

Referenced by module::module(), and Signal().

26 {
27 #ifdef VGEN
28  name = "";
29  orname = "";
30  obname = "";
31  lb = "(";
32  rb = ")";
33 #endif
34 
35  outhost = host = outreg = ca1 = ca2 = nullptr;
36  inited = printable = r = rc = l = pedge = nedge = change = alwaysn = mode = 0;
37  h = 8*Sizeofrval - 1;
38  mask = (rval)(- 1);
39  hostl = -1;
40 
41 }
rval mask
Definition: vlib.h:152
rval r
Definition: vlib.h:144
Signal * outhost
Definition: vlib.h:165
int pedge
Definition: vlib.h:163
Signal * ca1
Definition: vlib.h:161
int hostl
Definition: vlib.h:151
int inited
Definition: vlib.h:168
int h
Definition: vlib.h:150
int nedge
Definition: vlib.h:163
#define Sizeofrval
Definition: vlib.h:23
int printable
Definition: vlib.h:169
int l
Definition: vlib.h:150
unsigned long long int rval
Definition: vlib.h:22
Signal * host
Definition: vlib.h:160
rval rc
Definition: vlib.h:149
Signal * outreg
Definition: vlib.h:166
int alwaysn
Definition: vlib.h:167
int mode
Definition: vlib.h:170
Signal * ca2
Definition: vlib.h:162
int change
Definition: vlib.h:163
int Signal::getalwaysn ( )
inline

Definition at line 78 of file vlib.h.

References alwaysn.

Referenced by getval().

78 {return alwaysn;};
int alwaysn
Definition: vlib.h:167
bool Signal::getbool ( )
inline

Definition at line 70 of file vlib.h.

References getval().

Referenced by module::ifelse().

70 {return (getval() != 0);};
rval getval()
Definition: vlib.cc:481
int Signal::getchange ( )
inline

Definition at line 73 of file vlib.h.

References change.

Referenced by output().

73 {return change;};
int change
Definition: vlib.h:163
int Signal::geth ( )
inline

Definition at line 64 of file vlib.h.

References h.

Referenced by module::AddOutReg().

64 {return h;};
int h
Definition: vlib.h:150
int Signal::getint ( )
inline

Definition at line 62 of file vlib.h.

References r.

62 {return (unsigned int)r;};
rval r
Definition: vlib.h:144
int Signal::getl ( )
inline

Definition at line 63 of file vlib.h.

References l.

Referenced by module::AddOutReg(), asgn(), and init().

63 {return l;};
int l
Definition: vlib.h:150
rval Signal::getmask ( )
inline

Definition at line 65 of file vlib.h.

References mask.

Referenced by input().

65 {return mask;};
rval mask
Definition: vlib.h:152
int Signal::getnegedge ( )
inline

Definition at line 72 of file vlib.h.

References nedge.

Referenced by module::negedge(), and output().

72 {return nedge;};
int nedge
Definition: vlib.h:163
int Signal::getposedge ( )
inline

Definition at line 71 of file vlib.h.

References pedge.

Referenced by output(), and module::posedge().

71 {return pedge;};
int pedge
Definition: vlib.h:163
rval Signal::getr ( )
inline

Definition at line 61 of file vlib.h.

References r.

Referenced by init(), input(), operator<<(), parameter::operator=(), and output().

61 {return r;};
rval r
Definition: vlib.h:144
rval Signal::getval ( )

Definition at line 481 of file vlib.cc.

References getalwaysn(), globcontrol::getalwaysn(), r, and rc.

Referenced by asgn(), getbool(), operator()(), operator,(), memory::operator[](), operator||(), rand(), rxor(), and setprintable().

482 {
483  return (getalwaysn() == glc.getalwaysn()) ? rc : r;
484 }
rval r
Definition: vlib.h:144
globcontrol glc
Definition: vlib.cc:6
int getalwaysn()
Definition: vlib.h:303
int getalwaysn()
Definition: vlib.h:78
rval rc
Definition: vlib.h:149
void Signal::init ( int  high,
int  low,
const char *  rname 
)

Definition at line 239 of file vlib.cc.

References h, inited, l, makemask(), dataset::name, and source.

Referenced by clock(), function::function(), init(), parameter::init(), initreg(), inout(), input(), module::negedge(), parameter::operator int(), operator()(), module::operator()(), operator,(), operator||(), output(), module::posedge(), rand(), ror(), rxor(), Signal(), and wire().

240 {
241 
242 #ifdef VGEN
243  name = rname;
244  orname = rname;
245  lb = "";
246  rb = "";
247 #endif
248  if (!inited)
249  {
250  h = high;
251  l = low;
252  makemask();
253  inited = 1;
254  }
255  source = this;
256 }
void makemask()
Definition: vlib.cc:232
int inited
Definition: vlib.h:168
int h
Definition: vlib.h:150
int l
Definition: vlib.h:150
Signal * source
Definition: vlib.h:164
void Signal::init ( const char *  rname)
inline

Definition at line 50 of file vlib.h.

References plotscripts::getname(), h, init(), l, makemask(), dataset::name, r, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by init().

50 {init(0, 0, rname);};
void init(int, int, const char *)
Definition: vlib.cc:239
void Signal::init ( Signal shost,
int  h,
int  l,
const char *  rname 
)

Definition at line 258 of file vlib.cc.

References change, getl(), getr(), h, host, l, makemask(), mask, dataset::name, nedge, pedge, r, rc, and source.

259 {
260  host = shost;
261 #ifdef VGEN
262  name = rname;
263  orname = rname;
264  lb = "";
265  rb = "";
266 #endif
267  h = high;
268  l = low;
269  makemask();
270  source = this;
271  if (host)
272  {
273  rc = (host->getr() >> (l - host->getl())) & mask;
274  r = rc;
275  }
276  change = pedge = nedge = 0;
277 }
rval mask
Definition: vlib.h:152
rval r
Definition: vlib.h:144
int pedge
Definition: vlib.h:163
void makemask()
Definition: vlib.cc:232
rval getr()
Definition: vlib.h:61
int h
Definition: vlib.h:150
int nedge
Definition: vlib.h:163
int l
Definition: vlib.h:150
Signal * source
Definition: vlib.h:164
Signal * host
Definition: vlib.h:160
rval rc
Definition: vlib.h:149
int getl()
Definition: vlib.h:63
int change
Definition: vlib.h:163
void Signal::initreg ( int  high,
int  low,
const char *  rname 
)

Definition at line 837 of file vlib.cc.

References change, globcontrol::getparent(), init(), mode, mreg, nedge, obnames, pedge, r, rc, and module::setchange().

Referenced by inout(), and reg().

838 {
839  Signal::init(high, low, rname);
840  mode = mreg;
841 #ifdef VGEN
842  obname = obnames[mode];
843 #endif
844  change = (r != rc);
845  if (change) glc.getparent()->setchange(1);
846  pedge = (rc == 1 && r == 0);
847  nedge = (rc == 0 && r == 1);
848  r = rc;
849 }
rval r
Definition: vlib.h:144
void init(int, int, const char *)
Definition: vlib.cc:239
int pedge
Definition: vlib.h:163
globcontrol glc
Definition: vlib.cc:6
char const * obnames[]
Definition: vlib.cc:8
void setchange(int c)
Definition: vlib.h:229
int nedge
Definition: vlib.h:163
module * getparent()
Definition: vlib.h:308
Definition: vlib.h:30
rval rc
Definition: vlib.h:149
int mode
Definition: vlib.h:170
int change
Definition: vlib.h:163
void Signal::inout ( int  high,
int  low,
const char *  rname 
)

Definition at line 788 of file vlib.cc.

References dbgmsg, TauDecayModes::dec, h, hostl, init(), l, minout, mode, dataset::name, obnames, and printable.

Referenced by output().

789 {
790 #ifdef VGEN
791  if (lb == "{") glc.AddIO(lb + name + rb);
792  else glc.AddIO(name);
793 #else
794 #ifdef _VDEBUG
795  if (h-l != high-low)
796  {
797  dbgmsg("Different port length for inout argument: declared [" << high << ":" << low << "], passed: [" << h << ":" << l <<"]. ");
798  }
799 #endif
800 #endif
801  hostl = l;
802  Signal::init(high, low, rname);
803  if (high >= low)
804  {
805  h = high;
806  l = low;
807  }
808  else
809  {
810  h = low;
811  l = high;
812  }
813  mode = minout;
814 #ifdef VGEN
815  obname = obnames[mode];
816  ostringstream ln;
817  glc.AddParameter(name);
818  if (h == l) ln << obname << name << ";\n";
819  else ln << obname << "[" << dec << h << ":" << l << "] " << name << ";\n";
820  glc.AddDeclarator(ln.str());
821  printable = 0;
822 #endif
823 
824 }
void init(int, int, const char *)
Definition: vlib.cc:239
Definition: vlib.h:34
globcontrol glc
Definition: vlib.cc:6
int hostl
Definition: vlib.h:151
char const * obnames[]
Definition: vlib.cc:8
#define dbgmsg(a)
Definition: vlib.cc:21
int h
Definition: vlib.h:150
int printable
Definition: vlib.h:169
int l
Definition: vlib.h:150
int mode
Definition: vlib.h:170
void Signal::inout ( const char *  rname)
inline

Definition at line 136 of file vlib.h.

References initreg(), inout(), and reg().

Referenced by inout().

136 {inout(0, 0, rname);};
void inout(int, int, const char *)
Definition: vlib.cc:788
void Signal::input ( int  high,
int  low,
const char *  rname 
)

Definition at line 625 of file vlib.cc.

References module::AddOutReg(), change, dbgmsg, TauDecayModes::dec, getmask(), globcontrol::getparent(), getr(), h, host, init(), inited, l, minput, mode, dataset::name, nedge, obnames, outhost, outreg, pedge, printable, r, module::setchange(), setr(), and setrc().

Referenced by operator--().

626 {
627 #ifdef VGEN
628  if (lb == "{") glc.AddIO(lb + name + rb);
629  else glc.AddIO(name);
630 #else
631 #ifdef _VDEBUG
632  if (h-l != high-low && inited) // inited is analysed in case the passed parameter is a temp var. Actually, every operator should return temp with the proper mask,h,l inherited from operands
633  {
634  dbgmsg("Different port length for input argument: declared [" << high << ":" << low << "], passed: [" << h << ":" << l <<"]. ");
635  }
636 #endif
637 #endif
638  Signal::init(high, low, rname);
639  if (high >= low)
640  {
641  h = high;
642  l = low;
643  }
644  else
645  {
646  h = low;
647  l = high;
648  }
649  mode = minput;
650 #ifdef VGEN
651  obname = obnames[mode];
652  ostringstream ln;
653  glc.AddParameter(name);
654  if (h == l) ln << obname << name << ";\n";
655  else ln << obname << "[" << dec << h << ":" << l << "] " << name << ";\n";
656  glc.AddDeclarator(ln.str());
657  printable = 0;
658 #else
659  outreg = glc.getparent()->AddOutReg((Signal)(*this));
660  r = r & outreg->getmask();
661  if (outreg->getr() != r)
662  {
663  change = 1;
664  glc.getparent()->setchange(1);
665  if (r == 1 && outreg->getr() == 0) pedge = 1; else pedge = 0;
666  if (r == 0 && outreg->getr() == 1) nedge = 1; else nedge = 0;
667  }
668  else change = pedge = nedge = 0;
669  outreg->setr(r);
670  outreg->setrc(r);
671  outhost = host = nullptr;
672 #endif
673 
674 }
rval r
Definition: vlib.h:144
void init(int, int, const char *)
Definition: vlib.cc:239
Signal * outhost
Definition: vlib.h:165
void setr(rval rv)
Definition: vlib.h:66
int pedge
Definition: vlib.h:163
globcontrol glc
Definition: vlib.cc:6
char const * obnames[]
Definition: vlib.cc:8
rval getr()
Definition: vlib.h:61
int inited
Definition: vlib.h:168
void setrc(rval rv)
Definition: vlib.h:67
void setchange(int c)
Definition: vlib.h:229
#define dbgmsg(a)
Definition: vlib.cc:21
int h
Definition: vlib.h:150
int nedge
Definition: vlib.h:163
Definition: vlib.h:32
Signal * AddOutReg(Signal arg)
Definition: vlib.cc:1128
int printable
Definition: vlib.h:169
int l
Definition: vlib.h:150
Signal * host
Definition: vlib.h:160
module * getparent()
Definition: vlib.h:308
Signal * outreg
Definition: vlib.h:166
int mode
Definition: vlib.h:170
rval getmask()
Definition: vlib.h:65
int change
Definition: vlib.h:163
Definition: vlib.h:39
void Signal::input ( const char *  rname)
inline

Definition at line 127 of file vlib.h.

References clock(), input(), and output().

Referenced by input().

127 {input(0, 0, rname);};
void input(int, int, const char *)
Definition: vlib.cc:625
void Signal::makemask ( )

Definition at line 232 of file vlib.cc.

References h, l, and mask.

Referenced by function::function(), init(), and function::init().

233 {
234  mask = (1LL << (h - l + 1)) - 1LL;
235  if (mask == 0LL) mask = ~mask;
236 }
rval mask
Definition: vlib.h:152
int h
Definition: vlib.h:150
int l
Definition: vlib.h:150
Signal Signal::operator! ( )

Definition at line 313 of file vlib.cc.

Referenced by setprintable().

Definition at line 424 of file vlib.cc.

Referenced by setprintable().

428 {
Signal Signal::operator% ( Signal  arg)

Definition at line 353 of file vlib.cc.

Referenced by setprintable().

Signal Signal::operator& ( Signal  arg)

Definition at line 357 of file vlib.cc.

Signal * Signal::operator& ( )

Definition at line 316 of file vlib.cc.

References printable.

Referenced by setprintable().

317 {
318 #ifdef VGEN
319  printable = 0;
320 #endif
321  return this;
322 }
int printable
Definition: vlib.h:169
Signal Signal::operator&& ( Signal  arg)

Definition at line 358 of file vlib.cc.

Referenced by setprintable().

Signal Signal::operator() ( Signal  hn,
Signal  ln 
)

Definition at line 593 of file vlib.cc.

References getval(), init(), l, mask, dataset::name, printable, r, rc, and protons_cff::t.

Referenced by operator--().

594 {
595  Signal t;
596 #ifdef VGEN
597  string bname;
598  if (hn.getname().compare(ln.getname()) != 0) bname = name + "[" + hn.getname() + ":" + ln.getname() + "]";
599  else bname = name + "[" + hn.getname() + "]";
600  hn.printable = ln.printable = 0;
601  t.init(this, 0, 0, bname.c_str());
602 #else
603  t.init(this, (unsigned)hn.getval(), (unsigned)ln.getval(), "");
604 #endif
605  t.rc = (getval() >> (t.l - l)) & t.mask;
606  t.r = t.rc;
607  return t;
608 }
rval mask
Definition: vlib.h:152
rval r
Definition: vlib.h:144
void init(int, int, const char *)
Definition: vlib.cc:239
rval getval()
Definition: vlib.cc:481
int printable
Definition: vlib.h:169
int l
Definition: vlib.h:150
rval rc
Definition: vlib.h:149
Definition: vlib.h:39
Signal Signal::operator() ( Signal  n)

Definition at line 610 of file vlib.cc.

References gen::n.

611 {
612  return (*this)(n, n);
613 }
Signal Signal::operator* ( Signal  arg)

Definition at line 351 of file vlib.cc.

Referenced by setprintable().

Signal Signal::operator+ ( Signal  arg)

Definition at line 349 of file vlib.cc.

Referenced by setprintable().

Signal Signal::operator++ ( void  )
inline

Definition at line 109 of file vlib.h.

109 {return *this = *this + 1;};
Signal Signal::operator++ ( int  )
inline

Definition at line 111 of file vlib.h.

111 {return *this = *this + 1;}; // postfix operators require some work (different names for operations and assignment printing?)
Signal Signal::operator, ( Signal  arg)

Definition at line 379 of file vlib.cc.

References ca1, ca2, getval(), h, init(), l, mask, dataset::name, printable, r, source, and protons_cff::t.

Referenced by operator--().

380 {
381  Signal t;
382 #ifdef VGEN
383  t.name = name + ", " + arg.name;
384  t.lb = "{";
385  t.rb = "}";
386  printable = arg.printable = 0;
387 #else
388  t.ca1 = this;
389  t.ca2 = arg.source;
390  t.init(h - l + arg.h - arg.l + 1, 0, "");
391 #endif
392  t.r = (((getval() << (arg.h - arg.l + 1)) & (~(arg.mask))) | arg.getval()) & t.mask;
393  return t;
394 }
rval mask
Definition: vlib.h:152
rval r
Definition: vlib.h:144
void init(int, int, const char *)
Definition: vlib.cc:239
rval getval()
Definition: vlib.cc:481
Signal * ca1
Definition: vlib.h:161
int h
Definition: vlib.h:150
int printable
Definition: vlib.h:169
int l
Definition: vlib.h:150
Signal * source
Definition: vlib.h:164
Signal * ca2
Definition: vlib.h:162
Definition: vlib.h:39
Signal Signal::operator- ( Signal  arg)

Definition at line 350 of file vlib.cc.

Referenced by setprintable().

Signal Signal::operator-- ( )
inline

Definition at line 110 of file vlib.h.

110 {return *this = *this - 1;};
Signal Signal::operator-- ( int  )
inline

Definition at line 112 of file vlib.h.

References input(), operator()(), operator,(), operator<<(), rand, ror, rxor, and alignCSCRings::s.

112 {return *this = *this - 1;};
Signal Signal::operator/ ( Signal  arg)

Definition at line 352 of file vlib.cc.

Referenced by setprintable().

Signal Signal::operator< ( Signal  arg)

Definition at line 420 of file vlib.cc.

Referenced by setprintable().

428 {
Signal Signal::operator<< ( Signal  arg)

Definition at line 355 of file vlib.cc.

Referenced by operator--(), and setprintable().

Signal Signal::operator<= ( Signal  arg)

Definition at line 421 of file vlib.cc.

Referenced by setprintable().

428 {
Signal Signal::operator= ( Signal  other)

Definition at line 486 of file vlib.cc.

References asgn(), dbgmsg, globcontrol::getalwaysn(), minout, minput, mode, moutput, mreg, mwire, NULL, trackingPlots::other, and outreg.

Referenced by parameter::operator int(), and setprintable().

487 {
488 
489 #ifndef VGEN
490 #ifdef _VDEBUG
491  switch (mode)
492  {
493  case moutput:
494  if (glc.getalwaysn() == -1 && outreg != NULL)
495  dbgmsg("Assigning output-reg outside always block.");
496  if (glc.getalwaysn() != -1 && outreg == NULL)
497  dbgmsg("Assigning non-reg output inside always block.");
498  break;
499 
500  case minout:
501  if (glc.getalwaysn() != -1)
502  dbgmsg("Assigning inout inside always block.");
503  break;
504 
505  case minput:
506  dbgmsg("Assigning to input is not allowed.");
507  return other;
508 
509  case mreg:
510  if (glc.getalwaysn() == -1)
511  dbgmsg("Assigning reg outside always block.");
512  break;
513 
514  case mwire:
515  if (glc.getalwaysn() != -1)
516  dbgmsg("Assigning wire inside always block.");
517  break;
518  }
519 #endif
520 #endif
521  return asgn(other);
522 
523 }
Definition: vlib.h:34
globcontrol glc
Definition: vlib.cc:6
int getalwaysn()
Definition: vlib.h:303
#define NULL
Definition: scimark2.h:8
#define dbgmsg(a)
Definition: vlib.cc:21
Definition: vlib.h:31
Definition: vlib.h:32
Signal asgn(Signal)
Definition: vlib.cc:533
Definition: vlib.h:33
Definition: vlib.h:30
Signal * outreg
Definition: vlib.h:166
int mode
Definition: vlib.h:170
Signal Signal::operator== ( Signal  arg)

Definition at line 423 of file vlib.cc.

Referenced by setprintable().

428 {
Signal Signal::operator> ( Signal  arg)

Definition at line 419 of file vlib.cc.

Referenced by setprintable().

428 {
Signal Signal::operator>= ( Signal  arg)

Definition at line 422 of file vlib.cc.

Referenced by setprintable().

428 {
Signal Signal::operator>> ( Signal  arg)

Definition at line 356 of file vlib.cc.

Referenced by setprintable().

Signal Signal::operator^ ( Signal  arg)

Definition at line 354 of file vlib.cc.

Referenced by setprintable().

Signal Signal::operator| ( Signal  arg)

Definition at line 359 of file vlib.cc.

Referenced by setprintable().

Signal Signal::operator|| ( Signal  arg)

Definition at line 362 of file vlib.cc.

References change, getval(), h, init(), l, mask, dataset::name, printable, r, and protons_cff::t.

Referenced by setprintable().

363 {
364  Signal t;
365 #ifdef VGEN
366  t.name = lb + name + rb + " || " + arg.lb + arg.name + arg.rb;
367  t.orname = orname + " or " + arg.orname;
368  printable = arg.printable = 0;
369 #else
370  int ln = h - l;
371  int aln = arg.h - arg.l;
372  t.init((ln > aln) ? ln : aln, 0, "");
373 #endif
374  t.r = t.mask & (getval() || arg.getval());
375  t.change = change || arg.change;
376  return t;
377 }
rval mask
Definition: vlib.h:152
rval r
Definition: vlib.h:144
void init(int, int, const char *)
Definition: vlib.cc:239
rval getval()
Definition: vlib.cc:481
int h
Definition: vlib.h:150
int printable
Definition: vlib.h:169
int l
Definition: vlib.h:150
int change
Definition: vlib.h:163
Definition: vlib.h:39
Signal Signal::operator~ ( )

Definition at line 314 of file vlib.cc.

Referenced by setprintable().

void Signal::output ( int  high,
int  low,
const char *  rname 
)

Definition at line 722 of file vlib.cc.

References dbgmsg, TauDecayModes::dec, h, hostl, init(), l, mode, moutput, mreg, dataset::name, obnames, and printable.

Referenced by input(), and output().

723 {
724 #ifdef VGEN
725  if (lb == "{") glc.AddIO(lb + name + rb);
726  else glc.AddIO(name);
727 #else
728 #ifdef _VDEBUG
729  if (h-l != high-low)
730  {
731  dbgmsg("Different port length for output argument: declared [" << high << ":" << low << "], passed: [" << h << ":" << l <<"]. ");
732  }
733  if (mode == mreg)
734  {
735  dbgmsg("Using reg as output.");
736  }
737 #endif
738 #endif
739  hostl = l;
740  Signal::init(high, low, rname);
741  if (high >= low)
742  {
743  h = high;
744  l = low;
745  }
746  else
747  {
748  h = low;
749  l = high;
750  }
751  mode = moutput;
752 #ifdef VGEN
753  obname = obnames[mode];
754  ostringstream ln;
755  glc.AddParameter(name);
756  if (h == l) ln << obname << name << ";\n";
757  else ln << obname << "[" << dec << h << ":" << l << "] " << name << ";\n";
758  glc.AddDeclarator(ln.str());
759  printable = 0;
760 #endif
761 
762 }
void init(int, int, const char *)
Definition: vlib.cc:239
globcontrol glc
Definition: vlib.cc:6
int hostl
Definition: vlib.h:151
char const * obnames[]
Definition: vlib.cc:8
#define dbgmsg(a)
Definition: vlib.cc:21
int h
Definition: vlib.h:150
Definition: vlib.h:33
int printable
Definition: vlib.h:169
int l
Definition: vlib.h:150
Definition: vlib.h:30
int mode
Definition: vlib.h:170
void Signal::output ( const char *  rname)
inline

Definition at line 131 of file vlib.h.

References inout(), output(), and class-composition::parent.

Referenced by output().

131 {output(0, 0, rname);};
void output(int, int, const char *)
Definition: vlib.cc:722
void Signal::output ( int  high,
int  low,
const char *  rname,
module parent 
)

Definition at line 764 of file vlib.cc.

References module::AddOutReg(), TauDecayModes::dec, getchange(), getnegedge(), getposedge(), getr(), h, l, dataset::name, output(), outreg, setchange(), setnegedge(), setposedge(), and setr().

765 {
766  output(high, low, rname);
767 #ifdef VGEN
768  ostringstream ln;
769  if (h == l) ln << "reg " << name << ";\n";
770  else ln << "reg [" << dec << h << ":" << l << "] " << name << ";\n";
771  glc.AddDeclarator(ln.str());
772 #else
773  outreg = parent->AddOutReg((Signal)(*this));
774  setr(outreg->getr());
778 #endif
779 }
void setr(rval rv)
Definition: vlib.h:66
void setnegedge(int ch)
Definition: vlib.h:76
globcontrol glc
Definition: vlib.cc:6
rval getr()
Definition: vlib.h:61
void setchange(int ch)
Definition: vlib.h:74
void setposedge(int ch)
Definition: vlib.h:75
int getposedge()
Definition: vlib.h:71
int h
Definition: vlib.h:150
Signal * AddOutReg(Signal arg)
Definition: vlib.cc:1128
int l
Definition: vlib.h:150
int getnegedge()
Definition: vlib.h:72
int getchange()
Definition: vlib.h:73
Signal * outreg
Definition: vlib.h:166
void output(int, int, const char *)
Definition: vlib.cc:722
Definition: vlib.h:39
void Signal::output ( const char *  rname,
module parent 
)

Definition at line 781 of file vlib.cc.

References output().

782 {
783  output(0, 0, rname, parent);
784 }
void output(int, int, const char *)
Definition: vlib.cc:722
void Signal::reg ( int  high,
int  low,
const char *  rname 
)

Definition at line 828 of file vlib.cc.

References gather_cfg::cout, TauDecayModes::dec, h, initreg(), l, and dataset::name.

Referenced by module::AddOutReg(), inout(), and memory::memory().

829 {
830  initreg(high, low, rname);
831 #ifdef VGEN
832  if (h == l) cout << glc.getmargin() << obname << name << ";\n" << flush;
833  else std::cout << glc.getmargin() << obname << "[" << dec << h << ":" << l << "] "<< name << ";\n" << flush;
834 #endif
835 }
globcontrol glc
Definition: vlib.cc:6
int h
Definition: vlib.h:150
void initreg(int, int, const char *)
Definition: vlib.cc:837
int l
Definition: vlib.h:150
void Signal::reg ( const char *  rname)
inline

Definition at line 140 of file vlib.h.

References reg(), and wire().

Referenced by reg().

140 {reg(0, 0, rname);};
void reg(int, int, const char *)
Definition: vlib.cc:828
Signal Signal::set ( Signal  other)

Definition at line 525 of file vlib.cc.

References asgn().

Referenced by asgn().

526 {
527 #ifdef VGEN
528  glc.setprintassign(0);
529 #endif
530  return asgn(other);
531 }
globcontrol glc
Definition: vlib.cc:6
Signal asgn(Signal)
Definition: vlib.cc:533
void Signal::setalwaysn ( int  n)
inline

Definition at line 77 of file vlib.h.

References alwaysn.

Referenced by asgn().

77 {alwaysn = (n == -1) ? 0 : n;};
int alwaysn
Definition: vlib.h:167
void Signal::setchange ( int  ch)
inline

Definition at line 74 of file vlib.h.

References change.

Referenced by globcontrol::getalwaysn(), module::negedge(), output(), and module::posedge().

74 {change = ch;};
int change
Definition: vlib.h:163
void Signal::sethlmask ( int  high,
int  low,
rval  imask 
)
inline

Definition at line 68 of file vlib.h.

References mask.

68 {h = high; l = low; mask = imask;};
rval mask
Definition: vlib.h:152
int h
Definition: vlib.h:150
int l
Definition: vlib.h:150
void Signal::setnegedge ( int  ch)
inline

Definition at line 76 of file vlib.h.

References nedge.

Referenced by output().

76 {nedge = ch;};
int nedge
Definition: vlib.h:163
void Signal::setposedge ( int  ch)
inline

Definition at line 75 of file vlib.h.

References pedge.

Referenced by output().

75 {pedge = ch;};
int pedge
Definition: vlib.h:163
void Signal::setprintable ( int  p)
inline
void Signal::setr ( rval  rv)
inline

Definition at line 66 of file vlib.h.

References mask.

Referenced by module::AddOutReg(), clock(), input(), and output().

66 {r = rv & mask;};
rval mask
Definition: vlib.h:152
rval r
Definition: vlib.h:144
void Signal::setrc ( rval  rv)
inline

Definition at line 67 of file vlib.h.

References mask, and rc.

Referenced by clock(), and input().

67 {rc = rv & mask;};
rval mask
Definition: vlib.h:152
rval rc
Definition: vlib.h:149
void Signal::wire ( int  high,
int  low,
const char *  rname 
)

Definition at line 885 of file vlib.cc.

References change, gather_cfg::cout, TauDecayModes::dec, globcontrol::getparent(), h, init(), l, mode, mwire, dataset::name, nedge, obnames, outhost, pedge, r, rc, and module::setchange().

Referenced by reg(), and wire().

886 {
887  Signal::init(high, low, rname);
888  mode = mwire;
889  outhost = this;
890  change = (r != rc);
891  if (change && glc.getparent()) glc.getparent()->setchange(1);
892  pedge = (rc == 1 && r == 0);
893  nedge = (rc == 0 && r == 1);
894  r = rc;
895 #ifdef VGEN
896  obname = obnames[mode];
897  if (h == l) cout << glc.getmargin() << obname << name << ";\n" << flush;
898  else std::cout << glc.getmargin() << obname << "[" << dec << h << ":" << l << "] "<< name << ";\n" << flush;
899 #endif
900 }
rval r
Definition: vlib.h:144
void init(int, int, const char *)
Definition: vlib.cc:239
Signal * outhost
Definition: vlib.h:165
int pedge
Definition: vlib.h:163
globcontrol glc
Definition: vlib.cc:6
char const * obnames[]
Definition: vlib.cc:8
void setchange(int c)
Definition: vlib.h:229
int h
Definition: vlib.h:150
int nedge
Definition: vlib.h:163
Definition: vlib.h:31
int l
Definition: vlib.h:150
module * getparent()
Definition: vlib.h:308
rval rc
Definition: vlib.h:149
int mode
Definition: vlib.h:170
int change
Definition: vlib.h:163
void Signal::wire ( int  high,
int  low,
const char *  rname,
int  i 
)

Definition at line 902 of file vlib.cc.

References TauDecayModes::dec, mps_fire::i, and wire().

903 {
904 #ifdef VGEN
905  ostringstream instnamestream;
906  instnamestream << rname << dec << i;
907 // init(high, low, instnamestream.str().c_str());
908  wire(high, low, instnamestream.str().c_str());
909 #else
910  wire(high, low, rname);
911 #endif
912 }
void wire(int, int, const char *)
Definition: vlib.cc:885
void Signal::wire ( const char *  rname)
inline

Definition at line 144 of file vlib.h.

References r, and wire().

Referenced by wire().

144 {wire(0, 0, rname);};
void wire(int, int, const char *)
Definition: vlib.cc:885

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
Signal  s 
)
friend

Definition at line 616 of file vlib.cc.

617 {
618  stream << s.getr();
619  s.setprintable(0);
620  return stream;
621 }
rval getr()
Definition: vlib.h:61
void setprintable(int p)
Definition: vlib.h:79
Signal rand ( Signal  arg)
friend

Definition at line 442 of file vlib.cc.

Referenced by operator--().

443 {
444  Signal t;
445  rval tr;
446 #ifdef VGEN
447  t.name = "&" + arg.lb + arg.name + arg.rb;
448  arg.printable = 0;
449 #else
450  t.init("");
451 #endif
452  tr = (arg.getval()) & arg.mask;
453  t.r = (tr == arg.mask) ? 1 : 0;
454  return t;
455 }
rval mask
Definition: vlib.h:152
rval r
Definition: vlib.h:144
void init(int, int, const char *)
Definition: vlib.cc:239
rval getval()
Definition: vlib.cc:481
int printable
Definition: vlib.h:169
unsigned long long int rval
Definition: vlib.h:22
Definition: vlib.h:39
Signal ror ( Signal  arg)
friend

Definition at line 427 of file vlib.cc.

Referenced by operator--().

428 {
429  Signal t;
430  rval tr;
431 #ifdef VGEN
432  t.name = "|" + arg.lb + arg.name + arg.rb;
433  arg.printable = 0;
434 #else
435  t.init("");
436 #endif
437  tr = (arg.getval()) & arg.mask;
438  t.r = (tr != 0) ? 1 : 0;
439  return t;
440 }
rval mask
Definition: vlib.h:152
rval r
Definition: vlib.h:144
void init(int, int, const char *)
Definition: vlib.cc:239
rval getval()
Definition: vlib.cc:481
int printable
Definition: vlib.h:169
unsigned long long int rval
Definition: vlib.h:22
Definition: vlib.h:39
Signal rxor ( Signal  arg)
friend

Definition at line 457 of file vlib.cc.

Referenced by operator--().

458 {
459  Signal t;
460  rval tr;
461  int i;
462 #ifdef VGEN
463  t.name = "^" + arg.lb + arg.name + arg.rb;
464  arg.printable = 0;
465 #else
466  t.init("");
467 #endif
468  tr = (arg.getval()) & arg.mask;
469  t.r = 0;
470  for (i = 0; i < arg.h-arg.l+1; ++i)
471  {
472  t.r = ((tr & 1) != 0) ? !t.r : t.r;
473  tr = tr >> 1;
474  }
475  t.r = t.r & 1;
476  return t;
477 }
rval mask
Definition: vlib.h:152
rval r
Definition: vlib.h:144
void init(int, int, const char *)
Definition: vlib.cc:239
rval getval()
Definition: vlib.cc:481
int h
Definition: vlib.h:150
int printable
Definition: vlib.h:169
int l
Definition: vlib.h:150
unsigned long long int rval
Definition: vlib.h:22
Definition: vlib.h:39

Member Data Documentation

int Signal::alwaysn
protected
Signal* Signal::ca1
protected

Definition at line 161 of file vlib.h.

Referenced by asgn(), create(), and operator,().

Signal* Signal::ca2
protected

Definition at line 162 of file vlib.h.

Referenced by asgn(), create(), and operator,().

int Signal::change
protected
int Signal::h
protected
Signal* Signal::host
protected

Definition at line 160 of file vlib.h.

Referenced by asgn(), clock(), create(), init(), and input().

int Signal::hostl
protected

Definition at line 151 of file vlib.h.

Referenced by asgn(), create(), inout(), and output().

int Signal::inited
protected

Definition at line 168 of file vlib.h.

Referenced by clock(), create(), init(), input(), and Signal().

int Signal::l
protected
rval Signal::mask
protected
int Signal::mode
protected

Definition at line 170 of file vlib.h.

Referenced by asgn(), clock(), create(), initreg(), inout(), input(), operator=(), output(), Signal(), and wire().

int Signal::nedge
protected

Definition at line 163 of file vlib.h.

Referenced by asgn(), clock(), create(), getnegedge(), init(), parameter::init(), initreg(), input(), setnegedge(), and wire().

Signal* Signal::outhost
protected

Definition at line 165 of file vlib.h.

Referenced by asgn(), clock(), create(), input(), and wire().

Signal* Signal::outreg
protected
int Signal::pedge
protected

Definition at line 163 of file vlib.h.

Referenced by asgn(), clock(), create(), getposedge(), init(), parameter::init(), initreg(), input(), setposedge(), and wire().

int Signal::printable
protected
rval Signal::r
protected
rval Signal::rc
protected

Definition at line 149 of file vlib.h.

Referenced by asgn(), clock(), create(), getval(), init(), initreg(), operator()(), setrc(), Signal(), and wire().

Signal* Signal::source
protected

Definition at line 164 of file vlib.h.

Referenced by init(), and operator,().