Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
litex-boards
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kestrel Collaboration
Kestrel LiteX
litex-boards
Commits
3fc490da
Unverified
Commit
3fc490da
authored
Nov 09, 2020
by
enjoy-digital
Committed by
GitHub
Nov 09, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #121 from davidcorrigan714/master
Lattice NX PLL Support
parents
1f52fbac
97b64d16
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
19 deletions
+21
-19
litex_boards/platforms/crosslink_nx_evn.py
litex_boards/platforms/crosslink_nx_evn.py
+0
-3
litex_boards/targets/crosslink_nx_evn.py
litex_boards/targets/crosslink_nx_evn.py
+21
-16
No files found.
litex_boards/platforms/crosslink_nx_evn.py
View file @
3fc490da
...
...
@@ -418,6 +418,3 @@ class Platform(LatticePlatform):
xcf_template
=
xcf_template_flash
return
LatticeProgrammer
(
xcf_template
)
litex_boards/targets/crosslink_nx_evn.py
View file @
3fc490da
...
...
@@ -16,6 +16,7 @@ from migen.genlib.resetsync import AsyncResetSynchronizer
from
litex_boards.platforms
import
crosslink_nx_evn
from
litex.soc.cores.nxlram
import
NXLRAM
from
litex.soc.cores.clock_nxpll
import
NXPLL
from
litex.soc.cores.spi_flash
import
SpiFlash
from
litex.build.io
import
CRG
from
litex.build.generic_platform
import
*
...
...
@@ -33,24 +34,28 @@ mB = 1024*kB
class
_CRG
(
Module
):
def
__init__
(
self
,
platform
,
sys_clk_freq
):
self
.
rst
=
Signal
()
self
.
clock_domains
.
cd_sys
=
ClockDomain
()
self
.
clock_domains
.
cd_por
=
ClockDomain
()
self
.
clock_domains
.
cd_sys
=
ClockDomain
()
# TODO: replace with PLL
# Clocking
self
.
submodules
.
sys_clk
=
sys_osc
=
NXOSCA
()
sys_osc
.
create_hf_clk
(
self
.
cd_sys
,
sys_clk_freq
)
platform
.
add_period_constraint
(
self
.
cd_sys
.
clk
,
1e9
/
sys_clk_freq
)
rst_n
=
platform
.
request
(
"gsrn"
)
# Power On Reset
por_cycles
=
4096
por_counter
=
Signal
(
log2_int
(
por_cycles
),
reset
=
por_cycles
-
1
)
self
.
comb
+=
self
.
cd_por
.
clk
.
eq
(
self
.
cd_sys
.
clk
)
self
.
sync
.
por
+=
If
(
por_counter
!=
0
,
por_counter
.
eq
(
por_counter
-
1
))
self
.
specials
+=
AsyncResetSynchronizer
(
self
.
cd_por
,
~
rst_n
)
self
.
specials
+=
AsyncResetSynchronizer
(
self
.
cd_sys
,
(
por_counter
!=
0
)
|
self
.
rst
)
# Built in OSC
self
.
submodules
.
hf_clk
=
NXOSCA
()
hf_clk_freq
=
25e6
self
.
hf_clk
.
create_hf_clk
(
self
.
cd_por
,
hf_clk_freq
)
# Power on reset
por_count
=
Signal
(
16
,
reset
=
2
**
16
-
1
)
por_done
=
Signal
()
self
.
comb
+=
por_done
.
eq
(
por_count
==
0
)
self
.
sync
.
por
+=
If
(
~
por_done
,
por_count
.
eq
(
por_count
-
1
))
self
.
rst_n
=
platform
.
request
(
"gsrn"
)
self
.
specials
+=
AsyncResetSynchronizer
(
self
.
cd_por
,
~
self
.
rst_n
)
# PLL
self
.
submodules
.
sys_pll
=
sys_pll
=
NXPLL
(
platform
=
platform
,
create_output_port_clocks
=
True
)
sys_pll
.
register_clkin
(
self
.
cd_por
.
clk
,
hf_clk_freq
)
sys_pll
.
create_clkout
(
self
.
cd_sys
,
sys_clk_freq
)
self
.
specials
+=
AsyncResetSynchronizer
(
self
.
cd_sys
,
~
self
.
sys_pll
.
locked
|
~
por_done
)
# BaseSoC ------------------------------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment