I’ve instantiated an array of 32-bit registers and have stored a value in bit 0 of register 0. I wish to use that bit to control my counter but have not succeeded.
My code includes
period_counter = counter(reset=reset, clock=clock, clear=False, enable=register_array[CONTROL_REGISTER_1][COUNT_ENABLE], count=count)
but this fails with
TypeError: '_Block' object does not support indexing
so I moved the bit out to an always_comb block so the code looks like this
period_counter = counter(reset=reset, clock=clock, clear=False, enable=count_enable, count=count)
but I get the same result. Can someone tell me where I have gone astray?