Jump to content
    

Stratix II + Ethernet

Так Qsys генерит inout только для шины данных:

Беру из вкладки HDL Example Qsys'а (в VHDL):

component Nios1_proc is
        port (
            clk_0                                                            : in    std_logic                     := 'X';             -- clk
            reset_n                                                          : in    std_logic                     := 'X';             -- reset_n
            out_port_from_the_pio_0                                          : out   std_logic_vector(7 downto 0);                     -- export
            tri_state_bridge_0_bridge_0_out_select_n_to_the_cfi_flash_0      : inout std_logic_vector(0 downto 0)  := (others => 'X'); -- select_n_to_the_cfi_flash_0
            tri_state_bridge_0_bridge_0_out_write_n_to_the_cfi_flash_0       : inout std_logic_vector(0 downto 0)  := (others => 'X'); -- write_n_to_the_cfi_flash_0
            tri_state_bridge_0_bridge_0_out_read_n_to_the_cfi_flash_0        : inout std_logic_vector(0 downto 0)  := (others => 'X'); -- read_n_to_the_cfi_flash_0
            tri_state_bridge_0_bridge_0_out_data_to_and_from_the_cfi_flash_0 : inout std_logic_vector(7 downto 0)  := (others => 'X'); -- data_to_and_from_the_cfi_flash_0
            tri_state_bridge_0_bridge_0_out_address_to_the_cfi_flash_0       : inout std_logic_vector(23 downto 0) := (others => 'X'); -- address_to_the_cfi_flash_0
            tristate_conduit_bridge_0_out_tcm_byteenable_n_out               : inout std_logic_vector(3 downto 0)  := (others => 'X'); -- tcm_byteenable_n_out
            tristate_conduit_bridge_0_out_tcm_irq_in_in                      : in    std_logic_vector(0 downto 0)  := (others => 'X'); -- tcm_irq_in_in
            tristate_conduit_bridge_0_out_tcm_data_out                       : inout std_logic_vector(31 downto 0) := (others => 'X'); -- tcm_data_out
            tristate_conduit_bridge_0_out_tcm_write_n_out                    : inout std_logic_vector(0 downto 0)  := (others => 'X'); -- tcm_write_n_out
            tristate_conduit_bridge_0_out_tcm_reset_out                      : inout std_logic_vector(0 downto 0)  := (others => 'X'); -- tcm_reset_out
            tristate_conduit_bridge_0_out_tcm_chipselect_n_out               : inout std_logic_vector(0 downto 0)  := (others => 'X'); -- tcm_chipselect_n_out
            tristate_conduit_bridge_0_out_tcm_address_out                    : inout std_logic_vector(15 downto 0) := (others => 'X'); -- tcm_address_out
            tristate_conduit_bridge_0_out_tcm_read_n_out                     : inout std_logic_vector(0 downto 0)  := (others => 'X')  -- tcm_read_n_out
        );

Share this post


Link to post
Share on other sites

Взято с форума Альтеры:

Connect pins #BE0, #BE1 to the same named module port pins.

Connect pins A1,A2,A3 to module pins A2,A3,A4.

Tie pins A8,A9 high, all remaining address pins low.

IRQ and Reset connected to obvious pins.

#IOR, #IOW to #RD,#WR.

#ADS, AEN low, LCLK, #BE2,#BE3 high.

 

With the address lines connected as described, your registers should be on 32bit boundaries: BASE+0,BASE+4,BASE+8,etc.

 

As a test try to read the BSR:

write 0x0003 to BASE+0xE, then you should read something like 0x339n from BASE+0xA. You may have to use 0x1C,0x14 instead of 0xE,0xA depending on if you have used any of the built-in macros to do the job. Once this works, you will know what kind of changes will be needed to the driver - mainly shift and mask.

Share this post


Link to post
Share on other sites

Взято с форума Альтеры:

Попробовал так.

Подключил, как написано, пишу 0х0003, читаю 0х3.

Ради интереса записал 0х0007 и 0х0123, прочитал 0х7 и 0х123. По моему, не работает.

А ссылку не кинете на тему альтеровского форума откуда взяли этот текст?

Share this post


Link to post
Share on other sites

А ссылку не кинете на тему альтеровского форума откуда взяли этот текст?

Тут смотрите.

 

 

Попробовал так.

Подключил, как написано, пишу 0х0003, читаю 0х3.

Ради интереса записал 0х0007 и 0х0123, прочитал 0х7 и 0х123. По моему, не работает.

Что-то не понял, почему не работает, что записали то и прочитали. Что не так?

 

Share this post


Link to post
Share on other sites

Что-то не понял, почему не работает, что записали то и прочитали. Что не так?

Да что то не понятно мне.

Пишу:

for(i=0;i<20;i++)
            {
                IOWR_16DIRECT(LAN_BASE_ADDRESS+0xE, 14, 0x0003);
                reg[i]=IORD_16DIRECT(LAN_BASE_ADDRESS+i, 14);
            }

Хочу записывая один регистр, посмотреть, что в других, включая и записанный.

В reg[] после выхода из for какая то ерунда лежит. В том числе и в BASE_ADR+0xA.

Пишу:

   IOWR_16DIRECT(LAN_BASE_ADDRESS+0xE, 14, 0x0003);
            reg2=IORD_16DIRECT(LAN_BASE_ADDRESS+0xA, 14);

            IOWR_16DIRECT(LAN_BASE_ADDRESS+0xE, 14, 0x0003);
            reg3=IORD_16DIRECT(LAN_BASE_ADDRESS+0xB, 14);

            IOWR_16DIRECT(LAN_BASE_ADDRESS+0xE, 14, 0x0003);
            reg4=IORD_16DIRECT(LAN_BASE_ADDRESS+0xC, 14);

            IOWR_16DIRECT(LAN_BASE_ADDRESS+0xE, 14, 0x0003);
            reg5=IORD_16DIRECT(LAN_BASE_ADDRESS+0xD, 14);

Так же, по идее, как и с for, но в результате выдает:

reg2=0х3

reg3=0х300

reg4=0х3

reg5=0х0

Share this post


Link to post
Share on other sites

Исходный проект на DK-NIOS-2S60N и тексты для NiosII от 2009 года в среде QII-7.2 имеются.

Serhiy_UA А Вы бы не могли поделиться этим проектом, если, конечно есть такая возможность.

Я бы попробовал проц в Qsys открыть и посмотреть что куда идет. Да и ethernet софт на Ниос тоже пригодился бы.

Share this post


Link to post
Share on other sites

Serhiy_UA А Вы бы не могли поделиться этим проектом, если, конечно есть такая возможность.

Я бы попробовал проц в Qsys открыть и посмотреть что куда идет. Да и ethernet софт на Ниос тоже пригодился бы.

 

около года назад делал проект на аналогичной плате с ethernet'ом. Среда была насколько помню 9.1 для сборки системы использовал SOPC а не qsys.

С платой шли примеры для ethernet (tcp/ip и web). В качестве основы взял пример tcp/ip, в примере через командную строку можно было светодиоды зажигать на плате Далее в SOPC разобрал этот пример. Нашел функции записи/чтения буфера и отправления пакетов. Так собрал свой проект.

если еще актуально могу поднять проект и посмотреть

Edited by farbius

Share this post


Link to post
Share on other sites

около года назад делал проект на аналогичной плате с ethernet'ом. Среда была насколько помню 9.1 для сборки системы использовал SOPC а не qsys.

С платой шли примеры для ethernet (tcp/ip и web). В качестве основы взял пример tcp/ip, в примере через командную строку можно было светодиоды зажигать на плате Далее в SOPC разобрал этот пример. Нашел функции записи/чтения буфера и отправления пакетов. Так собрал свой проект.

если еще актуально могу поднять проект и посмотреть

Был бы очень благодарен, если бы могли поднять проект. Просто примеров на плату у меня не было, а найти рабочий не получается.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...