Skip to content

Commit 0c11fef

Browse files
committed
AXI constellation mapper timing fixes
Added extra delay to constellation mapper IQ and radius RAMs to reduce likelihood of timing failures at higher clk frequencies
1 parent 00fc0ff commit 0c11fef

File tree

2 files changed

+35
-25
lines changed

2 files changed

+35
-25
lines changed

rtl/axi_constellation_mapper.vhd

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,8 @@ begin
364364
DATA_WIDTH => OUTPUT_DATA_WIDTH,
365365
INITIAL_VALUE => MAPPING_TABLE,
366366
TAG_WIDTH => TID_WIDTH + 1,
367-
RAM_TYPE => auto)
367+
RAM_TYPE => auto,
368+
OUTPUT_DELAY => 1)
368369
port map (
369370
clk => clk,
370371
rst => rst,
@@ -397,7 +398,8 @@ begin
397398
DATA_WIDTH => OUTPUT_DATA_WIDTH,
398399
INITIAL_VALUE => RADIUS_TABLE,
399400
TAG_WIDTH => ENCODED_CONFIG_WIDTH,
400-
RAM_TYPE => auto)
401+
RAM_TYPE => auto,
402+
OUTPUT_DELAY => 1)
401403
port map (
402404
clk => clk,
403405
rst => rst,
@@ -425,8 +427,6 @@ begin
425427
radius_1 <= signed(radius_agg(OUTPUT_DATA_WIDTH - 1 downto OUTPUT_DATA_WIDTH/2));
426428
end block;
427429

428-
ram_out.tready <= m_tready;
429-
430430
-- Need the raw offset for 16APSK and 32APSK to determine which radius we should use
431431
ram_out_offset <= unsigned(ram_out_addr) - BASE_OFFSET_16APSK when radius_out_cfg.constellation = mod_16apsk else
432432
unsigned(ram_out_addr) - BASE_OFFSET_32APSK when radius_out_cfg.constellation = mod_32apsk else
@@ -480,26 +480,36 @@ begin
480480
output_q <= ram_out_q * output_multiplier;
481481

482482
-- Add a FF at the output so that the multiplier doesn't cause timing issues
483-
process(clk, rst)
483+
output_block : block
484+
signal tdata_agg_in : std_logic_vector(OUTPUT_DATA_WIDTH + TID_WIDTH downto 0);
485+
signal tdata_agg_out : std_logic_vector(OUTPUT_DATA_WIDTH + TID_WIDTH downto 0);
484486
begin
485-
if rst then
486-
m_tvalid <= '0';
487-
elsif rising_edge(clk) then
488-
if m_tready then
489-
m_tvalid <= '0';
490-
m_tid <= (others => 'U');
491-
m_tlast <= 'U';
492-
m_tdata <= (others => 'U');
493-
end if;
494-
495-
if ram_out.tvalid then
496-
m_tvalid <= '1';
497-
m_tid <= ram_out.tuser;
498-
m_tlast <= ram_out.tlast;
499-
m_tdata <= std_logic_vector(output_i(OUTPUT_DATA_WIDTH - 2 downto OUTPUT_DATA_WIDTH/2 - 1)) &
500-
std_logic_vector(output_q(OUTPUT_DATA_WIDTH - 2 downto OUTPUT_DATA_WIDTH/2 - 1));
501-
end if;
502-
end if;
503-
end process;
487+
488+
tdata_agg_in <= ram_out.tlast
489+
& ram_out.tuser
490+
& std_logic_vector(output_i(OUTPUT_DATA_WIDTH - 2 downto OUTPUT_DATA_WIDTH/2 - 1))
491+
& std_logic_vector(output_q(OUTPUT_DATA_WIDTH - 2 downto OUTPUT_DATA_WIDTH/2 - 1));
492+
493+
output_delay_u : entity fpga_cores.axi_stream_delay
494+
generic map (
495+
DELAY_CYCLES => 1,
496+
TDATA_WIDTH => OUTPUT_DATA_WIDTH + TID_WIDTH + 1)
497+
port map (
498+
-- Usual ports
499+
clk => clk,
500+
rst => rst,
501+
502+
-- AXI slave input
503+
s_tvalid => ram_out.tvalid,
504+
s_tready => ram_out.tready,
505+
s_tdata => tdata_agg_in,
506+
507+
-- AXI master output
508+
m_tvalid => m_tvalid,
509+
m_tready => m_tready,
510+
m_tdata => tdata_agg_out);
511+
512+
(m_tlast, m_tid, m_tdata) <= tdata_agg_out;
513+
end block;
504514

505515
end axi_constellation_mapper;

0 commit comments

Comments
 (0)