Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Platform-independent core collection
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
18
Issues
18
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Platform-independent core collection
Commits
43fbac98
Commit
43fbac98
authored
Jan 18, 2021
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wishbone/wb_xc7_fw_update: add v2 without startupe2 (for wr2rf)
parent
e1f1aaa6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
141 additions
and
61 deletions
+141
-61
Manifest.py
modules/wishbone/wb_xc7_fw_update/Manifest.py
+1
-0
xwb_xc7_fw_update.vhd
modules/wishbone/wb_xc7_fw_update/xwb_xc7_fw_update.vhd
+29
-61
xwb_xc7_fw_update_v2.vhd
modules/wishbone/wb_xc7_fw_update/xwb_xc7_fw_update_v2.vhd
+111
-0
No files found.
modules/wishbone/wb_xc7_fw_update/Manifest.py
View file @
43fbac98
files
=
[
"wb_xc7_fw_update_regs.vhd"
,
"xwb_xc7_fw_update.vhd"
,
"xwb_xc7_fw_update_v2.vhd"
,
]
modules/wishbone/wb_xc7_fw_update/xwb_xc7_fw_update.vhd
View file @
43fbac98
-------------------------------------------------------------------------------
-- Title : XC7 firmware update
-- Project : General Cores
-------------------------------------------------------------------------------
-- Note: The spi clock is directly connected to the STARTUPE2 module, so it
-- doesn't appear as an output.
-------------------------------------------------------------------------------
-- Copyright (c) 2020-2021 CERN
--
-- Copyright and related rights are licensed under the Solderpad Hardware
-- License, Version 0.51 (the "License") (which enables you, at your option,
-- to treat this file as licensed under the Apache License 2.0); you may not
-- use this file except in compliance with the License. You may obtain a copy
-- of the License at http://solderpad.org/licenses/SHL-0.51.
-- Unless required by applicable law or agreed to in writing, software,
-- hardware and materials distributed under this License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-- or implied. See the License for the specific language governing permissions
-- and limitations under the License.
-------------------------------------------------------------------------------
library
ieee
;
use
ieee
.
std_logic_1164
.
all
;
...
...
@@ -21,71 +42,18 @@ entity xwb_xc7_fw_update is
end
xwb_xc7_fw_update
;
architecture
rtl
of
xwb_xc7_fw_update
is
signal
far_data_in
:
std_logic_vector
(
7
downto
0
);
signal
far_data_out
:
std_logic_vector
(
7
downto
0
);
signal
far_xfer_out
:
std_logic
;
signal
far_ready_in
:
std_logic
;
signal
far_cs_out
:
std_logic
;
signal
far_wr_out
:
std_logic
;
signal
flash_spi_cs
:
std_logic
;
signal
flash_spi_start
:
std_logic
;
signal
flash_spi_wdata
:
std_logic_vector
(
7
downto
0
);
signal
flash_sclk
:
std_logic
;
begin
i
nst_regs
:
entity
work
.
wb_xc7_fw_update_regs
i
_inst
:
entity
work
.
xwb_xc7_fw_update_v2
port
map
(
clk_i
=>
clk_i
,
clk_i
=>
clk_i
,
rst_n_i
=>
rst_n_i
,
wb_i
=>
wb_i
,
wb_o
=>
wb_o
,
far_data_i
=>
far_data_in
,
far_data_o
=>
far_data_out
,
far_xfer_i
=>
'0'
,
far_xfer_o
=>
far_xfer_out
,
far_ready_i
=>
far_ready_in
,
far_ready_o
=>
open
,
far_cs_i
=>
'0'
,
far_cs_o
=>
far_cs_out
,
far_wr_o
=>
far_wr_out
);
-- Need to capture cs and data_out, and need to delay start.
p_host_spi_registers
:
process
(
clk_i
)
begin
if
rising_edge
(
clk_i
)
then
if
rst_n_i
=
'0'
then
flash_spi_start
<=
'0'
;
flash_spi_wdata
<=
(
others
=>
'0'
);
flash_spi_cs
<=
'0'
;
elsif
far_wr_out
=
'1'
then
flash_spi_wdata
<=
far_data_out
;
flash_spi_start
<=
far_xfer_out
;
flash_spi_cs
<=
far_cs_out
;
else
-- Pulse for start.
flash_spi_start
<=
'0'
;
end
if
;
end
if
;
end
process
;
U_SPI_Master
:
entity
work
.
gc_simple_spi_master
generic
map
(
g_div_ratio_log2
=>
0
,
g_num_data_bits
=>
8
)
port
map
(
clk_sys_i
=>
clk_i
,
rst_n_i
=>
rst_n_i
,
cs_i
=>
flash_spi_cs
,
start_i
=>
flash_spi_start
,
cpol_i
=>
'0'
,
data_i
=>
flash_spi_wdata
,
ready_o
=>
far_ready_in
,
data_o
=>
far_data_in
,
spi_cs_n_o
=>
flash_cs_n_o
,
spi_sclk_o
=>
flash_sclk
,
spi_mosi_o
=>
flash_mosi_o
,
spi_miso_i
=>
flash_miso_i
);
wb_i
=>
wb_i
,
wb_o
=>
wb_o
,
flash_cs_n_o
=>
flash_cs_n_o
,
flash_mosi_o
=>
flash_mosi_o
,
flash_miso_i
=>
flash_miso_i
,
flash_sck_o
=>
flash_sclk
);
STARTUPE2_inst
:
STARTUPE2
generic
map
(
...
...
modules/wishbone/wb_xc7_fw_update/xwb_xc7_fw_update_v2.vhd
0 → 100644
View file @
43fbac98
-------------------------------------------------------------------------------
-- Title : XC7 firmware update
-- Project : General Cores
-------------------------------------------------------------------------------
-- Note: Contrary to V1, this version doesn't include the STARTUPE2 module
-- so the spi clock port is added.
-------------------------------------------------------------------------------
-- Copyright (c) 2020-2021 CERN
--
-- Copyright and related rights are licensed under the Solderpad Hardware
-- License, Version 0.51 (the "License") (which enables you, at your option,
-- to treat this file as licensed under the Apache License 2.0); you may not
-- use this file except in compliance with the License. You may obtain a copy
-- of the License at http://solderpad.org/licenses/SHL-0.51.
-- Unless required by applicable law or agreed to in writing, software,
-- hardware and materials distributed under this License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-- or implied. See the License for the specific language governing permissions
-- and limitations under the License.
-------------------------------------------------------------------------------
library
ieee
;
use
ieee
.
std_logic_1164
.
all
;
use
work
.
wishbone_pkg
.
all
;
entity
xwb_xc7_fw_update_v2
is
port
(
clk_i
:
in
std_logic
;
rst_n_i
:
in
std_logic
;
wb_i
:
in
t_wishbone_slave_in
;
wb_o
:
out
t_wishbone_slave_out
;
flash_cs_n_o
:
out
std_logic
;
flash_mosi_o
:
out
std_logic
;
flash_miso_i
:
in
std_logic
;
flash_sck_o
:
out
std_logic
);
end
xwb_xc7_fw_update_v2
;
architecture
rtl
of
xwb_xc7_fw_update_v2
is
signal
far_data_in
:
std_logic_vector
(
7
downto
0
);
signal
far_data_out
:
std_logic_vector
(
7
downto
0
);
signal
far_xfer_out
:
std_logic
;
signal
far_ready_in
:
std_logic
;
signal
far_cs_out
:
std_logic
;
signal
far_wr_out
:
std_logic
;
signal
flash_spi_cs
:
std_logic
;
signal
flash_spi_start
:
std_logic
;
signal
flash_spi_wdata
:
std_logic_vector
(
7
downto
0
);
signal
flash_sclk
:
std_logic
;
begin
inst_regs
:
entity
work
.
wb_xc7_fw_update_regs
port
map
(
clk_i
=>
clk_i
,
rst_n_i
=>
rst_n_i
,
wb_i
=>
wb_i
,
wb_o
=>
wb_o
,
far_data_i
=>
far_data_in
,
far_data_o
=>
far_data_out
,
far_xfer_i
=>
'0'
,
far_xfer_o
=>
far_xfer_out
,
far_ready_i
=>
far_ready_in
,
far_ready_o
=>
open
,
far_cs_i
=>
'0'
,
far_cs_o
=>
far_cs_out
,
far_wr_o
=>
far_wr_out
);
-- Need to capture cs and data_out, and need to delay start.
p_host_spi_registers
:
process
(
clk_i
)
begin
if
rising_edge
(
clk_i
)
then
if
rst_n_i
=
'0'
then
flash_spi_start
<=
'0'
;
flash_spi_wdata
<=
(
others
=>
'0'
);
flash_spi_cs
<=
'0'
;
elsif
far_wr_out
=
'1'
then
flash_spi_wdata
<=
far_data_out
;
flash_spi_start
<=
far_xfer_out
;
flash_spi_cs
<=
far_cs_out
;
else
-- Pulse for start.
flash_spi_start
<=
'0'
;
end
if
;
end
if
;
end
process
;
U_SPI_Master
:
entity
work
.
gc_simple_spi_master
generic
map
(
g_div_ratio_log2
=>
0
,
g_num_data_bits
=>
8
)
port
map
(
clk_sys_i
=>
clk_i
,
rst_n_i
=>
rst_n_i
,
cs_i
=>
flash_spi_cs
,
start_i
=>
flash_spi_start
,
cpol_i
=>
'0'
,
data_i
=>
flash_spi_wdata
,
ready_o
=>
far_ready_in
,
data_o
=>
far_data_in
,
spi_cs_n_o
=>
flash_cs_n_o
,
spi_sclk_o
=>
flash_sclk
,
spi_mosi_o
=>
flash_mosi_o
,
spi_miso_i
=>
flash_miso_i
);
flash_sck_o
<=
flash_sclk
;
end
rtl
;
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