Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
wr-switch-hdl
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
white-rabbit
wr-switch-hdl
Commits
3abab680
Commit
3abab680
authored
Mar 26, 2012
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wr_softpll_ng: cleaned up, added comments
parent
06371339
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
261 additions
and
125 deletions
+261
-125
wr_softpll_ng.vhd
modules/softpll-new/wr_softpll_ng.vhd
+178
-102
xwr_softpll_ng.vhd
modules/softpll-new/xwr_softpll_ng.vhd
+83
-23
No files found.
modules/softpll-new/wr_softpll_ng.vhd
View file @
3abab680
This diff is collapsed.
Click to expand it.
modules/softpll-new/xwr_softpll_ng.vhd
View file @
3abab680
-------------------------------------------------------------------------------
-- Title : White Rabbit Softcore PLL (new generation) - SoftPLL-ng
-- Project : White Rabbit
-------------------------------------------------------------------------------
-- File : xwr_softpll_ng.vhd
-- Author : Tomasz Włostowski
-- Company : CERN BE-CO-HT
-- Created : 2011-01-29
-- Last update: 2012-03-26
-- Platform : FPGA-generic
-- Standard : VHDL'93
-------------------------------------------------------------------------------
-- Description:
--
-- Struct'ized version of wr_softpll_ng.
-------------------------------------------------------------------------------
--
-- Copyright (c) 2012 CERN
--
-- This source file is free software; you can redistribute it
-- and/or modify it under the terms of the GNU Lesser General
-- Public License as published by the Free Software Foundation;
-- either version 2.1 of the License, or (at your option) any
-- later version.
--
-- This source is distributed in the hope that it will be
-- useful, but WITHOUT ANY WARRANTY; without even the implied
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-- PURPOSE. See the GNU Lesser General Public License for more
-- details.
--
-- You should have received a copy of the GNU Lesser General
-- Public License along with this source; if not, download it
-- from http://www.gnu.org/licenses/lgpl-2.1.html
--
-------------------------------------------------------------------------------
library
ieee
;
use
ieee
.
std_logic_1164
.
all
;
use
ieee
.
numeric_std
.
all
;
use
work
.
gencores_pkg
.
all
;
use
work
.
wishbone_pkg
.
all
;
entity
xwr_softpll_ng
is
generic
(
g_tag_bits
:
integer
;
g_interface_mode
:
t_wishbone_interface_mode
:
=
CLASSIC
;
g_address_granularity
:
t_wishbone_address_granularity
:
=
WORD
;
g_num_ref_inputs
:
integer
;
g_num_outputs
:
integer
;
g_period_detector_ref_mask
:
std_logic_vector
(
31
downto
0
)
:
=
x"ffffffff"
-- Number of bits in phase tags produced by DDMTDs.
-- Must be large enough to cover at least a hundred of DDMTD periods to ensure
-- correct operation of the SoftPLL software servo algorithm - that
-- means, for a typical DMTD frequency offset N=16384, there number of tag bits
-- should be log2(N) + 7 == 21. Note: the value must match the TAG_BITS constant
-- in spll_defs.h file!
g_tag_bits
:
integer
;
-- These two are obvious:
g_num_ref_inputs
:
integer
:
=
1
;
g_num_outputs
:
integer
:
=
1
;
-- When true, an additional period detector is provided, measuring the
-- frequency offset between the DDMTD clock and a chosen reference input clock.
-- The feature is not required by the current version of the SoftPLL servo
-- algorithm, but is kept for testing/debugging purposes.
g_with_period_detector
:
boolean
:
=
false
;
-- When true, an additional FIFO is instantiated, providing a realtime record
-- of user-selectable SoftPLL parameters (e.g. tag values, phase error, DAC drive).
-- These values can be read by "spll_dbg_proxy" daemon for further analysis.
g_with_debug_fifo
:
boolean
:
=
false
;
g_interface_mode
:
t_wishbone_interface_mode
:
=
PIPELINED
;
g_address_granularity
:
t_wishbone_address_granularity
:
=
BYTE
);
port
(
...
...
@@ -43,21 +98,23 @@ entity xwr_softpll_ng is
slave_i
:
in
t_wishbone_slave_in
;
slave_o
:
out
t_wishbone_slave_out
;
debug_o
:
out
std_logic_vector
(
3
downto
0
)
debug_o
:
out
std_logic_vector
(
3
downto
0
);
dbg_fifo_irq_o
:
out
std_logic
);
end
xwr_softpll_ng
;
architecture
wrapper
of
xwr_softpll_ng
is
component
wr_softpll_ng
generic
(
g_tag_bits
:
integer
;
g_
interface_mode
:
t_wishbone_interface_mode
;
g_
address_granularity
:
t_wishbone_address_granularity
;
g_
num_ref_inputs
:
integer
;
g_
num_outputs
:
integer
--
;
-- g_period_detector_ref_mask : std_logic_vector(31 downto 0) := x"ffffffff"
);
g_tag_bits
:
integer
;
g_
num_ref_inputs
:
integer
;
g_
num_outputs
:
integer
;
g_
with_period_detector
:
boolean
;
g_
with_debug_fifo
:
boolean
;
g_interface_mode
:
t_wishbone_interface_mode
;
g_address_granularity
:
t_wishbone_address_granularity
);
port
(
clk_sys_i
:
in
std_logic
;
rst_n_i
:
in
std_logic
;
...
...
@@ -81,19 +138,21 @@ architecture wrapper of xwr_softpll_ng is
wb_ack_o
:
out
std_logic
;
wb_stall_o
:
out
std_logic
;
wb_irq_o
:
out
std_logic
;
debug_o
:
out
std_logic_vector
(
3
downto
0
));
debug_o
:
out
std_logic_vector
(
3
downto
0
);
dbg_fifo_irq_o
:
out
std_logic
);
end
component
;
begin
-- behavioral
U_Wrapped_Softpll
:
wr_softpll_ng
generic
map
(
g_tag_bits
=>
g_tag_bits
,
g_interface_mode
=>
g_interface_mode
,
g_address_granularity
=>
g_address_granularity
,
g_num_ref_inputs
=>
g_num_ref_inputs
,
g_num_outputs
=>
g_num_outputs
)
-- g_period_detector_ref_mask => g_period_detector_ref_mask)
g_tag_bits
=>
g_tag_bits
,
g_interface_mode
=>
g_interface_mode
,
g_address_granularity
=>
g_address_granularity
,
g_num_ref_inputs
=>
g_num_ref_inputs
,
g_num_outputs
=>
g_num_outputs
,
g_with_debug_fifo
=>
g_with_debug_fifo
,
g_with_period_detector
=>
g_with_period_detector
)
port
map
(
clk_sys_i
=>
clk_sys_i
,
rst_n_i
=>
rst_n_i
,
...
...
@@ -117,6 +176,7 @@ begin -- behavioral
wb_ack_o
=>
slave_o
.
ack
,
wb_stall_o
=>
slave_o
.
stall
,
wb_irq_o
=>
slave_o
.
int
,
debug_o
=>
debug_o
);
debug_o
=>
debug_o
,
dbg_fifo_irq_o
=>
dbg_fifo_irq_o
);
end
wrapper
;
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