litex/misoclib/tools/litescope/software/driver/io.py

18 lines
449 B
Python
Raw Normal View History

class LiteScopeIODriver():
def __init__(self, regs, name):
self.regs = regs
self.name = name
self.build()
def build(self):
for key, value in self.regs.d.items():
if self.name in key:
2015-04-13 07:37:46 -04:00
key = key.replace(self.name + "_", "")
setattr(self, key, value)
def write(self, value):
2015-05-01 11:23:44 -04:00
self.output.write(value)
def read(self):
2015-05-01 11:23:44 -04:00
return self.input.read()