projects
/
litex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
decbd06
)
sim: fix zero encoding
author
Sebastien Bourdeauducq
<sebastien@milkymist.org>
Thu, 8 Mar 2012 14:34:08 +0000
(15:34 +0100)
committer
Sebastien Bourdeauducq
<sebastien@milkymist.org>
Thu, 8 Mar 2012 14:34:08 +0000
(15:34 +0100)
migen/sim/ipc.py
patch
|
blob
|
history
diff --git
a/migen/sim/ipc.py
b/migen/sim/ipc.py
index 5d9f9eb685ea2647cfc50cdb953ea2349548322e..f463dcfff706225c3a82e0e50c745b621241eb10 100644
(file)
--- a/
migen/sim/ipc.py
+++ b/
migen/sim/ipc.py
@@
-51,11
+51,14
@@
message_classes = [MessageTick, MessageGo, MessageWrite, MessageRead, MessageRea
#
def _pack_int(v):
- p = []
- while v != 0:
- p.append(v & 0xff)
- v >>= 8
- p.insert(0, len(p))
+ if v == 0:
+ p = [1, 0]
+ else:
+ p = []
+ while v != 0:
+ p.append(v & 0xff)
+ v >>= 8
+ p.insert(0, len(p))
return p
def _pack_str(v):