Skip to content

Commit 56946dc

Browse files
Adjust UART fifo backpressure thresholds-
We really want to assert backpressure *before* we're full Change where we do the resizing for clarity
1 parent 11f53cc commit 56946dc

5 files changed

Lines changed: 8 additions & 6 deletions

File tree

hdl/ip/vhd/espi/peripheral_channel/uart_channel_pkg.vhd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ package uart_channel_pkg is
2525

2626
type uart_resp_t is record
2727
st : st_uart_t;
28-
avail_bytes : std_logic_vector(11 downto 0);
28+
avail_bytes : std_logic_vector(12 downto 0);
2929
end record;
3030

3131
view uart_resp_src of uart_resp_t is

hdl/ip/vhd/espi/peripheral_channel/uart_channel_top.vhd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ begin
102102
-- tx_rusedwds is potentially cycles behind the empty flag due to fifo latencies.
103103
-- since we're using it in the avail bytes, we need to ensure we're at least > 0
104104
sp_to_host_espi.st.valid <= '1' when tx_rempty /= '1' and tx_rusedwds > 0 else '0';
105-
sp_to_host_espi.avail_bytes <= resize(tx_rusedwds, sp_to_host_espi.avail_bytes'length);
105+
sp_to_host_espi.avail_bytes <= tx_rusedwds;
106106
to_sp_uart_valid <= not rx_rempty;
107107

108108
fifo_read_by_espi <= sp_to_host_espi.st.valid and sp_to_host_espi.st.ready;

hdl/ip/vhd/espi/txn_layer/response_processor.vhd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ begin
125125
-- to get this working well we're going to cap the payload at 61 bytes
126126
-- we can re-evaluate this later, but this will support the smallest OOB channel
127127
-- with 3 bytes of SMB headers
128-
response_chan_mux.length <= minimum(sp_to_host_espi.avail_bytes, 61); -- cap to tx max
128+
response_chan_mux.length <= resize(minimum(sp_to_host_espi.avail_bytes, 61), response_chan_mux.length'length); -- cap to tx max
129129
flash_resp.ready <= '0';
130130
resp_data <= sp_to_host_espi.st.data;
131131
sp_to_host_espi.st.ready <= '1' when data_to_host.ready = '1' and r.cur_valid = '1' and r.state = RESPONSE_PAYLOAD else '0';

hdl/projects/cosmo_seq/sp5_uart_subsystem/sp5_uart_subsystem.vhd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ begin
133133
parity => false,
134134
use_hw_handshake => true,
135135
fifo_depth => CONSOLE_FIFO_DEPTH,
136-
full_threshold => CONSOLE_FIFO_DEPTH
136+
full_threshold => CONSOLE_FIFO_ALMOST_FULL
137137
)
138138
port map(
139139
clk => clk,
@@ -180,7 +180,7 @@ begin
180180
parity => false,
181181
use_hw_handshake => true,
182182
fifo_depth => IPCC_FIFO_DEPTH,
183-
full_threshold => IPCC_FIFO_DEPTH
183+
full_threshold => IPCC_FIFO_ALMOST_FULL
184184
)
185185
port map(
186186
clk => clk,

hdl/projects/cosmo_seq/sp5_uart_subsystem/sp5_uart_subsystem_pkg.vhd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ use work.calc_pkg.all;
1313
package sp5_uart_subsystem_pkg is
1414

1515
constant CONSOLE_FIFO_DEPTH : integer := 256; -- FIFO depth for UARTs
16-
constant IPCC_FIFO_DEPTH : integer := 16; -- FIFO depth for IPCC UART
16+
constant CONSOLE_FIFO_ALMOST_FULL : integer := CONSOLE_FIFO_DEPTH - 8; -- Threshold for "almost full" status signal
17+
constant IPCC_FIFO_DEPTH : integer := 32; -- FIFO depth for IPCC UART
18+
constant IPCC_FIFO_ALMOST_FULL : integer := IPCC_FIFO_DEPTH - 8; -- Threshold for "almost full" status signal
1719

1820
-- To the debug interface
1921
type console_uart_dbg_t is record

0 commit comments

Comments
 (0)