Возможность реализована в рамках тестовых шаблонов (конструкция preparator {...}). Вот код из примера VLIW DEMO (vliw_base.rb) с подробными комментариями:
#
# Rules for writing preparators of initializing instruction sequences:
#
# preparator(:target => '<name>') {
# comment 'Initializer for <name>'
# vliw(
# (lui target, value(0, 15)),
# (addi target, target, value(15, 31))
# )
# }
#
# The above code defines an instruction sequence that writes a value
# to the resource referenced via the <name> addressing mode.
#
# Important features:
#
# - The ':target' attribute specifies the name of the target addressing
# mode.
# - The 'target' and 'value' methods specify the target addressing mode
# with all its arguments set and the value passed to the preparator
# respectively. The arguments of the 'value' method specify which part
# of the value is used.
#
#
# The code below specifies an instruction sequence that writes a value
# to the specified general-purpose register (GPR) using the R addressing
# mode.
#
preparator(:target => 'R') {
comment 'Initializer for R'
vliw(
(lui target, value(16, 31)),
(addi target, target, value(0, 15))
)
}
#
# The code below specifies an instruction sequence that writes a value
# to the specified floating-point register (FPR) using the F addressing
# mode.
#
preparator(:target => 'F') {
comment 'Initializer for F'
vliw(
(lui r(25), value(16, 31)), # GPR[25] holds a temporary value
(addi r(25), r(25), value(0, 15))
)
vliw(
(mtf r(25), target),
nop
)
}