2015-02-18 09:32:34 -05:00
|
|
|
class LiteScopeIODriver():
|
2015-04-13 07:09:44 -04:00
|
|
|
def __init__(self, regs, name):
|
|
|
|
self.regs = regs
|
|
|
|
self.name = name
|
|
|
|
self.build()
|
2015-02-18 09:32:34 -05:00
|
|
|
|
2015-04-13 07:09:44 -04:00
|
|
|
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 + "_", "")
|
2015-04-13 07:09:44 -04:00
|
|
|
setattr(self, key, value)
|
2015-02-18 09:32:34 -05:00
|
|
|
|
2015-04-13 07:09:44 -04:00
|
|
|
def write(self, value):
|
2015-05-01 11:23:44 -04:00
|
|
|
self.output.write(value)
|
2015-02-18 09:32:34 -05:00
|
|
|
|
2015-04-13 07:09:44 -04:00
|
|
|
def read(self):
|
2015-05-01 11:23:44 -04:00
|
|
|
return self.input.read()
|