Project

General

Profile

Actions

Task #6539

closed

Support for variants in preparators and comparators

Added by Alexander Kamkin almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Andrei Tatarnikov
Category:
Template Processor
Target version:
Start date:
01/28/2016
Due date:
% Done:

100%

Estimated time:
Detected in build:
svn
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
  }
}
Actions #1

Updated by Andrei Tatarnikov almost 9 years ago

  • Status changed from New to Open

Progress: r6031, r6032, r6033, r6034, r6035, r6036.
Example: r6037.

Actions #2

Updated by Andrei Tatarnikov almost 9 years ago

  • 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)
  }
}
Actions #3

Updated by Andrei Tatarnikov almost 9 years ago

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.

Actions #4

Updated by Andrei Tatarnikov almost 9 years ago

  • Status changed from Resolved to Closed
  • Published in build set to 2.3.20
Actions

Also available in: Atom PDF