TTLClockGen: expose acc_width

Signed-off-by: Robert Jördens <rj@quartiq.de>
This commit is contained in:
Robert Jördens 2018-10-25 09:52:00 +00:00
parent f755a4682a
commit f62c1ff0bb
1 changed files with 3 additions and 2 deletions

View File

@ -371,16 +371,17 @@ class TTLClockGen:
The time cursor is not modified by any function in this class. The time cursor is not modified by any function in this class.
:param channel: channel number :param channel: channel number
:param acc_width: accumulator width in bits
""" """
kernel_invariants = {"core", "channel", "acc_width"} kernel_invariants = {"core", "channel", "acc_width"}
def __init__(self, dmgr, channel, core_device="core"): def __init__(self, dmgr, channel, acc_width=24, core_device="core"):
self.core = dmgr.get(core_device) self.core = dmgr.get(core_device)
self.channel = channel self.channel = channel
# in RTIO cycles # in RTIO cycles
self.previous_timestamp = numpy.int64(0) self.previous_timestamp = numpy.int64(0)
self.acc_width = numpy.int64(24) self.acc_width = numpy.int64(acc_width)
@portable @portable
def frequency_to_ftw(self, frequency): def frequency_to_ftw(self, frequency):