Skip to content

Commit

Permalink
litescope: use CRG from Migen
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital committed Mar 17, 2015
1 parent b2f32ad commit a874f85
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions misoclib/tools/litescope/example_designs/targets/simple.py
@@ -1,4 +1,5 @@
from migen.bank.description import *
from migen.genlib.io import CRG

from misoclib.soc import SoC
from misoclib.tools.litescope.common import *
Expand All @@ -7,20 +8,6 @@
from misoclib.tools.litescope.frontend.la import LiteScopeLA
from misoclib.tools.litescope.core.port import LiteScopeTerm

class _CRG(Module):
def __init__(self, clk_in):
self.clock_domains.cd_sys = ClockDomain()
self.clock_domains.cd_por = ClockDomain(reset_less=True)

# Power on Reset (vendor agnostic)
rst_n = Signal()
self.sync.por += rst_n.eq(1)
self.comb += [
self.cd_sys.clk.eq(clk_in),
self.cd_por.clk.eq(clk_in),
self.cd_sys.rst.eq(~rst_n)
]

class LiteScopeSoC(SoC, AutoCSR):
csr_map = {
"io": 16,
Expand All @@ -37,8 +24,7 @@ def __init__(self, platform):
with_identifier=True,
with_timer=False
)
clk_in = platform.request(platform.default_clk_name)
self.submodules.crg = _CRG(clk_in if not hasattr(clk_in, "p") else clk_in.p)
self.submodules.crg = CRG(platform.request(platform.default_clk_name))

self.submodules.io = LiteScopeIO(8)
for i in range(8):
Expand Down

0 comments on commit a874f85

Please sign in to comment.