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