vhdl-extras icon indicating copy to clipboard operation
vhdl-extras copied to clipboard

Would default values for reg_file make sense to you?

Open cweickhmann opened this issue 1 year ago • 0 comments

I'm using reg_file (in its 2008) version and realised that setting default values isn't straightforward. Imho, adding generics

USE_DEFAULT_VALS: boolean := false;
DEFAULT_VALS: reg_array;

and extending the reset branch by

if USE_DEFAULT_VALS then
        registers_loc <= DEFAULT_VALS;
      else
        registers_loc <= (others            => (others => '0'));
      end if;

would solve this and the block would still function identically for anyone happy with default values at all 0.

Have you considered this? Am I totally off in terms of use-case?

cweickhmann avatar Jun 13 '24 11:06 cweickhmann