Merge pull request #879 from betrusted-io/timer-doc

use AutoDoc for timer documentation
This commit is contained in:
enjoy-digital 2021-04-14 08:56:37 +02:00 committed by GitHub
commit 01479ed541
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -11,13 +11,14 @@ from migen import *
from litex.soc.interconnect.csr import * from litex.soc.interconnect.csr import *
from litex.soc.interconnect.csr_eventmanager import * from litex.soc.interconnect.csr_eventmanager import *
from litex.soc.integration.doc import ModuleDoc from litex.soc.integration.doc import AutoDoc, ModuleDoc
# Timer -------------------------------------------------------------------------------------------- # Timer --------------------------------------------------------------------------------------------
class Timer(Module, AutoCSR, ModuleDoc): class Timer(Module, AutoCSR, AutoDoc):
with_uptime = False with_uptime = False
"""Timer def __init__(self, width=32):
self.intro = ModuleDoc("""Timer
Provides a generic Timer core. Provides a generic Timer core.
@ -50,8 +51,7 @@ class Timer(Module, AutoCSR, ModuleDoc):
For both modes, the CPU can be advertised by an IRQ that the duration/period has elapsed. (The For both modes, the CPU can be advertised by an IRQ that the duration/period has elapsed. (The
CPU can also do software polling with ``update_value`` and ``value`` to know the elapsed duration) CPU can also do software polling with ``update_value`` and ``value`` to know the elapsed duration)
""" """)
def __init__(self, width=32):
self._load = CSRStorage(width, description="""Load value when Timer is (re-)enabled. self._load = CSRStorage(width, description="""Load value when Timer is (re-)enabled.
In One-Shot mode, the value written to this register specifies the Timer's duration in In One-Shot mode, the value written to this register specifies the Timer's duration in
clock cycles.""") clock cycles.""")