mirror of https://github.com/XS-MLVP/mlvp.git
20 lines
465 B
Python
20 lines
465 B
Python
from toffee import *
|
|
|
|
|
|
class AdderBundle(Bundle):
|
|
a, b, cin, sum, cout = Signals(5)
|
|
|
|
|
|
class AdderAgent(Agent):
|
|
@driver_method()
|
|
async def exec_add(self, a, b, cin):
|
|
self.bundle.a.value = a
|
|
self.bundle.b.value = b
|
|
self.bundle.cin.value = cin
|
|
await self.bundle.step()
|
|
return self.bundle.sum.value, self.bundle.cout.value
|
|
|
|
@monitor_method()
|
|
async def monitor_once(self):
|
|
return self.bundle.as_dict()
|