2016-08-09 2 views
0

나는 XULA2를 가지고 있으며 튜토리얼을 따라야하고 LED 플래시를 켜고 끌 수 있습니다. 이제 전방으로 나아가서 상태 머신을 구현하려고합니다. (기본적으로 똑같은 일을하기 위해 - 현재는) - 경고를 받고 있습니다. 결국 빌드가 출력 파일을 생성하지 못합니다.VHDL - XULA, 유한 상태 기계

오류 폼 (명확성을 위해 제거 된 일부 유사한 경고)의 위치 :

WARNING:Xst:1710 - FF/Latch <wait_time_msec_7> (without init value) has a constant value of 0 in block <BigDisplayMain>. This FF/Latch will be trimmed during the optimization process. 
WARNING:Xst:1710 - FF/Latch <wait_time_msec_8> (without init value) has a constant value of 0 in block <BigDisplayMain>. This FF/Latch will be trimmed during the optimization process... 
WARNING:Xst:1710 - FF/Latch <wait_time_msec_15> (without init value) has a constant value of 0 in block <BigDisplayMain>. This FF/Latch will be trimmed during the optimization process. 
WARNING:Xst:1293 - FF/Latch <fsm_display_1> has a constant value of 0 in block <BigDisplayMain>. This FF/Latch will be trimmed during the optimization process. 
WARNING:Xst:1293 - FF/Latch <fsm_display_0> has a constant value of 0 in block <BigDisplayMain>. This FF/Latch will be trimmed during the optimization process. 
WARNING:Xst:1293 - FF/Latch <cntr_time_delay_19> has a constant value of 0 in block <BigDisplayMain>. This FF/Latch will be trimmed during the optimization process.... 
WARNING:Xst:1293 - FF/Latch <cntr_time_delay_0> has a constant value of 0 in block <BigDisplayMain>. This FF/Latch will be trimmed during the optimization process. 
WARNING:Xst:1710 - FF/Latch <wait_time_msec_9> (without init value) has a constant value of 0 in block <BigDisplayMain>. This FF/Latch will be trimmed during the optimization process.... 
WARNING:Xst:1710 - FF/Latch <wait_time_msec_0> (without init value) has a constant value of 0 in block <BigDisplayMain>. This FF/Latch will be trimmed during the optimization process. 
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <blinker_o> (without init value) has a constant value of 0 in block <BigDisplayMain>. This FF/Latch will be trimmed during the optimization process. 
WARNING:Xst:1898 - Due to constant pushing, FF/Latch <return_state_0> is unconnected in block <BigDisplayMain>. 

. 사용되지 않는 값을 생성 할 수 있습니다 이유

나는

을 그 많은 (나는 이것에 대해 질문이 있습니다,하지만 내 주요 문제가 해결 나중에 후) ... 귀찮게하지 않도록 일부의 FF를 손질 거친 이해를 내 코드에 대한 간단한 설명은 4 상태의 상태 머신입니다 (INIT, START0, START1 and DELAY). 내가 원하는 것은 기기가 INIT에서 시작하고 START0에서 DELAY에서 START1에서 DELAY으로, 그리고 다시 START0 등으로 루프로 진행하여 길을 따라 신호를 (blinker_o을 통해) 토글합니다. 확실히 이것은 LED를 깜빡 거리기 위해 필요한 것보다 더 복잡한 방법이지만, DELAY 상태를 중심으로 한보다 정교한 작업을 수행하는 방법을 배우는 학문적 연습입니다.

어쨌든 컴파일러는 blinker_o이 '0'(WARNING:Xst:1895)으로 고정되어 있다고 결론을 냈습니다. 물론 이것은 내가 원하지 않는 것입니다!

내가만큼 내가

귀하의 시간과 지원이 감사 (이하 "리셋"신호에두고하는 것 이외의) 문제를 설명하기 위해 할 수있는 내 코드를 제거했습니다! 이 디자인을 시뮬레이션 한 것으로 당신은 표시되지 않습니다

---------------------------------------------------------------------------- 
library IEEE; 
use IEEE.STD_LOGIC_1164.ALL; 
use IEEE.STD_LOGIC_UNSIGNED.ALL; 
use IEEE.NUMERIC_STD.ALL; 

library UNISIM; 
use UNISIM.VComponents.all; 

entity BigDisplayMain is 
    port (  clk_i : in std_logic; 
       blinker_o : out std_logic 
     ); 
end BigDisplayMain; 

architecture Behavioral of BigDisplayMain is 

signal  clk_1MHZ : std_logic; 
signal   reset : std_logic := '0'; 
signal wait_time_msec : natural range 0 to 1_000_000; 
signal cntr_time_delay : natural range 0 to 1_000_000; 

type fsmA is (
FSM_INIT, FSM_STATE_DISPLAY_START0, FSM_STATE_DISPLAY_START1, FSM_STATE_DELAY 
); 
signal fsm_display : fsmA; 
signal return_state : fsmA; 

begin 
    -- DCM_CLKGEN: Frequency Aligned Digital Clock Manager 
    --    Spartan-6 
    -- Xilinx HDL Language Template, version 14.7 

    reset <= '0'; 

    DCM_CLKGEN_inst : DCM_SP 
    generic map (
     CLKFX_DIVIDE => 24,  -- Divide value - D - (1-256) 
     CLKFX_MULTIPLY => 2  -- Multiply value - M - (2-256) 
    ) 
    port map (
     CLKFX => clk_1MHZ,   -- 1-bit output: Generated clock output 
     CLKIN => clk_i,   -- 1-bit input: Input clock 
     RST => '0'    -- 1-bit input: Reset input pin 
    ); 

    -- End of DCM_CLKGEN_inst instantiation 

process(clk_1MHz, reset) is 
begin 
    if reset = '1' then 
     cntr_time_delay <= 0; 
     fsm_display <= FSM_INIT; 
     wait_time_msec <= 0; 
     blinker_o <= '0'; 

    elsif rising_edge(clk_1MHZ) then 
     case fsm_display is 
      when FSM_INIT => 
       cntr_time_delay <= 0; 
       wait_time_msec <= 0; 
       return_state <= FSM_STATE_DISPLAY_START0; 

      when FSM_STATE_DISPLAY_INIT_START0 => 
       blinker_o <= '0'; 
       wait_time_msec <= 1_000_000; 
       return_state <= FSM_STATE_DISPLAY_START1; 
       fsm_display <= FSM_STATE_DELAY; 

      when FSM_STATE_DISPLAY_INIT_START1 => 
       blinker_o <= '1'; 
       wait_time_msec <= 999_999; 
       return_state <= FSM_STATE_DISPLAY_START0; 
       fsm_display <= FSM_STATE_DELAY; 

      when FSM_STATE_DELAY => 
       if cntr_time_delay >= wait_time_msec then 
        fsm_display <= return_state; 
        cntr_time_delay <= 0; 
       else 
        cntr_time_delay <= cntr_time_delay + 1; 
        fsm_display <= FSM_STATE_DELAY; 
       end if; 

      when others => 
       null; 
     end case; 

    end if;  
end process; 
end Behavioral; 
+0

오류를 게시하지 않았습니다. 경고는 (대개) 무시할 수 있습니다.이 경우에는 생성 된 논리 볼륨을 줄이는 모든 최적화가 수행됩니다. 설계가 시뮬레이션에서 원하는 것을 수행했다고 가정하면 정상이며 잘못된 것을 나타내지 않습니다. –

답변

1

:

여기에 코드입니다.

  when FSM_STATE_DISPLAY_INIT_START0 => 

  when FSM_STATE_DISPLAY_INIT_START1 => 

형 FSMA에 대한 선언에없는 :

type fsmA is (
FSM_INIT, FSM_STATE_DISPLAY_START0, FSM_STATE_DISPLAY_START1, FSM_STATE_DELAY 
); 

내가 선택을 수정

나는 그것과 선택에 열거 이름 분석 선언 된 fsma 상태와 일치시키고 인스턴스화 된 구성 요소를 주석 처리하여 clk_i를 clk_1MHZ에 할당하고 그것은 일종의 거기에 앉아이 분기없이

   when FSM_INIT => 
        cntr_time_delay <= 0; 
        wait_time_msec <= 0; 
        return_state <= FSM_STATE_DISPLAY_START0; 
        fsm_display <= FSM_STATE_DELAY; -- ADDED branch 

:

library IEEE; 
use IEEE.STD_LOGIC_1164.ALL; 
-- use IEEE.STD_LOGIC_UNSIGNED.ALL; 
-- use IEEE.NUMERIC_STD.ALL; 
-- 
-- library UNISIM; 
-- use UNISIM.VComponents.all; 

entity BigDisplayMain is 
    port ( 
     clk_i:  in std_logic; 
     -- reset:  in std_logic; 
     blinker_o: out std_logic 
     ); 
end BigDisplayMain; 

architecture Behavioral of BigDisplayMain is 

signal  clk_1MHZ: std_logic; 
signal   reset: std_logic := '0'; -- COMMENT out if driven by testbench 
signal wait_time_msec: natural range 0 to 1_000_000; 
signal cntr_time_delay: natural range 0 to 1_000_000; 

type fsmA is (
    FSM_INIT, 
    FSM_STATE_DISPLAY_START0, 
    FSM_STATE_DISPLAY_START1, 
    FSM_STATE_DELAY 
); 
signal fsm_display: fsmA; 
signal return_state: fsmA; 

begin 
    -- DCM_CLKGEN: Frequency Aligned Digital Clock Manager 
    --    Spartan-6 
    -- Xilinx HDL Language Template, version 14.7 

    reset <= '0'; -- COMMENT out if driven by test bench 

    -- DCM_CLKGEN_inst: DCM_SP 
    -- generic map (
    -- CLKFX_DIVIDE => 24,  -- Divide value - D - (1-256) 
    -- CLKFX_MULTIPLY => 2  -- Multiply value - M - (2-256) 
    --) 
    -- port map (
    -- CLKFX => clk_1MHZ,   -- 1-bit output: Generated clock output 
    -- CLKIN => clk_i,   -- 1-bit input: Input clock 
    -- RST => '0'    -- 1-bit input: Reset input pin 
    --); 

    -- End of DCM_CLKGEN_inst instantiation 

    clk_1MHZ <= clk_i; -- ADDED debug 

    process(clk_1MHz, reset) is 
    begin 
     if reset = '1' then 
      cntr_time_delay <= 0; 
      fsm_display <= FSM_INIT; 
      wait_time_msec <= 0; 
      blinker_o <= '0'; 

     elsif rising_edge(clk_1MHZ) then 
      case fsm_display is 
       when FSM_INIT => 
        cntr_time_delay <= 0; 
        wait_time_msec <= 0; 
        return_state <= FSM_STATE_DISPLAY_START0; 
        fsm_display <= FSM_STATE_DELAY; -- ADDED branch 

       when FSM_STATE_DISPLAY_START0 => -- REMOVED _INIT 
        blinker_o <= '0'; 
        wait_time_msec <= 10; -- 1_000_000; -- FOR SIMULATION 
        return_state <= FSM_STATE_DISPLAY_START1; 
        fsm_display <= FSM_STATE_DELAY; 

       when FSM_STATE_DISPLAY_START1 => -- REMOVED _INIT 
        blinker_o <= '1'; 
        wait_time_msec <= 9; -- 999_999; -- FOR SIMULTION 
        return_state <= FSM_STATE_DISPLAY_START0; 
        fsm_display <= FSM_STATE_DELAY; 

       when FSM_STATE_DELAY => 
        if cntr_time_delay >= wait_time_msec then 
         fsm_display <= return_state; 
         cntr_time_delay <= 0; 
        else 
         cntr_time_delay <= cntr_time_delay + 1; 
         fsm_display <= FSM_STATE_DELAY; 
        end if; 
       when others => 
        null; 
      end case; 
     end if;  
    end process; 
end architecture Behavioral; 

library ieee; 
use ieee.std_logic_1164.all; 

entity bigdisplaymain_tb is 
end entity; 

architecture foo of bigdisplaymain_tb is 
    signal clk_i:  std_logic := '0'; 
    -- signal reset:  std_logic := '0'; 
    signal blinker_o: std_logic; 
begin 
CLOCK: 
    process 
    begin 
     wait for 500 ns; 
     clk_i <= not clk_i; 
     if now > 120 us then 
      wait; 
     end if; 
    end process; 

    DUT: 
     entity work.bigdisplaymain 
      port map (
       clk_i => clk_i, 
       -- reset => reset, 
       blinker_o => blinker_o 
      ); 

-- STIMULI: 
--  process 
--  begin 
--   wait for 1 us; 
--   reset <= '1'; 
--   wait for 1 us; 
--   reset <= '0'; 
--   wait; 
--  end process; 

end architecture; 

가 가장 중요한 것은 내가 STATE_DELAY하는 상태 FSM_INIT에서 분기를 추가 : 작은 테스트 벤치를 썼다.단락 시간 지연으로

이주는 9, 10 :

bigdisplaymain_tb.png

그것은 가능성이 상태 FSM_INIT에서 누락 된 지점은 모든 합성 경고에 대한 책임 그리고 플립 먹히는 퍼. 그들 중 누구도 사용되지 않았으며 blinker_o는 재설정 값입니다 (재설정이 실제로 사용되었다고 가정).