📄 anc_edh_processor.vhd
字号:
calc_ap_crc_valid => ap_crc_valid,
calc_ap_crc => ap_crc,
calc_ff_crc_valid => ff_crc_valid,
calc_ff_crc => ff_crc,
flags => flag_bus,
ap_flags => ap_flags_int,
ff_flags => ff_flags_int,
anc_flags => anc_flags_int);
ap_flags <= ap_flags_int;
ff_flags <= ff_flags_int;
anc_flags <= anc_flags_int;
--
-- edh_errcnt module
--
-- This counter increments once for every field that contains an enabled
-- error.
--
edh_all_flags <= (edh_chksum_err & ap_flags_int & ff_flags_int & anc_flags_int);
ERRCNTR : edh_errcnt
port map (
clk => clk,
ce => ce,
rst => rst,
clr_errcnt => clr_errcnt,
count_en => errcnt_en,
flag_enables => errcnt_flg_en,
flags => edh_all_flags,
edh_next => tx_edh_next,
errcnt => errcnt);
--
-- This logic generates an enable for the error counter. The error counter
-- will be disabled after reset. It remains disabled until after the video
-- decoder has locked to the input video stream and the first EDH packet has
-- been received.
--
process(clk, rst)
begin
if (rst = '1') then
errcnt_en <= '0';
elsif (clk'event and clk = '1') then
if (ce = '1') then
if (dec_locked = '1' and dec_edh_next = '1') then
errcnt_en <= '1';
end if;
end if;
end if;
end process;
--
-- anc_demux module
--
-- This module searches for matching ANC packets in the video stream and
-- demultiplexes them, making them available separately from the video
-- stream. Demultiplexed packets can be optionally deleted from the video
-- stream.
--
DMUX : anc_demux
port map (
clk => clk,
ce => ce,
rst => rst,
vid_in => dec_vid,
en_a => en_a,
did_a => did_a,
sdid_a => sdid_a,
del_pkt_a => del_pkt_a,
en_b => en_b,
did_b => did_b,
sdid_b => sdid_b,
del_pkt_b => del_pkt_b,
en_c => en_c,
did_c => did_c,
sdid_c => sdid_c,
del_pkt_c => del_pkt_c,
en_d => en_d,
did_d => did_d,
sdid_d => sdid_d,
del_pkt_d => del_pkt_d,
in_trs => dec_trs,
in_f => dec_f,
in_v => dec_v,
in_h => dec_h,
in_hcnt => dec_hcnt,
in_vcnt => dec_vcnt,
in_sync_switch => dec_sync_switch,
in_eav_next => dec_eav_next,
in_sav_next => dec_sav_next,
in_xyz_word => dec_xyz_word,
in_anc_next => dec_anc_next,
in_edh_next => dec_edh_next,
in_edh_loc => tx_edh_next,
data_out => anc_out,
data_out_valid => anc_out_valid,
match_code => anc_match,
did => did,
dbn => dbn,
sdid => sdid,
dc => dc,
udw => udw,
cs => cs,
vid_out => dmux_vid,
out_trs => dmux_trs,
out_f => dmux_f,
out_v => dmux_v,
out_h => dmux_h,
out_hcnt => dmux_hcnt,
out_vcnt => dmux_vcnt,
out_sync_switch => dmux_sync_switch,
out_eav_next => dmux_eav_next,
out_sav_next => dmux_sav_next,
out_xyz_word => dmux_xyz_word,
out_anc_next => dmux_anc_next,
out_edh_next => dmux_edh_next,
out_edh_loc => dmux_edh_loc);
--
-- anc_mux module
--
-- This module will search for free ANC space and insert an ANC packet into
-- that space.
--
MUX : anc_mux
port map (
clk => clk,
ce => ce,
rst => rst,
vid_in => dmux_vid,
std => dec_std,
hanc_pkt => hanc_pkt,
vanc_pkt => vanc_pkt,
pkt_rdy_in => pkt_rdy_in,
calc_udw_parity => calc_udw_parity,
data_in => anc_in,
ld_did => ld_did,
ld_dbn => ld_dbn,
ld_dc => ld_dc,
ld_udw => ld_udw,
udw_wr_adr => udw_wr_adr,
in_trs => dmux_trs,
in_f => dmux_f,
in_v => dmux_v,
in_h => dmux_h,
in_hcnt => dmux_hcnt,
in_vcnt => dmux_vcnt,
in_sync_switch => dmux_sync_switch,
in_eav_next => dmux_eav_next,
in_sav_next => dmux_sav_next,
in_xyz_word => dmux_xyz_word,
in_anc_next => dmux_anc_next,
in_edh_next => dmux_edh_next,
in_edh_loc => dmux_edh_loc,
vid_out => mux_vid,
pkt_in_empty => pkt_in_empty,
out_trs => mux_trs,
out_f => mux_f,
out_v => mux_v,
out_h => mux_h,
out_hcnt => mux_hcnt,
out_vcnt => mux_vcnt,
out_sync_switch => mux_sync_switch,
out_eav_next => mux_eav_next,
out_sav_next => mux_sav_next,
out_xyz_word => mux_xyz_word,
out_anc_next => mux_anc_next,
out_edh_next => mux_edh_next,
out_edh_loc => mux_edh_loc);
--
-- edh_gen module
--
-- This module generates a new EDH packet based on the calculated CRC words
-- and the incoming and local flags.
--
GEN : edh_gen
port map (
clk => clk,
ce => ce,
rst => rst,
vid_in => mux_vid,
std => dec_std,
locked => dec_locked,
flag_bus => flag_bus,
edh_missing => edh_missing,
in_trs => mux_trs,
in_f => mux_f,
in_v => mux_v,
in_h => mux_h,
in_hcnt => mux_hcnt,
in_vcnt => mux_vcnt,
in_sync_switch => mux_sync_switch,
in_eav_next => mux_eav_next,
in_sav_next => mux_sav_next,
in_xyz_word => mux_xyz_word,
in_anc_next => mux_anc_next,
in_edh_next => mux_edh_next,
in_edh_loc => mux_edh_loc,
vid_out => vid_out,
ap_flag_word => ap_flag_word,
ff_flag_word => ff_flag_word,
anc_flag_word => anc_flag_word,
edh_packet => tx_edh_packet,
out_trs => trs,
out_f => field,
out_v => v_blank,
out_h => h_blank,
out_hcnt => horz_count,
out_vcnt => vert_count,
out_sync_switch => sync_switch,
out_eav_next => eav_next,
out_sav_next => sav_next,
out_xyz_word => xyz_word,
out_anc_next => anc_next,
out_edh_next => edh_next);
--
-- packet_flags
--
-- The various error flags related to the format of received EDH packets are
-- assigned to an error flag vector here.
--
packet_flags <= (edh_format_err & edh_chksum_err & edh_parity_err & edh_missing);
--
-- misc outputs
--
-- These statements assign output ports to several misc. signals.
--
edh_packet <= tx_edh_packet;
std <= dec_std;
std_locked <= dec_std_locked;
locked <= dec_locked;
end synth;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -