From: Ghostboy on
Hi,

Below you find a part of the code of the PCI core.

I can send a value from the computer to the FPGA and the LEDs on the
development board will always change to the given value.

The problem I have is that not all of the interrupts are detected by the
computer. Sometimes it does, sometimes it doesn't. I look at the detected
interrupts by Linux in /proc/interrupts. So if I enter 5 times a value, it
will detect the interrupts 2 or 3 times.

The generation of the interrupt and the control of the LEDs are in the same
loop so I don't know what the problem could be.


--------------------------------------
--- PCI CORE / IO32 Implementation ---
--------------------------------------

WRITE_MY_IO_REG:
process(RST, CLK)
begin
if RST = '1' then my_io_reg <= "00010000000100000001000000010000";

elsif (CLK'event and CLK = '1') then

if S_DATA_VLD = '1' and bar0_wr_cs = '1' then

intr_n_reg <= '1';

LED <= ADIO (3 downto 0);

if S_CBE(0) = '0' then my_io_reg( 7 downto 0) <= ADIO( 7 downto
0);
end if;
if S_CBE(1) = '0' then my_io_reg(15 downto 8) <= ADIO(15 downto
8);
end if;
if S_CBE(2) = '0' then my_io_reg(23 downto 16) <= ADIO(23 downto
16);
end if;
if S_CBE(3) = '0' then my_io_reg(31 downto 24) <= ADIO(31 downto
24);
end if;

else intr_n_reg <= '0';

end if;
end if;
end process;

INTR_N <= intr_n_reg;

oe_io_reg <= bar0_rd_cs and S_DATA;
ADIO <= my_io_reg when (oe_io_reg = '1') else (others=>'Z');



---------------------------------------
Posted through http://www.EmbeddedRelated.com