Changes between Version 6 and Version 7 of Component/Vci Icu


Ignore:
Timestamp:
May 9, 2007, 4:28:06 PM (17 years ago)
Author:
Nicolas Pouillon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Component/Vci Icu

    v6 v7  
    77to 32 independent interrupt lines '''p_irq_in[i]''' to a single
    88'''p_irq''' interrupt line.
     9
    910The active state is high, and the output interrupt is the logical OR of all
    10 input interrupts. 
    11 Each input interrupt can be individually masked
    12 using a memory mapped  32 bits register.
    13 This component can be addresse to return the index of the highest priority
     11input interrupts.
     12Each input interrupt can be individually masked through an internal register.
     13
     14This component can be addressed to return the index of the highest priority
    1415active interrupt '''p_irq_[i]'''.
    1516The priority scheme is fixed : The lower indexes have the highest priority.
    16 The memory segment allocated to this component must be aligned
    17 on 8 bytes boundary.
    18 This hardware component cheks for segmentation violation, and can be used
     17
     18This hardware component checks for segmentation violation, and can be used
    1919as a default target.
    2020
    21 This component contains 2 memory mapped registers:
     21= Memory region layout =
    2222
    23  * '''ICU_INDEX'''     : ADDRESS![2:0] = 0x0
    24 It is actually a 32 bits pseudo-register: A read request
    25 returns the index value of the highest priority active input interrupt.
    26 If there is no active interrupt, it returns the 32 value.
    27 This register is read-only.
     23This component contains 5 memory mapped registers:
    2824
    29  * '''ICU_MASK''' : ADDRESS![2:0] = 0x4
    30 Each bit i of this 32 bits register enables the corresponding
    31 '''p_irq_in[i]''' input interrupt, when this bit is one.
    32 This register can be read or written.A write request of a zero gives resets this register.
    33 This register is write-only.
     25 * `ICU_INT`: ADDRESS![4:0] = 0x0
     26   Each bit in this register reflects the state of the corresponding interrupt line.
     27   This is read-only.
     28
     29 * `ICU_MASK`: ADDRESS![4:0] = 0x4
     30   Each bit in this register reflects the state of the enable for the corresponding interrupt line.
     31   This is read-only.
     32
     33 * `ICU_MASK_SET`: ADDRESS![4:0] = 0x8
     34   Each bit set in the written word will be set in the ICU MASK. (ICU_MASK = ICU_MASK | written_data).
     35   This is write-only.
     36
     37 * `ICU_MASK_CLEAR`: ADDRESS![4:0] = 0xc
     38   Each bit set in the written word will be reset in the ICU MASK. (ICU_MASK = ICU_MASK & ~written_data).
     39   This is write-only.
     40
     41 * `ICU_IT_VECTOR`: ADDRESS![4:0] = 0x10
     42   This register gives the number of the highest-priority active interrupt.
     43   If no interrupt is active, (-1) is returned.
     44   This is read-only.
     45
     46= Component usage =
     47
     48For extensibility issues, you should access your ICU using globally-defined offsets.
     49
     50You should include file source:trunk/soclib/include/soclib/icu.h from your software, it
     51defines `ICU_INT`, `ICU_MASK`, `ICU_MASK_SET`, `ICU_MASK_CLEAR`, `ICU_IT_VECTOR`.
     52
     53Sample code:
     54{{{
     55#include "soclib/icu.h"
     56
     57static const volatile void* timer_address = 0xc0000000;
     58
     59static icu_test(const size_t icu_no)
     60{
     61    volatile int *icu = ((int*)icu_address) + timer_no*ICU_SPAN;
     62
     63    // Getting / setting interrupt mask
     64    uint32_t current_interrupt_mask = icu[ICU_MASK];
     65
     66    // Enabling IRQ #5
     67    icu[ICU_MASK_SET] = 0x20;
     68    // Disabling IRQ #0
     69    icu[ICU_MASK_CLEAR] = 0x1;
     70
     71    // When interrupt is raised, you may do:
     72    int irq_to_serve = icu[ICU_IT_VECTOR];
     73    // This should be equivalent to (see man 3 ffs)
     74    int irq_to_serve = ffs(icu[ICU_IT_VECTOR] & icu[ICU_MASK]);
     75}
     76}}}
     77
     78(add -I/path/to/soclib/include to your compilation command-line)
    3479
    3580= !VciIcu CABA  Implementation =