sim/ipc/Message: convert values
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Sat, 17 Nov 2012 22:19:40 +0000 (23:19 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Sat, 17 Nov 2012 22:19:40 +0000 (23:19 +0100)
examples/pytholite/uio.py
migen/sim/ipc.py

index 9ee5086888c15be581bea022cdd175beceba8520..c4b62eca0a3fb84668926a0c2349bee26dde20a3 100644 (file)
@@ -17,7 +17,7 @@ def gen():
                r = TRead(i)
                yield r
                ds.store = r.data
-               yield Token("result", {"r": int(ds)})
+               yield Token("result", {"r": ds})
 
 class Dumper(SimActor):
        def __init__(self):
index fde8e696748eb99656ecae34cfdcee06fa2b4002..0121a5938fa4589f931b55ab27911ea736f60fdd 100644 (file)
@@ -14,8 +14,7 @@ class Int32(int):
 class Message:
        def __init__(self, *pvalues):
                for parameter, value in zip(self.parameters, pvalues):
-                       assert(isinstance(value, parameter[0]))
-                       setattr(self, parameter[1], value)
+                       setattr(self, parameter[1], parameter[0](value))
        
        def __str__(self):
                p = []