Simple 8253 (beginner)

Discussion in 'VHDL' started by aleksa, Jul 30, 2008.

  1. aleksa

    aleksa Guest

    This is what I have in mind:

    1. Counter counts to zero, issues an IRQ, and reloads.
    2. The CPU gets the IRQ and writes the new 'reload' value,
    which should remove the IRQ.

    signal counter, reload : STD_LOGIC_VECTOR (15 downto 0);

    if falling_edge(clock) then
    if counter = 0 then
    counter <= reload;
    irq <= '1';
    else
    counter <= counter - 1;
    -- irq <= '0'; -- AUTO EOI
    end if;
    end if;

    if rising_edge(write) then
    reload <= dbus; -- reload value
    irq <= '0'; -- acknowledge IRQ, EOI
    end if;

    If I use one process, webpack is giving me an error:
    Multi-source in Unit <test> on signal <irq>; this signal is connected
    to multiple drivers

    If I use two processes: Signal irq cannot be synthesized.
    Something like, irq is bound to two clocks.

    AUTO EOI works (in simulation, dont even have the chip yet),
    but the clock can be as low as 30Hz, which is too slow.

    How should I ACK an IRQ with the CPU?
     
    aleksa, Jul 30, 2008
    #1
    1. Advertising

  2. aleksa

    Tricky Guest

    On 30 Jul, 21:49, aleksa <> wrote:
    > This is what I have in mind:
    >
    > 1. Counter counts to zero, issues an IRQ, and reloads.
    > 2. The CPU gets the IRQ and writes the new 'reload' value,
    >    which should remove the IRQ.
    >
    >         signal counter, reload : STD_LOGIC_VECTOR (15 downto 0);
    >
    >         if falling_edge(clock) then
    >                 if counter = 0 then
    >                         counter <= reload;
    >                         irq <= '1';
    >                 else
    >                         counter <= counter - 1;
    > --                      irq <= '0';                          -- AUTO EOI
    >                 end if;
    >         end if;
    >
    >         if rising_edge(write) then
    >                         reload <= dbus;                      -- reload value
    >                         irq <= '0';                          -- acknowledge IRQ, EOI
    >         end if;
    >
    > If I use one process, webpack is giving me an error:
    > Multi-source in Unit <test> on signal <irq>; this signal is connected
    > to multiple drivers
    >
    > If I use two processes: Signal irq cannot be synthesized.
    > Something like, irq is bound to two clocks.
    >
    > AUTO EOI works (in simulation, dont even have the chip yet),
    > but the clock can be as low as 30Hz, which is too slow.
    >
    > How should I ACK an IRQ with the CPU?


    You cannot drive 1 signal from multiple sources. You will have to
    create a mux process and a IRQ_select signal that connects IRQ to the
    correct signal at any given time.
     
    Tricky, Jul 31, 2008
    #2
    1. Advertising

  3. aleksa

    aleksa Guest

    On Jul 31, 12:50 pm, Tricky <> wrote:
    > On 30 Jul, 21:49, aleksa <> wrote:
    >
    >
    >
    >
    >
    > > This is what I have in mind:

    >
    > > 1. Counter counts to zero, issues an IRQ, and reloads.
    > > 2. The CPU gets the IRQ and writes the new 'reload' value,
    > >    which should remove the IRQ.

    >
    > >         signal counter, reload : STD_LOGIC_VECTOR (15 downto 0);

    >
    > >         if falling_edge(clock) then
    > >                 if counter = 0 then
    > >                         counter <= reload;
    > >                         irq <= '1';
    > >                 else
    > >                         counter <= counter - 1;
    > > --                      irq <= '0';                          -- AUTO EOI
    > >                 end if;
    > >         end if;

    >
    > >         if rising_edge(write) then
    > >                         reload <= dbus;                      -- reload value
    > >                         irq <= '0';                          -- acknowledge IRQ, EOI
    > >         end if;

    >
    > > If I use one process, webpack is giving me an error:
    > > Multi-source in Unit <test> on signal <irq>; this signal is connected
    > > to multiple drivers

    >
    > > If I use two processes: Signal irq cannot be synthesized.
    > > Something like, irq is bound to two clocks.

    >
    > > AUTO EOI works (in simulation, dont even have the chip yet),
    > > but the clock can be as low as 30Hz, which is too slow.

    >
    > > How should I ACK an IRQ with the CPU?

    >
    > You cannot drive 1 signal from multiple sources. You will have to
    > create a mux process and a IRQ_select signal that connects IRQ to the
    > correct signal at any given time.- Hide quoted text -
    >
    > - Show quoted text -


    Please see comp.arch.fpga for this same subject:
    http://groups.google.com/group/comp.arch.fpga/browse_thread/thread/aca69d92abb698bc?hl=en#
     
    aleksa, Jul 31, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. M.A.Khader

    Beginner: Simple D latch

    M.A.Khader, Aug 19, 2004, in forum: VHDL
    Replies:
    3
    Views:
    5,169
    ivailokroumov
    Aug 19, 2004
  2. Jim H
    Replies:
    1
    Views:
    336
    Natty Gur
    Jul 17, 2003
  3. =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=

    No Class at ALL!!! beginner/beginner question

    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=, Feb 2, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    653
    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=
    Feb 3, 2005
  4. Rensjuh
    Replies:
    7
    Views:
    1,041
    Mabden
    Sep 2, 2004
  5. william nelson

    Beginner's Beginner

    william nelson, Apr 11, 2011, in forum: Ruby
    Replies:
    7
    Views:
    261
    7stud --
    Apr 12, 2011
Loading...

Share This Page