Du kannst auch die bist als enum (wie die States einer FSM) definieren
und das Register als array aus bits mit diesem enum als index.
so etwa:
1 | type T_reg1_bist is (IRS, FLU, OVW, HJK,MNO);
|
2 | type T_REG1 is array T_reg1_bits of std_logic;
|
3 | signal sig_reg1_q: T_REG1 := (others => '0');
|
4 |
|
5 |
|
6 | -- ..
|
7 |
|
8 | if registerwrite then
|
9 | sig_reg1_q(IRS) <= bus(4);
|
10 | --..
|
11 | end if;
|
oder die Indexe mit constanten belegen
1 | constant C_IRS_IDX: natural := 4;
|
2 | signal sig_reg1_q: std_logic_vector(7 downto 0):= (others => '0');
|
3 | -- ..
|
4 |
|
5 | if registerwrite then
|
6 | sig_reg1_q(C_IRS_IDX) <= bus(C_IRS_IDX);
|
7 | --..
|
8 | end if;
|