Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion j1a/nandland-go/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def serialize(self):
for l in lines:
l = l.split()
s += [int(b, 16) for b in l[1:17]]
s = array.array('B', s).tostring().ljust(8192, chr(0xff))
s = array.array('B', s).tobytes().ljust(8192, bytes([0xFF]))
return array.array('H', s)

if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion j1a/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def serialize(self):
for l in lines:
l = l.split()
s += [int(b, 16) for b in l[1:17]]
s = array.array('B', s).tostring().ljust(8192, chr(0xff))
s = array.array('B', s).tobytes().ljust(8192, bytes([0xFF]))
return array.array('H', s)

if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion j1a/verilator/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def serialize(self):
for l in lines:
l = l.split()
s += [int(b, 16) for b in l[1:17]]
s = array.array('B', s).tostring().ljust(8192, chr(0xff))
s = array.array('B', s).tobytes().ljust(8192, bytes([0xFF]))
return array.array('H', s)

if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion j1a/verilator/simshell4.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def serialize(self):
for l in lines:
l = l.split()
s += [int(b, 16) for b in l[1:17]]
s = array.array('B', s).tostring().ljust(8192, chr(0xff))
s = array.array('B', s).tobytes().ljust(8192, bytes([0xFF]))
return array.array('H', s)

if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion j1b/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def serialize(self):
for l in lines:
l = l.split()
s += [int(b, 16) for b in l[1:17]]
s = array.array('B', s).tostring().ljust(32768, chr(0xff))
s = array.array('B', s).tobytes().ljust(8192, bytes([0xFF]))
return array.array('i', s)

if __name__ == '__main__':
Expand Down
4 changes: 2 additions & 2 deletions shell/swapforth.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@ def shellcmd(self, cmd):
if dest.endswith('.hex'):
open(dest, "w").write("".join(["%08x\n" % (x & 0xffffffff) for x in d]))
else:
open(dest, "wb").write(array.array("i", d).tostring())
open(dest, "wb").write(array.array("i", d).tobytes())
else:
if dest.endswith('.hex'):
open(dest, "w").write("".join(["%04x\n" % (x & 0xffff) for x in d]))
else:
open(dest, "wb").write(array.array("h", d).tostring())
open(dest, "wb").write(array.array("H", d).tobytes())
elif cmd.startswith('#setclock'):
n = datetime.utcnow()
cmd = "decimal %d %d %d %d %d %d >time&date" % (n.second, n.minute, n.hour, n.day, n.month, n.year)
Expand Down