litex/migen/bus/transactions.py

22 lines
495 B
Python
Raw Normal View History

2012-03-08 12:14:06 -05:00
from migen.fhdl.structure import bits_for
class Transaction:
def __init__(self, address, data=0, sel=None, busname=None):
2012-03-08 12:14:06 -05:00
self.address = address
self.data = data
if sel is None:
bytes = (bits_for(data) + 7)//8
sel = 2**bytes - 1
self.sel = sel
self.busname = busname
2012-03-08 12:14:06 -05:00
self.latency = 0
def __str__(self):
return "<" + self.__class__.__name__ + " adr:" + hex(self.address) + " dat:" + hex(self.data) + ">"
class TRead(Transaction):
pass
class TWrite(Transaction):
pass