integration/soc: Move Timer import to add_timer.

This commit is contained in:
Florent Kermarrec 2021-03-25 08:43:52 +01:00
parent 01fdca9149
commit 1b9eefbee4
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,6 @@ from migen import *
from litex.soc.cores import cpu
from litex.soc.cores.identifier import Identifier
from litex.soc.cores.timer import Timer
from litex.soc.cores.video import VideoTimingGenerator, VideoTerminal, VideoFrameBuffer, ColorBarsPattern
from litex.soc.interconnect.csr import *
@ -919,6 +918,7 @@ class SoC(Module):
self.add_constant("CONFIG_CPU_NOP", self.cpu.nop)
def add_timer(self, name="timer0"):
from litex.soc.cores.timer import Timer
self.check_if_exists(name)
setattr(self.submodules, name, Timer())
self.csr.add(name, use_loc_if_exists=True)