def put_value aValue, aFormat = nil, aTime = nil, aDelay = VpiNoDelay
if vpi_get(VpiType, self) == VpiNet
aDelay = VpiForceFlag
if driver = self.to_a(VpiDriver).find {|d| vpi_get(VpiType, d) != VpiForce}
warn "forcing value #{aValue.inspect} onto wire #{self} that is already driven by #{driver.inspect}"
end
end
aFormat =
if aFormat
resolve_prop_type(aFormat)
else
S_vpi_value.detect_format(aValue) ||
get_value_wrapper(VpiObjTypeVal).format
end
if aFormat == VpiIntVal
@size ||= vpi_get(VpiSize, self)
unless @size < INTEGER_BITS
aFormat = VpiHexStrVal
aValue = aValue.to_i.to_s(16)
end
end
aTime ||= S_vpi_time.new(:type => VpiSimTime, :integer => 0)
wrapper = S_vpi_value.new(:format => aFormat)
result = wrapper.write(aValue, aFormat)
vpi_put_value(self, wrapper, aTime, aDelay)
result
end