E
Edward Fisher
Guest
Hello all,
To aid re-use, my VHDL is heavily parameterised using generics. For example bus, bit-widths, counter maximums, reset high/low etc.
During test benching, these can of course be passed to a UUT via generic map (), but they are treated as block instantiation constants evaluated at elaboration time and cannot be changed as part of the test bench's process.
Scenario:
- Lets say we have a 8-bit counter (BIT_WIDTH = 8) which is given a hard maximum value of 200 (COUNT_MAX = 200). Lets also say we have a block reset that is active high (RST_LEVEL = '1'). I may also have a generate statement in my design that allows the synthesis (or not) of some parity bits (INCLUDE_PARITY = TRUE).
- In my test bench, I may have a series of tests that provide some test vectors. For resets etc, these can use the defined value of RST_LEVEL. However, when it comes to the checking the full scope of the code the test vectors are increased by my use of generics. Reset may only be 0 or 1, but it can be logic high or low, i.e. 4 vectors not 2. If parity is included, I need to check these outputs, but they will be undefined or coded to zeros if INCLUDE_PARITY = FALSE. Likewise, as the counter is parameterised, perhaps I want to check that this is correct over a range of bit-widths (8, 16, 32 or say 12 or 14 etc), the count maximum could also change.
Question:
- For cases where the use of generics increases the possibility space for test vectors and automatic tests, I have previously ran the test bench twice, first for (BIT_WIDTH = 8) and then for (BIT_WIDTH = 16). However, just like my man test vectors, I'd prefer to do this in an automated manner.
- From a test methodology perspective, how do you easily test across multiple generics, not only testing over the possible physical input vectors, but also testing over a large variety of generic combinations?
For Example:
- (BIT_WIDTH = 8)(RST_LEVEL = '1') - All test vectors, then
- (BIT_WIDTH = 8)(RST_LEVEL = '0') - All test vectors, then
- (BIT_WIDTH = 16)(RST_LEVEL = '1') - All test vectors, then
- (BIT_WIDTH = 16)(RST_LEVEL = '0') - All test vectors etc.
Many thanks,
Ed
To aid re-use, my VHDL is heavily parameterised using generics. For example bus, bit-widths, counter maximums, reset high/low etc.
During test benching, these can of course be passed to a UUT via generic map (), but they are treated as block instantiation constants evaluated at elaboration time and cannot be changed as part of the test bench's process.
Scenario:
- Lets say we have a 8-bit counter (BIT_WIDTH = 8) which is given a hard maximum value of 200 (COUNT_MAX = 200). Lets also say we have a block reset that is active high (RST_LEVEL = '1'). I may also have a generate statement in my design that allows the synthesis (or not) of some parity bits (INCLUDE_PARITY = TRUE).
- In my test bench, I may have a series of tests that provide some test vectors. For resets etc, these can use the defined value of RST_LEVEL. However, when it comes to the checking the full scope of the code the test vectors are increased by my use of generics. Reset may only be 0 or 1, but it can be logic high or low, i.e. 4 vectors not 2. If parity is included, I need to check these outputs, but they will be undefined or coded to zeros if INCLUDE_PARITY = FALSE. Likewise, as the counter is parameterised, perhaps I want to check that this is correct over a range of bit-widths (8, 16, 32 or say 12 or 14 etc), the count maximum could also change.
Question:
- For cases where the use of generics increases the possibility space for test vectors and automatic tests, I have previously ran the test bench twice, first for (BIT_WIDTH = 8) and then for (BIT_WIDTH = 16). However, just like my man test vectors, I'd prefer to do this in an automated manner.
- From a test methodology perspective, how do you easily test across multiple generics, not only testing over the possible physical input vectors, but also testing over a large variety of generic combinations?
For Example:
- (BIT_WIDTH = 8)(RST_LEVEL = '1') - All test vectors, then
- (BIT_WIDTH = 8)(RST_LEVEL = '0') - All test vectors, then
- (BIT_WIDTH = 16)(RST_LEVEL = '1') - All test vectors, then
- (BIT_WIDTH = 16)(RST_LEVEL = '0') - All test vectors etc.
Many thanks,
Ed