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
ce669ac8
Commit
ce669ac8
authored
Mar 05, 2021
by
Florent Kermarrec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
targets/nexys_video: Add optional VideoTerminal/VideoFramebuffer.
parent
21207533
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
16 deletions
+33
-16
litex_boards/targets/nexys_video.py
litex_boards/targets/nexys_video.py
+33
-16
No files found.
litex_boards/targets/nexys_video.py
View file @
ce669ac8
...
...
@@ -18,6 +18,7 @@ from litex.soc.cores.clock import *
from
litex.soc.integration.soc_core
import
*
from
litex.soc.integration.soc_sdram
import
*
from
litex.soc.integration.builder
import
*
from
litex.soc.cores.video
import
VideoS7HDMIPHY
from
litex.soc.cores.led
import
LedChaser
from
litedram.modules
import
MT41K256M16
...
...
@@ -34,7 +35,8 @@ class _CRG(Module):
self
.
clock_domains
.
cd_sys4x
=
ClockDomain
(
reset_less
=
True
)
self
.
clock_domains
.
cd_sys4x_dqs
=
ClockDomain
(
reset_less
=
True
)
self
.
clock_domains
.
cd_idelay
=
ClockDomain
()
self
.
clock_domains
.
cd_clk100
=
ClockDomain
()
self
.
clock_domains
.
cd_hdmi
=
ClockDomain
()
self
.
clock_domains
.
cd_hdmi5x
=
ClockDomain
()
# # #
...
...
@@ -48,7 +50,8 @@ class _CRG(Module):
pll
.
create_clkout
(
self
.
cd_sys4x
,
4
*
sys_clk_freq
)
pll
.
create_clkout
(
self
.
cd_sys4x_dqs
,
4
*
sys_clk_freq
,
phase
=
90
)
pll
.
create_clkout
(
self
.
cd_idelay
,
200e6
)
pll
.
create_clkout
(
self
.
cd_clk100
,
100e6
)
pll
.
create_clkout
(
self
.
cd_hdmi
,
40e6
)
pll
.
create_clkout
(
self
.
cd_hdmi5x
,
5
*
40e6
)
platform
.
add_false_path_constraints
(
self
.
cd_sys
.
clk
,
pll
.
clkin
)
# Ignore sys_clk to pll.clkin path created by SoC's rst.
self
.
submodules
.
idelayctrl
=
S7IDELAYCTRL
(
self
.
cd_idelay
)
...
...
@@ -56,7 +59,7 @@ class _CRG(Module):
# BaseSoC ------------------------------------------------------------------------------------------
class
BaseSoC
(
SoCCore
):
def
__init__
(
self
,
toolchain
=
"vivado"
,
sys_clk_freq
=
int
(
100e6
),
with_ethernet
=
False
,
with_sata
=
False
,
**
kwargs
):
def
__init__
(
self
,
toolchain
=
"vivado"
,
sys_clk_freq
=
int
(
100e6
),
with_ethernet
=
False
,
with_sata
=
False
,
with_video_terminal
=
False
,
with_video_framebuffer
=
False
,
**
kwargs
):
platform
=
nexys_video
.
Platform
(
toolchain
=
toolchain
)
# SoCCore ----------------------------------------------------------------------------------
...
...
@@ -123,6 +126,16 @@ class BaseSoC(SoCCore):
# Core
self
.
add_sata
(
phy
=
self
.
sata_phy
,
mode
=
"read+write"
)
# Video Terminal ---------------------------------------------------------------------------
if
with_video_terminal
:
self
.
submodules
.
videophy
=
VideoS7HDMIPHY
(
platform
.
request
(
"hdmi_out"
),
clock_domain
=
"hdmi"
)
self
.
add_video_terminal
(
phy
=
self
.
videophy
,
timings
=
"800x600@60Hz"
,
clock_domain
=
"hdmi"
)
# Video Framebuffer ------------------------------------------------------------------------
if
with_video_framebuffer
:
self
.
submodules
.
videophy
=
VideoS7HDMIPHY
(
platform
.
request
(
"hdmi_out"
),
clock_domain
=
"hdmi"
)
self
.
add_video_framebuffer
(
phy
=
self
.
videophy
,
timings
=
"800x600@60Hz"
,
clock_domain
=
"hdmi"
)
# Leds -------------------------------------------------------------------------------------
self
.
submodules
.
leds
=
LedChaser
(
pads
=
platform
.
request_all
(
"user_led"
),
...
...
@@ -133,25 +146,29 @@ class BaseSoC(SoCCore):
def
main
():
parser
=
argparse
.
ArgumentParser
(
description
=
"LiteX SoC on Nexys Video"
)
parser
.
add_argument
(
"--toolchain"
,
default
=
"vivado"
,
help
=
"Toolchain use to build (default: vivado)"
)
parser
.
add_argument
(
"--build"
,
action
=
"store_true"
,
help
=
"Build bitstream"
)
parser
.
add_argument
(
"--load"
,
action
=
"store_true"
,
help
=
"Load bitstream"
)
parser
.
add_argument
(
"--sys-clk-freq"
,
default
=
100e6
,
help
=
"System clock frequency (default: 100MHz)"
)
parser
.
add_argument
(
"--with-ethernet"
,
action
=
"store_true"
,
help
=
"Enable Ethernet support"
)
sdopts
=
parser
.
add_mutually_exclusive_group
()
sdopts
.
add_argument
(
"--with-spi-sdcard"
,
action
=
"store_true"
,
help
=
"Enable SPI-mode SDCard support"
)
sdopts
.
add_argument
(
"--with-sdcard"
,
action
=
"store_true"
,
help
=
"Enable SDCard support"
)
parser
.
add_argument
(
"--with-sata"
,
action
=
"store_true"
,
help
=
"Enable SATA support (over FMCRAID)"
)
parser
.
add_argument
(
"--toolchain"
,
default
=
"vivado"
,
help
=
"Toolchain use to build (default: vivado)"
)
parser
.
add_argument
(
"--build"
,
action
=
"store_true"
,
help
=
"Build bitstream"
)
parser
.
add_argument
(
"--load"
,
action
=
"store_true"
,
help
=
"Load bitstream"
)
parser
.
add_argument
(
"--sys-clk-freq"
,
default
=
100e6
,
help
=
"System clock frequency (default: 100MHz)"
)
parser
.
add_argument
(
"--with-ethernet"
,
action
=
"store_true"
,
help
=
"Enable Ethernet support"
)
sdopts
=
parser
.
add_mutually_exclusive_group
()
sdopts
.
add_argument
(
"--with-spi-sdcard"
,
action
=
"store_true"
,
help
=
"Enable SPI-mode SDCard support"
)
sdopts
.
add_argument
(
"--with-sdcard"
,
action
=
"store_true"
,
help
=
"Enable SDCard support"
)
parser
.
add_argument
(
"--with-sata"
,
action
=
"store_true"
,
help
=
"Enable SATA support (over FMCRAID)"
)
parser
.
add_argument
(
"--with-video-terminal"
,
action
=
"store_true"
,
help
=
"Enable Video Terminal (HDMI)"
)
parser
.
add_argument
(
"--with-video-framebuffer"
,
action
=
"store_true"
,
help
=
"Enable Video Framebuffer (HDMI)"
)
builder_args
(
parser
)
soc_sdram_args
(
parser
)
vivado_build_args
(
parser
)
args
=
parser
.
parse_args
()
soc
=
BaseSoC
(
toolchain
=
args
.
toolchain
,
sys_clk_freq
=
int
(
float
(
args
.
sys_clk_freq
)),
with_ethernet
=
args
.
with_ethernet
,
with_sata
=
args
.
with_sata
,
toolchain
=
args
.
toolchain
,
sys_clk_freq
=
int
(
float
(
args
.
sys_clk_freq
)),
with_ethernet
=
args
.
with_ethernet
,
with_sata
=
args
.
with_sata
,
with_video_terminal
=
args
.
with_video_terminal
,
with_video_framebuffer
=
args
.
with_video_framebuffer
,
**
soc_sdram_argdict
(
args
)
)
if
args
.
with_spi_sdcard
:
...
...
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