tica, Arial, sans-serif">代码的一部分贴上,问题在代码下面:process(reset,clkMuxx,mdi,filterok,filterok_delay,mdi_r,mdi_r_filterok,rxf,rxf_r,mdi_xor_active,s_data_active)
begin
if rising_edge(clk) then
-- filter data
rxf <= rxf(2 downto 0) & mdi;
if ((rxf(3) & rxf(3) & rxf(3)) = rxf(2 downto 0)) then
filterok <= rxf(3);
end if;
--消息是前6位同步头111000,或者000111这样的,然后是32位的消息体
--以上看起来是同步头过滤的作用,但我不理解了,rxf初始值是0000的话,永远不会出现1111啊!--曼彻斯特码除了同步头,内部消息不可能再出现3个以上连起来的111或者000了,这样filterok就永远不变
rxf_r <= rxf_r(2 downto 0) & mdi_r;
if ((rxf_r(3) & rxf_r(3) & rxf_r(3)) = rxf_r(2 downto 0)) then
r_filterok <= rxf_r(3);
end if;
rxf_xor <= rxf_xor(0) & mdi_xor_active;
if ((rxf_xor(1) & rxf_xor(1)) = rxf_xor(1 downto 0)) then
xor_filterok <= rxf_xor(1);
end if;
s_data_active <= s_data_active(6 downto 0) & xor_filterok;
line_active <= '0';
if(( (s_data_active(7) xor s_data_active(6)) or
(s_data_active(7) xor s_data_active(5)) or
(s_data_active(7) xor s_data_active(4)) or
(s_data_active(7) xor s_data_active(3)) or
(s_data_active(7) xor s_data_active(1)) or
(s_data_active(7) xor s_data_active(0)) ) = '1') or (s_data_active(7) = '1') then
line_active <= '1';
end if;
filterok_delay <= filterok;--filterok因为没值,filterok_delay也不会有值
end if;
tick <= filterok xor filterok_delay;
--这个看来是脉冲边沿检测,但看来是值不会变了???
if reset = '0' then
line_active <= '0';
rxf <= (others => '0');
rxf_r <= (others => '0');
filterok <= '0';
r_filterok <= '0';
s_data_active <= (others => '0');
xor_filterok <= '0';
rxf_xor <= (others => '0');
end if;
end process;
-- decode1m
decode_proc:
process(tick,clk,filterok,filterok_delay,line_active,reset, clk_1m,DataBit_cnt_width,
decode_word_flag,bit_cnt_recv,decode_state,dout_wr_cnt_delay,HalfBit_cnt_width)
variable parity_v : std_logic;
begin
if rising_edge(clkMuxx) then
HalfBit_cnt_width <= 0;
if (tick ) = '0' then --record bit gap time
HalfBit_cnt_width <= HalfBit_cnt_width + 1;
--最终问题来了,这个Halbit将会一直+1了,因为tick永远是初值0.。。。求哪位大神给我解惑
end if;
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>