xics: Rework the irq_gen process
authorPaul Mackerras <paulus@ozlabs.org>
Tue, 19 Oct 2021 04:13:31 +0000 (15:13 +1100)
committerPaul Mackerras <paulus@ozlabs.org>
Mon, 21 Feb 2022 02:29:51 +0000 (13:29 +1100)
commit0aa898c7a6975732f21481487ae44fa7cd5d3503
tree00cf5dff8c5e81665dc5d162d460d65f6cbcb337
parent1720a0584a66976ba711f26409d79847b7017c9b
xics: Rework the irq_gen process

At present, the loop in the irq_gen process generates a chain of
comparators and other logic to work out the source number and priority
of the most-favoured (lowest priority number) pending interrupt.
This replaces that chain with (1) logic to generate an array of bits,
one per priority, indicating whether any interrupt is pending at that
priority, (2) a priority encoder to select the most favoured priority
with an interrupt pending, (3) logic to generate an array of bits, one
per source, indicating whether an interrupt is pending at the priority
calculated in step 2, and (4) a priority encoder to work out the
lowest numbered source that has an interrupt pending at the selected
priority.  This reduces LUT utilization.

The priority encoder function implemented here uses the optimized
count-leading-zeroes logic from helpers.vhdl.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
helpers.vhdl
xics.vhdl