I have a little piece of code, that applies again and again, in different places. The places are too irregular, the code is too small, and the input and varies too much to be able to use an entity.
Is there anything macro like in VHDL?
for example:
macro do_something(input_a, output_b);
counter_1 <= counter_1 + 1;
output_b <= input_a & other_input;
other_output <= input_a;
end macro;
-- note: since this uses other_output, it can obviously only be used in one process!
process(clock) begin
if some_condition then
do_something(local_signal_p,local_signal_q);
elsif some_other_condition then
do_something(local_r,local_s);
end if;
end process
The idea would be that the "do_something" would be replaced by the individual instructions.
Is there such a thing?