Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ezynq
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
ezynq
Commits
b2865c4b
Commit
b2865c4b
authored
Sep 12, 2013
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finished clocks calculation
parent
97cc5c68
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
219 additions
and
123 deletions
+219
-123
ezynq_clk.py
ezynq_clk.py
+183
-101
ezynq_clkcfg_defs.py
ezynq_clkcfg_defs.py
+11
-11
ezynq_feature_config.py
ezynq_feature_config.py
+15
-5
ezynqcfg.py
ezynqcfg.py
+3
-0
test.mk
test.mk
+7
-6
No files found.
ezynq_clk.py
View file @
b2865c4b
This diff is collapsed.
Click to expand it.
ezynq_clkcfg_defs.py
View file @
b2865c4b
...
...
@@ -41,13 +41,13 @@ CLK_CFG_DEFS=[
{
'NAME'
:
'FPGA3_MHZ'
,
'CONF_NAME'
:
'CONFIG_EZYNQ_CLK_FPGA3_MHZ'
,
'TYPE'
:
'F'
,
'MANDATORY'
:
False
,
'DERIVED'
:
False
,
'DEFAULT'
:
50.0
,
'DESCRIPTION'
:
'FPGA 3 clock frequency (MHz).'
},
{
'NAME'
:
'FPGA0_SRC'
,
'CONF_NAME'
:
'CONFIG_EZYNQ_CLK_
PLL_
FPGA0_SRC'
,
'TYPE'
:(
'ARM'
,
'DDR'
,
'IO'
,
'NONE'
),
'MANDATORY'
:
False
,
'DERIVED'
:
False
,
'DEFAULT'
:
'IO'
,
{
'NAME'
:
'FPGA0_SRC'
,
'CONF_NAME'
:
'CONFIG_EZYNQ_CLK_FPGA0_SRC'
,
'TYPE'
:(
'ARM'
,
'DDR'
,
'IO'
,
'NONE'
),
'MANDATORY'
:
False
,
'DERIVED'
:
False
,
'DEFAULT'
:
'IO'
,
'DESCRIPTION'
:
'FPGA 0 clock source'
},
{
'NAME'
:
'FPGA1_SRC'
,
'CONF_NAME'
:
'CONFIG_EZYNQ_CLK_
PLL_
FPGA1_SRC'
,
'TYPE'
:(
'ARM'
,
'DDR'
,
'IO'
,
'NONE'
),
'MANDATORY'
:
False
,
'DERIVED'
:
False
,
'DEFAULT'
:
'IO'
,
{
'NAME'
:
'FPGA1_SRC'
,
'CONF_NAME'
:
'CONFIG_EZYNQ_CLK_FPGA1_SRC'
,
'TYPE'
:(
'ARM'
,
'DDR'
,
'IO'
,
'NONE'
),
'MANDATORY'
:
False
,
'DERIVED'
:
False
,
'DEFAULT'
:
'IO'
,
'DESCRIPTION'
:
'FPGA 1 clock source'
},
{
'NAME'
:
'FPGA2_SRC'
,
'CONF_NAME'
:
'CONFIG_EZYNQ_CLK_
PLL_
FPGA2_SRC'
,
'TYPE'
:(
'ARM'
,
'DDR'
,
'IO'
,
'NONE'
),
'MANDATORY'
:
False
,
'DERIVED'
:
False
,
'DEFAULT'
:
'IO'
,
{
'NAME'
:
'FPGA2_SRC'
,
'CONF_NAME'
:
'CONFIG_EZYNQ_CLK_FPGA2_SRC'
,
'TYPE'
:(
'ARM'
,
'DDR'
,
'IO'
,
'NONE'
),
'MANDATORY'
:
False
,
'DERIVED'
:
False
,
'DEFAULT'
:
'IO'
,
'DESCRIPTION'
:
'FPGA 2 clock source'
},
{
'NAME'
:
'FPGA3_SRC'
,
'CONF_NAME'
:
'CONFIG_EZYNQ_CLK_
PLL_
FPGA3_SRC'
,
'TYPE'
:(
'ARM'
,
'DDR'
,
'IO'
,
'NONE'
),
'MANDATORY'
:
False
,
'DERIVED'
:
False
,
'DEFAULT'
:
'IO'
,
{
'NAME'
:
'FPGA3_SRC'
,
'CONF_NAME'
:
'CONFIG_EZYNQ_CLK_FPGA3_SRC'
,
'TYPE'
:(
'ARM'
,
'DDR'
,
'IO'
,
'NONE'
),
'MANDATORY'
:
False
,
'DERIVED'
:
False
,
'DEFAULT'
:
'IO'
,
'DESCRIPTION'
:
'FPGA 3 clock source'
},
{
'NAME'
:
'DDR2X_MHZ'
,
'CONF_NAME'
:
'CONFIG_EZYNQ_CLK_DDR2X_MHZ'
,
'TYPE'
:
'F'
,
'MANDATORY'
:
False
,
'DERIVED'
:
False
,
'DEFAULT'
:
355.556
,
...
...
@@ -79,7 +79,7 @@ CLK_CFG_DEFS=[
'DESCRIPTION'
:
'ARM CPU clock source (normally ARM PLL)'
},
{
'NAME'
:
'DDR_SRC'
,
'CONF_NAME'
:
'CONFIG_EZYNQ_CLK_DDR_SRC'
,
'TYPE'
:(
'ARM'
,
'DDR'
,
'IO'
),
'MANDATORY'
:
False
,
'DERIVED'
:
False
,
'DEFAULT'
:
'DDR'
,
'DESCRIPTION'
:
'DDR (DDR2x, DDR3x) clock source (normally DDR PLL)'
},
{
'NAME'
:
'D
CI_SRC'
,
'CONF_NAME'
:
'CONFIG_EZYNQ_CLK
_DCI_SRC'
,
'TYPE'
:(
'ARM'
,
'DDR'
,
'IO'
),
'MANDATORY'
:
False
,
'DERIVED'
:
False
,
'DEFAULT'
:
'DDR'
,
{
'NAME'
:
'D
DR_DCI_SRC'
,
'CONF_NAME'
:
'CONFIG_EZYNQ_CLK_DDR
_DCI_SRC'
,
'TYPE'
:(
'ARM'
,
'DDR'
,
'IO'
),
'MANDATORY'
:
False
,
'DERIVED'
:
False
,
'DEFAULT'
:
'DDR'
,
'DESCRIPTION'
:
'DDR DCI clock source (normally DDR PLL)'
},
{
'NAME'
:
'SMC_SRC'
,
'CONF_NAME'
:
'CONFIG_EZYNQ_CLK_SMC_SRC'
,
'TYPE'
:(
'ARM'
,
'DDR'
,
'IO'
),
'MANDATORY'
:
False
,
'DERIVED'
:
False
,
'DEFAULT'
:
'IO'
,
'DESCRIPTION'
:
'Static memory controller clock source (normally IO PLL)'
},
...
...
@@ -95,7 +95,7 @@ CLK_CFG_DEFS=[
'DESCRIPTION'
:
'UART controller clock source (normally IO PLL)'
},
{
'NAME'
:
'SPI_SRC'
,
'CONF_NAME'
:
'CONFIG_EZYNQ_CLK_SPI_SRC'
,
'TYPE'
:(
'ARM'
,
'DDR'
,
'IO'
),
'MANDATORY'
:
False
,
'DERIVED'
:
False
,
'DEFAULT'
:
'IO'
,
'DESCRIPTION'
:
'SPI controller clock source (normally IO PLL)'
},
{
'NAME'
:
'CA
M
_SRC'
,
'CONF_NAME'
:
'CONFIG_EZYNQ_CLK_CAN_SRC'
,
'TYPE'
:(
'ARM'
,
'DDR'
,
'IO'
),
'MANDATORY'
:
False
,
'DERIVED'
:
False
,
'DEFAULT'
:
'IO'
,
{
'NAME'
:
'CA
N
_SRC'
,
'CONF_NAME'
:
'CONFIG_EZYNQ_CLK_CAN_SRC'
,
'TYPE'
:(
'ARM'
,
'DDR'
,
'IO'
),
'MANDATORY'
:
False
,
'DERIVED'
:
False
,
'DEFAULT'
:
'IO'
,
'DESCRIPTION'
:
'CAN controller clock source (normally IO PLL)'
},
{
'NAME'
:
'PCAP_SRC'
,
'CONF_NAME'
:
'CONFIG_EZYNQ_CLK_PCAP_SRC'
,
'TYPE'
:(
'ARM'
,
'DDR'
,
'IO'
),
'MANDATORY'
:
False
,
'DERIVED'
:
False
,
'DEFAULT'
:
'IO'
,
'DESCRIPTION'
:
'PCAP controller clock source (normally IO PLL)'
},
...
...
@@ -164,10 +164,10 @@ CLK_CFG_DEFS=[
#CONFIG_EZYNQ_CLK_DDR_MHZ = 533.333333 # DDR clock frequency - DDR_3X (MHz)
#CONFIG_EZYNQ_CLK_ARM_MHZ = 667 # ARM CPU clock frequency cpu_6x4x (MHz)
#CONFIG_EZYNQ_CLK_CPU_MODE = 6_2_1 # CPU clocks set 6:2:1 (6:3:2:1) or 4:2:1 (4:2:2:1)
#CONFIG_EZYNQ_CLK_FPGA0
=
50.0 # FPGA 0 clock frequency (MHz)
#CONFIG_EZYNQ_CLK_FPGA1
=
50.0 # FPGA 1 clock frequency (MHz)
#CONFIG_EZYNQ_CLK_FPGA2
=
50.0 # FPGA 2 clock frequency (MHz)
#CONFIG_EZYNQ_CLK_FPGA3
=
50.0 # FPGA 3 clock frequency (MHz)
#CONFIG_EZYNQ_CLK_FPGA0
_MHZ =
50.0 # FPGA 0 clock frequency (MHz)
#CONFIG_EZYNQ_CLK_FPGA1
_MHZ =
50.0 # FPGA 1 clock frequency (MHz)
#CONFIG_EZYNQ_CLK_FPGA2
_MHZ =
50.0 # FPGA 2 clock frequency (MHz)
#CONFIG_EZYNQ_CLK_FPGA3
_MHZ =
50.0 # FPGA 3 clock frequency (MHz)
#CONFIG_EZYNQ_CLK_FPGA0_SRC = IO # FPGA 0 clock source
#CONFIG_EZYNQ_CLK_FPGA1_SRC = IO # FPGA 1 clock source
#CONFIG_EZYNQ_CLK_FPGA2_SRC = IO # FPGA 2 clock source
...
...
@@ -189,7 +189,7 @@ CLK_CFG_DEFS=[
#CONFIG_EZYNQ_CLK_TRACE_MHZ = 100.0 # Trace Port clock frequency (MHz). Normally 100 Mhz
#CONFIG_EZYNQ_CLK_ARM_SRC = ARM # ARM CPU clock source (normally ARM PLL)
#CONFIG_EZYNQ_CLK_DDR_SRC = DDR # DDR (DDR2x, DDR3x) clock source (normally DDR PLL)
#CONFIG_EZYNQ_CLK_D
CI_SRC =
DDR # DDR DCI clock source (normally DDR PLL)
#CONFIG_EZYNQ_CLK_D
DR_DCI_SRC =
DDR # DDR DCI clock source (normally DDR PLL)
#CONFIG_EZYNQ_CLK_SMC_SRC = IO # Static memory controller clock source (normally IO PLL)
#CONFIG_EZYNQ_CLK_QSPI_SRC = IO # Quad SPI memory controller clock source (normally IO PLL)
#CONFIG_EZYNQ_CLK_GIGE0_SRC = IO # GigE 0 Ethernet controller clock source (normally IO PLL, can be EMIO)
...
...
ezynq_feature_config.py
View file @
b2865c4b
...
...
@@ -45,13 +45,13 @@ class EzynqFeatures:
for
c
in
t
:
if
isinstance
(
c
,
int
):
try
:
if
(
c
==
int
(
value
,
0
)
):
if
c
==
int
(
value
,
0
):
return
c
except
:
pass
elif
isinstance
(
c
,
float
):
try
:
if
(
c
==
float
(
value
)
):
if
c
==
float
(
value
):
return
c
except
:
pass
...
...
@@ -61,7 +61,12 @@ class EzynqFeatures:
elif
value
in
self
.
BOOLEANS
[
0
]:
return
False
elif
isinstance
(
c
,
str
):
return
value
try
:
if
c
.
upper
()
==
value
.
upper
():
return
c
except
:
pass
# return value
else
:
return
None
...
...
@@ -102,8 +107,8 @@ class EzynqFeatures:
continue
if
isinstance
(
feature
[
'TYPE'
],
tuple
):
val
=
self
.
_choice_val
(
feature
[
'TYPE'
],
value
)
if
val
==
None
:
raise
Exception
(
self
.
BOOLEAN
S
[
'ERR_NOT_A_VARIANT'
]
+
': '
+
line
[
'VALUE'
]
+
' is not a valid variant for parameter '
+
if
val
is
None
:
raise
Exception
(
self
.
ERROR
S
[
'ERR_NOT_A_VARIANT'
]
+
': '
+
line
[
'VALUE'
]
+
' is not a valid variant for parameter '
+
conf_name
+
'. Valid are:'
+
str
(
feature
[
'TYPE'
]))
else
:
value
=
val
...
...
@@ -163,6 +168,11 @@ class EzynqFeatures:
return
self
.
defs
[
name
][
'CONF_NAME'
]
except
:
raise
Exception
(
name
+
' not found in self.defs'
)
# should not happen with wrong data, program bug
def
get_par_description
(
self
,
name
):
try
:
return
self
.
defs
[
name
][
'DESCRIPTION'
]
except
:
raise
Exception
(
name
+
' not found in self.defs'
)
# should not happen with wrong data, program bug
def
get_par_value
(
self
,
name
):
try
:
...
...
ezynqcfg.py
View file @
b2865c4b
...
...
@@ -315,6 +315,9 @@ mio_regs.output_mio(f,MIO_HTML_MASK)
# def process_mio(self,raw_configs,warn):
# def output_mio(self,f,MIO_HTML_MASK)
# setregs_mio(self,current_reg_sets,force=True):
clk
.
html_list_clocks
(
f
)
#output_mio(registers,f,mio,MIO_HTML_MASK)
ddr
.
calculate_dependent_pars
(
ddr_mhz
)
...
...
test.mk
View file @
b2865c4b
...
...
@@ -246,13 +246,13 @@ CONFIG_EZYNQ_CLK_PS_MHZ = 33.333333 # PS_CLK System clock input frequency (MHz
CONFIG_EZYNQ_CLK_DDR_MHZ = 533.333333 # DDR clock frequency - DDR_3X (MHz)
CONFIG_EZYNQ_CLK_ARM_MHZ = 667 # ARM CPU clock frequency cpu_6x4x (MHz)
CONFIG_EZYNQ_CLK_CPU_MODE = 6_2_1 # CPU clocks set 6:2:1 (6:3:2:1) or 4:2:1 (4:2:2:1)
CONFIG_EZYNQ_CLK_FPGA0
=
50.0 # FPGA 0 clock frequency (MHz)
CONFIG_EZYNQ_CLK_FPGA1
=
50.0 # FPGA 1 clock frequency (MHz)
CONFIG_EZYNQ_CLK_FPGA2
=
50.0 # FPGA 2 clock frequency (MHz)
CONFIG_EZYNQ_CLK_FPGA3
= 5
0.0 # FPGA 3 clock frequency (MHz)
CONFIG_EZYNQ_CLK_FPGA0
_MHZ =
50.0 # FPGA 0 clock frequency (MHz)
CONFIG_EZYNQ_CLK_FPGA1
_MHZ =
50.0 # FPGA 1 clock frequency (MHz)
CONFIG_EZYNQ_CLK_FPGA2
_MHZ =
50.0 # FPGA 2 clock frequency (MHz)
CONFIG_EZYNQ_CLK_FPGA3
_MHZ =
0.0 # FPGA 3 clock frequency (MHz)
CONFIG_EZYNQ_CLK_FPGA0_SRC = IO # FPGA 0 clock source
CONFIG_EZYNQ_CLK_FPGA1_SRC = IO # FPGA 1 clock source
CONFIG_EZYNQ_CLK_FPGA2_SRC =
IO
# FPGA 2 clock source
CONFIG_EZYNQ_CLK_FPGA2_SRC =
None
# FPGA 2 clock source
CONFIG_EZYNQ_CLK_FPGA3_SRC = IO # FPGA 3 clock source
############# Normally do not need to be modified #############
...
...
@@ -269,9 +269,10 @@ CONFIG_EZYNQ_CLK_SPI_MHZ = 200.0 # SPI controller reference clock frequency
CONFIG_EZYNQ_CLK_CAN_MHZ = 100.0 # CAN controller reference clock frequency (MHz). Normally 100 Mhz
CONFIG_EZYNQ_CLK_PCAP_MHZ = 200.0 # PCAP clock frequency (MHz). Normally 200 Mhz
CONFIG_EZYNQ_CLK_TRACE_MHZ = 100.0 # Trace Port clock frequency (MHz). Normally 100 Mhz
CONFIG_EZYNQ_CLK_ARM_SRC = ARM # ARM CPU clock source (normally ARM PLL)
CONFIG_EZYNQ_CLK_DDR_SRC = DDR # DDR (DDR2x, DDR3x) clock source (normally DDR PLL)
CONFIG_EZYNQ_CLK_D
CI_SRC =
DDR # DDR DCI clock source (normally DDR PLL)
CONFIG_EZYNQ_CLK_D
DR_DCI_SRC =
DDR # DDR DCI clock source (normally DDR PLL)
CONFIG_EZYNQ_CLK_SMC_SRC = IO # Static memory controller clock source (normally IO PLL)
CONFIG_EZYNQ_CLK_QSPI_SRC = IO # Quad SPI memory controller clock source (normally IO PLL)
CONFIG_EZYNQ_CLK_GIGE0_SRC = IO # GigE 0 Ethernet controller clock source (normally IO PLL, can be EMIO)
...
...
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