Beispiel #1
0
 def cosimToSignalVals():
     wt, rf = wtrf()
     buf = "FROM 00 "
     for s, w in zip(fromSignames, fromSizes):
         buf += "%s %s " % (s, w)
     os.write(wt, to_bytes(buf))
     os.read(rf, MAXLINE)
     buf = "TO 00 "
     for s, w in zip(toSignames, toSizes):
         buf += "%s %s " % (s, w)
     os.write(wt, to_bytes(buf))
     os.read(rf, MAXLINE)
     os.write(wt, b"START")
     os.read(rf, MAXLINE)
     buf = "0 "
     for s, v in zip(toSignames, toVals):
         buf += s
         buf += " "
         buf += hex(v)[2:]
         buf += " "
     os.write(wt, to_bytes(buf))
     os.read(rf, MAXLINE)
     buf = "0 "
     for s, v in zip(toSignames, toXVals):
         buf += s
         buf += " "
         buf += v
         buf += " "
     os.write(wt, to_bytes(buf))
 def cosimToSignalVals():
     wt = int(os.environ['MYHDL_TO_PIPE'])
     rf = int(os.environ['MYHDL_FROM_PIPE'])
     buf = "FROM 00 "
     for s, w in zip(fromSignames, fromSizes):
         buf += "%s %s " % (s, w)
     os.write(wt, to_bytes(buf))
     os.read(rf, MAXLINE)
     buf = "TO 00 "
     for s, w in zip(toSignames, toSizes):
         buf += "%s %s " % (s, w)
     os.write(wt, to_bytes(buf))
     os.read(rf, MAXLINE)
     os.write(wt, b"START")
     os.read(rf, MAXLINE)
     buf = "0 "
     for s, v in zip(toSignames, toVals):
         buf += s
         buf += " "
         buf += hex(v)[2:]
         buf += " "
     os.write(wt, to_bytes(buf))
     os.read(rf, MAXLINE)
     buf = "0 "
     for s, v in zip(toSignames, toXVals):
         buf += s
         buf += " "
         buf += v
         buf += " "
     os.write(wt, to_bytes(buf))
Beispiel #3
0
 def cosimFromToSignals():
     wt, rf = wtrf()
     buf = "FROM 00 "
     for s, w in zip(fromSignames, fromSizes):
         buf += "%s %s " % (s, w)
     os.write(wt, to_bytes(buf))
     os.read(rf, MAXLINE)
     buf = "TO 00 "
     for s, w in zip(toSignames, toSizes):
         buf += "%s %s " % (s, w)
     os.write(wt, to_bytes(buf))
     os.read(rf, MAXLINE)
     os.write(wt, b"START")
     os.read(rf, MAXLINE)
Beispiel #4
0
 def cosimFromToSignals(self):
     wt = int(os.environ['MYHDL_TO_PIPE'])
     rf = int(os.environ['MYHDL_FROM_PIPE'])
     buf = "FROM 00 "
     for s, w in zip(fromSignames, fromSizes):
         buf += "%s %s " % (s, w)
     os.write(wt, to_bytes(buf))
     os.read(rf, MAXLINE)
     buf = "TO 00 "
     for s, w in zip(toSignames, toSizes):
         buf += "%s %s " % (s, w)
     os.write(wt, to_bytes(buf))
     os.read(rf, MAXLINE)
     os.write(wt, b"START")
     os.read(rf, MAXLINE)
 def cosimTimeZero():
     wt = int(os.environ['MYHDL_TO_PIPE'])
     rf = int(os.environ['MYHDL_FROM_PIPE'])
     buf = "TO 01 "
     for s, w in zip(fromSignames, fromSizes):
         buf += "%s %s " % (s, w)
     os.write(wt, to_bytes(buf))
Beispiel #6
0
 def cosimToSignalsDupl():
     wt, rf = wtrf()
     buf = "TO 00 "
     for s, w in zip(toSignames, toSizes):
         buf += "%s %s " % (s, w)
     buf += "fff 6"
     os.write(wt, to_bytes(buf))
Beispiel #7
0
 def cosimFromSignalsDupl():
     wt, rf = wtrf()
     buf = "FROM 00 "
     for s, w in zip(fromSignames, fromSizes):
         buf += "%s %s " % (s, w)
     buf += "bb 5"
     os.write(wt, to_bytes(buf))
 def cosimToSignalsDupl():
     wt = int(os.environ['MYHDL_TO_PIPE'])
     rf = int(os.environ['MYHDL_FROM_PIPE'])
     buf = "TO 00 "
     for s, w in zip(toSignames, toSizes):
         buf += "%s %s " % (s, w)
     buf += "fff 6"
     os.write(wt, to_bytes(buf))
 def cosimFromSignalsDupl():
     wt = int(os.environ['MYHDL_TO_PIPE'])
     rf = int(os.environ['MYHDL_FROM_PIPE'])
     buf = "FROM 00 "
     for s, w in zip(fromSignames, fromSizes):
         buf += "%s %s " % (s, w)
     buf += "bb 5"
     os.write(wt, to_bytes(buf))
Beispiel #10
0
 def cosimFromSignalVals():
     wt, rf = wtrf()
     buf = "FROM 00 "
     for s, w in zip(fromSignames, fromSizes):
         buf += "%s %s " % (s, w)
     os.write(wt, to_bytes(buf))
     os.read(rf, MAXLINE)
     os.write(wt, b"TO 0000 a 1")
     os.read(rf, MAXLINE)
     os.write(wt, b"START")
     os.read(rf, MAXLINE)
     os.write(wt, b"DUMMY")
     s = os.read(rf, MAXLINE)
     vals = [int(e, 16) for e in s.split()[1:]]
     assert vals == fromVals
Beispiel #11
0
 def cosimFromSignalVals(self):
     wt = int(os.environ['MYHDL_TO_PIPE'])
     rf = int(os.environ['MYHDL_FROM_PIPE'])
     buf = "FROM 00 "
     for s, w in zip(fromSignames, fromSizes):
         buf += "%s %s " % (s, w)
     os.write(wt, to_bytes(buf))
     os.read(rf, MAXLINE)
     os.write(wt, b"TO 0000 a 1")
     os.read(rf, MAXLINE)
     os.write(wt, b"START")
     os.read(rf, MAXLINE)
     os.write(wt, b"DUMMY")
     s = os.read(rf, MAXLINE)
     vals = [int(e, 16) for e in s.split()[1:]]
     self.assertEqual(vals, fromVals)
Beispiel #12
0
 def _put(self, time):
     buflist = []
     buf = repr(time)
     if buf[-1] == 'L':
         buf = buf[:-1] # strip trailing L
     buflist.append(buf)
     if self._hasChange:
         self._hasChange = 0
         for s in self._fromSigs:
             v = int(s._val)
             # signed support
             if s._nrbits and v < 0:
                 v += (1 << s._nrbits)
             buf = hex(v)[2:]
             if buf[-1] == 'L':
                 buf = buf[:-1] # strip trailing L
             buflist.append(buf)
     os.write(self._wf, to_bytes(" ".join(buflist)))
     self._getMode = 1
Beispiel #13
0
 def cosimTimeZero():
     wt, rf = wtrf()
     buf = "TO 01 "
     for s, w in zip(fromSignames, fromSizes):
         buf += "%s %s " % (s, w)
     os.write(wt, to_bytes(buf))