litex/migen/bus/transactions.py

25 lines
556 B
Python
Raw Normal View History

from migen.fhdl.std import *
2012-03-08 12:14:06 -05:00
2015-04-13 14:45:35 -04:00
2012-03-08 12:14:06 -05:00
class Transaction:
def __init__(self, address, data=0, sel=None, busname=None):
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
self.latency = 0
2014-10-17 05:08:37 -04:00
def __str__(self):
return "<" + self.__class__.__name__ + " adr:" + hex(self.address) + " dat:" + hex(self.data) + ">"
2012-03-08 12:14:06 -05:00
2015-04-13 14:45:35 -04:00
2012-03-08 12:14:06 -05:00
class TRead(Transaction):
pass
2012-03-08 12:14:06 -05:00
2015-04-13 14:45:35 -04:00
2012-03-08 12:14:06 -05:00
class TWrite(Transaction):
pass