реклама на сайте
подробности

 
 
> Почему может не работать данный код?
Alexsandr000
сообщение Dec 23 2013, 06:15
Сообщение #1


Частый гость
**

Группа: Участник
Сообщений: 97
Регистрация: 23-10-12
Пользователь №: 74 054



есть код:
Код
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_signed.all;
----------------------------------------------------------------------------------
entity MODULE_CUMULATE_SUMM_A is
    Port (
        clk         : in  STD_LOGIC;
            Data_in  : in  STD_LOGIC_VECTOR(11 downto 0);
        Data_in_en  : in  STD_LOGIC;
        Data_in_Val : in  STD_LOGIC;
        Data_out : out STD_LOGIC_VECTOR(21 downto 0);
        Data_out_Val: out STD_LOGIC;
        Data_Start  : out STD_LOGIC
    );
end MODULE_CUMULATE_SUMM_A;
------------------------------------------------------------------------------------
architecture Behavioral of MODULE_CUMULATE_SUMM_A is
------------------------------------------------------------------------------------
    constant NSUMM          : integer := 15000;
    constant Nomber_Strobe  : integer := 100;
------------------------------------------------------------------------------------
    type Memory_Accum is array(0 to 99) of integer;
    signal Memory : Memory_Accum := (others => 0);
    signal Count     : integer := 0;
    signal Position  : integer := 0;
begin
    CS : process(clk)
    begin
        if clk'event and clk = '1' then
            case Data_in_en is
                when '1' =>
                    case Data_in_Val is
                        when '1' =>
                            if Count < NSUMM then
                                Memory(Position) <= CONV_INTEGER(Data_in) + Memory(Position);
                                if Position < 99 then
                                    Position <= Position + 1;
                                elsif Position = 99 then
                                    Position <= 0;
                                    Count <= Count + 1;
                                end if;
                            elsif Count = NSUMM then
                                Data_out <= CONV_STD_LOGIC_VECTOR(CONV_INTEGER(Data_in) + Memory(Position),22);
                                Memory(Position) <= 0;
                                Memory(Position) <= 0;
                                Data_Start <= '1';
                                Data_out_Val <= '1';
                                if Position < 99 then
                                    Position <= Position + 1;
                                elsif Position = 99 then
                                    Position <= 0;
                                    Count <= 0;
                                end if;
                            end if;
                    when others =>
                        Data_out_Val <= '0';
                    end case;
                when others =>
                    Data_out <= (others => '0');
                    Data_Start <= '0';
                    Data_out_Val <= '0';
                    Position <= 0;
            end case;
        end if;
    end process;
end Behavioral;


В isim все работает, однако если "зашивать" в ПЛИС, все благополучно перестает работать...
Однако если NSUMM = 1000, все работает. Кто может сказать, в чем может быть причина?

Сообщение отредактировал Alexsandr000 - Dec 23 2013, 06:16


--------------------
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 22nd July 2025 - 17:04
Рейтинг@Mail.ru


Страница сгенерированна за 0.01384 секунд с 7
ELECTRONIX ©2004-2016