Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
MasterFIP - Gateware
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
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
MasterFIP - Gateware
Commits
c83385d9
Commit
c83385d9
authored
Mar 17, 2023
by
kblantos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix hanging when MISO FIFO is full. Needs HW test. Clear from unused signals
parent
c27ee562
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
13 deletions
+4
-13
mt_profip_translator.vhd
rtl/mt_profip_translator.vhd
+4
-13
No files found.
rtl/mt_profip_translator.vhd
View file @
c83385d9
...
...
@@ -112,7 +112,6 @@ architecture rtl of mt_profip_translator is
signal
s_spi_mosi_data
:
std_logic_vector
(
g_data_width
-
1
downto
0
);
signal
s_spi_miso_data
:
std_logic_vector
(
g_data_width
-
1
downto
0
);
signal
s_mosi_data
:
std_logic_vector
(
g_data_width
-
1
downto
0
);
-- signal s_wr_control : std_logic_vector(7 downto 0); --! stores the CONTROL byte from MOSI
signal
s_wr_rmq_id
:
std_logic_vector
(
7
downto
0
);
--! stores the RMQ ID byte from MOSI
signal
s_wr_data_len
:
std_logic_vector
(
7
downto
0
);
--! stores the LENGTH byte from MOSI
signal
s_wr_data_cnt
:
unsigned
(
7
downto
0
);
--! counts the number of data bytes from MOSI
...
...
@@ -552,11 +551,6 @@ begin
s_miso_fifo_data_in
(
5
)
<=
(
rmq_snk_i
(
0
)(
5
)
.
hdr
&
rmq_snk_i
(
0
)(
5
)
.
valid
&
rmq_snk_i
(
0
)(
5
)
.
last
&
rmq_snk_i
(
0
)(
5
)
.
error
&
rmq_snk_i
(
0
)(
5
)
.
data
);
s_miso_fifo_data_in
(
6
)
<=
(
rmq_snk_i
(
1
)(
0
)
.
hdr
&
rmq_snk_i
(
1
)(
0
)
.
valid
&
rmq_snk_i
(
1
)(
0
)
.
last
&
rmq_snk_i
(
1
)(
0
)
.
error
&
rmq_snk_i
(
1
)(
0
)
.
data
);
--! Selection of WRITE or READ to/from RMQ: this is the first 32-bits that ERTEC sends when the CS goes LOW
--! this is selected by wr_control(0). So we have:
--! wr_control(0) = '0' --> WRITE to RMQ
--! wr_control(0) = '1' --> READ from RMQ
----------------------------------------------------------------------------
--! RX: MASTERFIP TRANSLATOR --> MT (RMQ)
----------------------------------------------------------------------------
...
...
@@ -577,7 +571,6 @@ begin
begin
if
s_rst_n
=
'0'
then
s_wr_state
<=
IDLE
;
-- s_wr_control <= (others => '0');
s_wr_data_len
<=
(
others
=>
'0'
);
s_wr_header_cnt
<=
(
others
=>
'1'
);
s_wr_data_cnt
<=
(
others
=>
'0'
);
...
...
@@ -591,12 +584,10 @@ begin
when
IDLE
=>
if
(
rmq_src_i
.
ready
=
'1'
and
s_mosi_rd_en
=
'1'
)
then
s_wr_state
<=
BASIC_INFO
;
-- s_wr_control <= s_mosi_fifo_data(31 downto 24);
s_wr_data_len
<=
s_mosi_fifo_data
(
15
downto
8
);
s_wr_header_cnt
<=
(
others
=>
'1'
);
else
s_wr_state
<=
IDLE
;
-- s_wr_control <= (others => '0');
s_wr_data_len
<=
(
others
=>
'0'
);
s_wr_header_cnt
<=
(
others
=>
'1'
);
s_wr_data_cnt
<=
(
others
=>
'0'
);
...
...
@@ -606,10 +597,10 @@ begin
----------------------------------------------------------------
--! STATE BASIC_INFO
when
BASIC_INFO
=>
if
(
rmq_src_i
.
ready
=
'1'
and
s_mosi_rd_en
=
'1'
and
s_operation
=
'0'
)
then
--s_wr_control(0) = '0') then
if
(
rmq_src_i
.
ready
=
'1'
and
s_mosi_rd_en
=
'1'
and
s_operation
=
'0'
)
then
s_wr_data_cnt
<=
unsigned
(
s_wr_data_len
);
-- assign the width of payload in bytes
s_wr_state
<=
HEADER_1
;
elsif
(
s_spi_cs_n
=
'1'
or
s_operation
=
'1'
)
then
--s_wr_control(0) = '1') then
elsif
(
s_spi_cs_n
=
'1'
or
s_operation
=
'1'
)
then
s_wr_state
<=
END_OF_FRAME
;
s_fail
<=
'1'
;
else
...
...
@@ -805,7 +796,7 @@ begin
s_data_valid
<=
'1'
;
s_rd_state
<=
RD_HEADER
;
s_spi_miso_data
<=
s_miso_data_reg
;
elsif
s_miso_fifo_rd_empty
(
s_rmq_id
)
=
'1'
and
s_ready
=
'1'
then
elsif
s_miso_fifo_rd_empty
(
s_rmq_id
)
=
'1'
then
s_data_valid
<=
'1'
;
s_rd_state
<=
ERROR_STATE
;
elsif
s_spi_cs_n
=
'1'
then
...
...
@@ -913,7 +904,7 @@ begin
--! STATE RD_INTERRUPT
when
RD_INTERRUPT
=>
s_data_valid
<=
'0'
;
if
s_miso_fifo_
data_out
(
s_rmq_id
)(
34
)
=
'1'
and
s_miso_fifo_data_out
(
s_rmq_id
)(
33
)
=
'1'
then
-- valid & last
if
s_miso_fifo_
rd_empty
(
s_rmq_id
)
=
'1'
and
s_ready
=
'1'
then
-- valid & last
s_rd_state
<=
END_OF_FRAME
;
else
s_rd_state
<=
RD_INTERRUPT
;
...
...
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