Skip to content

Commit a874f85

Browse files
committedMar 17, 2015
litescope: use CRG from Migen
1 parent b2f32ad commit a874f85

File tree

1 file changed

+2
-16
lines changed
  • misoclib/tools/litescope/example_designs/targets

1 file changed

+2
-16
lines changed
 

‎misoclib/tools/litescope/example_designs/targets/simple.py

+2-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from migen.bank.description import *
2+
from migen.genlib.io import CRG
23

34
from misoclib.soc import SoC
45
from misoclib.tools.litescope.common import *
@@ -7,20 +8,6 @@
78
from misoclib.tools.litescope.frontend.la import LiteScopeLA
89
from misoclib.tools.litescope.core.port import LiteScopeTerm
910

10-
class _CRG(Module):
11-
def __init__(self, clk_in):
12-
self.clock_domains.cd_sys = ClockDomain()
13-
self.clock_domains.cd_por = ClockDomain(reset_less=True)
14-
15-
# Power on Reset (vendor agnostic)
16-
rst_n = Signal()
17-
self.sync.por += rst_n.eq(1)
18-
self.comb += [
19-
self.cd_sys.clk.eq(clk_in),
20-
self.cd_por.clk.eq(clk_in),
21-
self.cd_sys.rst.eq(~rst_n)
22-
]
23-
2411
class LiteScopeSoC(SoC, AutoCSR):
2512
csr_map = {
2613
"io": 16,
@@ -37,8 +24,7 @@ def __init__(self, platform):
3724
with_identifier=True,
3825
with_timer=False
3926
)
40-
clk_in = platform.request(platform.default_clk_name)
41-
self.submodules.crg = _CRG(clk_in if not hasattr(clk_in, "p") else clk_in.p)
27+
self.submodules.crg = CRG(platform.request(platform.default_clk_name))
4228

4329
self.submodules.io = LiteScopeIO(8)
4430
for i in range(8):

0 commit comments

Comments
 (0)
Please sign in to comment.