Relatively speaking protected types are a new feature.
Are you willing to post more details on what you
are trying to do?
The array of FIFOs that Paul would like to do sounds interesting.
I would also like to be able to initialize data structures
within the protected type - kind of like a constructor for
classes - but I was thinking I wanted something more like
a generic as a more general mechanism.
Long term, I would like to see protected types turn into
classes - however to do things like this we need user
support in voicing the feature request.
Best,
Jim
I suppose it boils down to how much code you like to write.
The only situation I can think where an array would be useful could
probably be worked around with generate loops, but then you're going
to have seperate processes running where you could just use one
process containing a for loop.
eg:
process
type pattern_gen_array_t is array(0 to N-1) of pattern_gen_t;
variable pattern_gens : pattern_gen_array_t;
begin
wait until rising_edge(clk);
for i in pattern_gens'range loop
pattern_gens(i).get_next_pixel( sigs => stim(i));
end loop;
end process;
instead of:
pattern_gens_gen : for i in 0 to N-1 generate
process
variable pattern_gen : pattern_gen_t;
begin
wait until rising_edge(clk);
pattern_gen.get_next_pixel(sigs => stim(i));
end process;
end generate pattern_gens_gen;
Actually, I can see the 2nd method as alot more useful when you are
reacting to output's from a UUT as you could separate out all of the
elements in an output array, rather than reacting to the entire array
each time one 1 of them changes.
So nothing Im really frustrated I cant do - I was just a bit surprised
when I found I couldnt do method 1.