Task #6539
closed
Support for variants in preparators and comparators
Added by Alexander Kamkin almost 9 years ago.
Updated almost 9 years ago.
Assignee:
Andrei Tatarnikov
Category:
Template Processor
Published in build:
2.3.20
Description
There is a need to randomize preparators/comparators when generating test programs. A possible solution is to define several variants and randomly choose one of them.
preparator(mode, pattern) {
variant(name, weight) {
ori target, zero, 0
}
...
variant(name, weight) {
sub target, target, target
}
}
- Status changed from New to Open
Progress: r6031, r6032, r6033, r6034, r6035, r6036.
Example: r6037.
- Status changed from Open to Resolved
- % Done changed from 0 to 100
Done. Syntax is the following:
preparator(:target => 'REG') {
# Attributes:
#
# name - allows to refer the variant by its name
# bias - specifies bias for the preparator variant
#
# Both attributes are optional.
#
variant(:name => 'X', :bias => 30) {
comment 'Variant 1'
lui target, value(16, 31)
ori target, target, value(0, 15)
}
# Unnamed variant with no bias specified.
#
# Such style can be used to specify equally probable variants.
#
variant {
comment 'Variant 2'
lui target, value(16, 31)
ori target, target, value(0, 15)
}
}
Working to support addressing preparator variant by name from the "prepare" function:
r6038, r6039, r6040, r6041, r6042, r6043
Now it possible to pass the function "prepare" an additional argument that specifies the name of the preferred preparator variant. For example:
prepare t5, 0xdeadbeef, '2'
prepare t6, 0xbaadf00d, '1'
NOTE: Search by variant name is performed after a suitable preparator is chosen by value mask and argument values.
If a variant with the specified name is not defined for the chosen preparator, MicroTESK uses a randomly chosen variant of the given preparator.
- Status changed from Resolved to Closed
- Published in build set to 2.3.20
Also available in: Atom
PDF