Compare commits

...

2 commits

Author SHA1 Message Date
Xiretza ccd911dc1e vhdl: implement feedback packets 2022-06-05 22:56:29 +02:00
Xiretza d0e65a3126 vhdl: remove unused signals 2022-06-05 22:27:16 +02:00
2 changed files with 34 additions and 42 deletions

View file

@ -119,13 +119,13 @@ architecture a of arty_a7 is
signal pixel_source_src_ip_address : std_logic_vector(31 downto 0); signal pixel_source_src_ip_address : std_logic_vector(31 downto 0);
signal pixel_source_src_port : std_logic_vector(15 downto 0); signal pixel_source_src_port : std_logic_vector(15 downto 0);
signal pixel_source_length : std_logic_vector(15 downto 0);
signal pixel_source_valid : std_logic; signal pixel_source_valid : std_logic;
signal pixel_source_last : std_logic; signal pixel_source_last : std_logic;
signal pixel_source_last_be : std_logic_vector(3 downto 0);
signal pixel_source_ready : std_logic;
signal pixel_source_data : std_logic_vector(31 downto 0); signal pixel_source_data : std_logic_vector(31 downto 0);
signal remote_ip_address : std_logic_vector(31 downto 0);
signal remote_port : std_logic_vector(15 downto 0);
component PLLE2_BASE component PLLE2_BASE
generic ( generic (
CLKFBOUT_MULT : integer; CLKFBOUT_MULT : integer;
@ -189,6 +189,8 @@ architecture a of arty_a7 is
end component BUFG; end component BUFG;
signal sys_reset : std_logic; signal sys_reset : std_logic;
signal frame_done : std_logic;
begin begin
leds_simple <= (others => '0'); leds_simple <= (others => '0');
led0 <= (others => '0'); led0 <= (others => '0');
@ -231,8 +233,8 @@ begin
pixel_bind_port => x"effd", -- port 61437 - "PIXEL" pixel_bind_port => x"effd", -- port 61437 - "PIXEL"
-- sink -- sink
pixel_sink_dst_ip_address => x"0a141e29", pixel_sink_dst_ip_address => remote_ip_address,
pixel_sink_dst_port => x"303a", -- port 12346 pixel_sink_dst_port => remote_port,
pixel_sink_length => pixel_sink_length, pixel_sink_length => pixel_sink_length,
pixel_sink_valid => pixel_sink_valid, pixel_sink_valid => pixel_sink_valid,
@ -245,11 +247,11 @@ begin
pixel_source_src_ip_address => pixel_source_src_ip_address, pixel_source_src_ip_address => pixel_source_src_ip_address,
pixel_source_src_port => pixel_source_src_port, pixel_source_src_port => pixel_source_src_port,
pixel_source_length => pixel_source_length, pixel_source_length => open,
pixel_source_valid => pixel_source_valid, pixel_source_valid => pixel_source_valid,
pixel_source_last => pixel_source_last, pixel_source_last => pixel_source_last,
pixel_source_last_be => pixel_source_last_be, pixel_source_last_be => open,
pixel_source_ready => pixel_source_ready, pixel_source_ready => '1',
pixel_source_data => pixel_source_data pixel_source_data => pixel_source_data
); );
@ -297,29 +299,27 @@ begin
pmod_d <= drivers(23 downto 16); pmod_d <= drivers(23 downto 16);
sender: process(sys_clk) sender: process(sys_clk)
constant COUNTER_MAX: natural := 80000000; variable frame_counter : unsigned(31 downto 0);
variable counter: natural range 0 to COUNTER_MAX;
constant NUM_WORDS: natural := 10;
variable words_sent: natural range 0 to NUM_WORDS;
begin begin
if rising_edge(sys_clk) then if sys_reset then
if counter = COUNTER_MAX then frame_counter := (others => '0');
pixel_sink_length <= std_logic_vector(to_unsigned(NUM_WORDS, 16)); elsif rising_edge(sys_clk) then
pixel_sink_data <= std_logic_vector(to_unsigned(16#30# + words_sent, 32)); if pixel_source_valid then
--pixel_sink_valid <= '1'; remote_ip_address <= pixel_source_src_ip_address;
remote_port <= pixel_source_src_port;
end if;
pixel_sink_last <= '1' when words_sent = NUM_WORDS-1 else '0'; if frame_done then
pixel_sink_length <= x"0004";
pixel_sink_data <= std_logic_vector(frame_counter);
pixel_sink_valid <= '1';
pixel_sink_last <= '1';
if words_sent = NUM_WORDS then frame_counter := frame_counter + 1;
pixel_sink_valid <= '0'; end if;
counter := 0;
words_sent := 0; if pixel_sink_ready and pixel_sink_valid then
elsif pixel_sink_ready then pixel_sink_valid <= '0';
words_sent := words_sent + 1;
end if;
else
counter := counter + 1;
end if; end if;
end if; end if;
end process; end process;
@ -333,16 +333,12 @@ begin
clk => sys_clk, clk => sys_clk,
reset => sys_reset, reset => sys_reset,
udp_src_ip_address => pixel_source_src_ip_address,
udp_src_port => pixel_source_src_port,
udp_length => pixel_source_length,
udp_valid => pixel_source_valid, udp_valid => pixel_source_valid,
udp_last => pixel_source_last, udp_last => pixel_source_last,
udp_last_be => pixel_source_last_be,
udp_ready => pixel_source_ready,
udp_data => pixel_source_data, udp_data => pixel_source_data,
frame_done => frame_done,
drivers => drivers drivers => drivers
); );
end architecture; end architecture;

View file

@ -11,16 +11,12 @@ entity splink is
clk : in std_logic; clk : in std_logic;
reset : in std_logic; reset : in std_logic;
udp_src_ip_address : in std_logic_vector(31 downto 0);
udp_src_port : in std_logic_vector(15 downto 0);
udp_length : in std_logic_vector(15 downto 0);
udp_valid : in std_logic; udp_valid : in std_logic;
udp_last : in std_logic; udp_last : in std_logic;
udp_last_be : in std_logic_vector(3 downto 0);
udp_ready : out std_logic;
udp_data : in std_logic_vector(31 downto 0); udp_data : in std_logic_vector(31 downto 0);
frame_done : out std_logic;
drivers : out std_logic_vector(NUM_STRANDS-1 downto 0) drivers : out std_logic_vector(NUM_STRANDS-1 downto 0)
); );
end entity; end entity;
@ -69,12 +65,14 @@ begin
variable store_counter: natural range 0 to MAX_STRAND_LEN-1; variable store_counter: natural range 0 to MAX_STRAND_LEN-1;
begin begin
if rising_edge(clk) then if rising_edge(clk) then
frame_done <= '0';
current_color <= strand_store(to_integer(unsigned(led_addr))); current_color <= strand_store(to_integer(unsigned(led_addr)));
if udp_valid then if udp_valid then
strand_store(store_counter) <= udp_data(23 downto 0); strand_store(store_counter) <= udp_data(23 downto 0);
if udp_last then if udp_last then
frame_done <= '1';
store_counter := 0; store_counter := 0;
elsif store_counter /= MAX_STRAND_LEN-1 then elsif store_counter /= MAX_STRAND_LEN-1 then
store_counter := store_counter + 1; store_counter := store_counter + 1;
@ -82,6 +80,4 @@ begin
end if; end if;
end if; end if;
end process; end process;
udp_ready <= '1';
end architecture; end architecture;