I have created a simple script which scans through a number of pins that I define in the top level (N
). If the pins are dead, they will remain high or low usually, or do something unexpected. At the moment, a single pulse is sent down each pin, with a delay of a clock cycle between them.
These pulses are sent to an array named s_pulse
. The size of this array is dynamically created upon synthesis like so:
<snip>
generic (N : natural);
<snip>
PulseGen : for I in 0 to N-1 generate
begin
FMC_IBUF : IBUFDS
generic map (
DIFF_TERM => TRUE,
IOSTANDARD => "DEFAULT")
port map (
O => s_pulse (I) ,
I => pulse_p (I) ,
IB => pulse_n (I)
);
end generate PulseGen;
Then I wish to send out the signal whenever there is one to a std_logic
pin named pulse
, this works but it doesn't work dynamically for obvious reasons like the above, but I can't figure out a way to do it:
if rising_edge(clk) then
pulse <= s_pulse(0) or s_pulse(1) or s_pulse(2) or s_pulse(3)....
end if;
Any ideas on how I can quickly generate a large or
function for each member of the array, or suggest some function I don't know of to make this shorter and more importantly, dynamic?
For the weary traveller, I found a solution:
library ieee;
use ieee.std_logic_misc.all;
<snip>
if rising_edge(clk) then
pulse <= or_reduce(s_fmc);
end if;