ref/ruby/classes/Vpi/Handle.src/M000046.html in ruby-vpi-17.0.0 vs ref/ruby/classes/Vpi/Handle.src/M000046.html in ruby-vpi-18.0.0
- old
+ new
@@ -8,37 +8,43 @@
<title>get_value (Vpi::Handle)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
- <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 113</span>
-113: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_value</span> <span class="ruby-identifier">aFormat</span> = <span class="ruby-constant">VpiObjTypeVal</span>
-114: <span class="ruby-identifier">val</span> = <span class="ruby-identifier">get_value_wrapper</span>(<span class="ruby-identifier">resolve_prop_type</span>(<span class="ruby-identifier">aFormat</span>))
-115:
-116: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">format</span>
-117: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiBinStrVal</span>, <span class="ruby-constant">VpiOctStrVal</span>, <span class="ruby-constant">VpiDecStrVal</span>, <span class="ruby-constant">VpiHexStrVal</span>, <span class="ruby-constant">VpiStringVal</span>
-118: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">str</span>
-119:
-120: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiScalarVal</span>
-121: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">scalar</span>
-122:
-123: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiIntVal</span>
-124: <span class="ruby-identifier">get_value_wrapper</span>(<span class="ruby-constant">VpiBinStrVal</span>).<span class="ruby-identifier">value</span>.<span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/[^01]/</span>, <span class="ruby-value str">'0'</span>).<span class="ruby-identifier">to_i</span>(<span class="ruby-value">2</span>)
-125:
-126: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiRealVal</span>
-127: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">real</span>
-128:
-129: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiTimeVal</span>
-130: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">time</span>
-131:
-132: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiVectorVal</span>
-133: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">vector</span>
-134:
-135: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiStrengthVal</span>
-136: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">strength</span>
-137:
-138: <span class="ruby-keyword kw">else</span>
-139: <span class="ruby-identifier">raise</span> <span class="ruby-node">"unknown S_vpi_value.format: #{val.format}"</span>
-140: <span class="ruby-keyword kw">end</span>
-141: <span class="ruby-keyword kw">end</span></pre>
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 118</span>
+118: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_value</span> <span class="ruby-identifier">aFormat</span> = <span class="ruby-constant">VpiIntVal</span>
+119: <span class="ruby-identifier">val</span> = <span class="ruby-identifier">get_value_wrapper</span>(<span class="ruby-identifier">resolve_prop_type</span>(<span class="ruby-identifier">aFormat</span>))
+120:
+121: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">format</span>
+122: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiBinStrVal</span>, <span class="ruby-constant">VpiOctStrVal</span>, <span class="ruby-constant">VpiDecStrVal</span>, <span class="ruby-constant">VpiHexStrVal</span>, <span class="ruby-constant">VpiStringVal</span>
+123: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">str</span>.<span class="ruby-identifier">to_s</span>
+124:
+125: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiScalarVal</span>
+126: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">scalar</span>.<span class="ruby-identifier">to_i</span>
+127:
+128: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiIntVal</span>
+129: <span class="ruby-ivar">@size</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">vpi_get</span>(<span class="ruby-constant">VpiSize</span>, <span class="ruby-keyword kw">self</span>)
+130:
+131: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@size</span> <span class="ruby-operator"><</span> <span class="ruby-constant">INTEGER_BITS</span>
+132: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">integer</span>.<span class="ruby-identifier">to_i</span>
+133: <span class="ruby-keyword kw">else</span>
+134: <span class="ruby-identifier">get_value_wrapper</span>(<span class="ruby-constant">VpiHexStrVal</span>).<span class="ruby-identifier">value</span>.<span class="ruby-identifier">str</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">to_i</span>(<span class="ruby-value">16</span>)
+135: <span class="ruby-keyword kw">end</span>
+136:
+137: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiRealVal</span>
+138: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">real</span>.<span class="ruby-identifier">to_f</span>
+139:
+140: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiTimeVal</span>
+141: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">time</span>
+142:
+143: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiVectorVal</span>
+144: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">vector</span>
+145:
+146: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiStrengthVal</span>
+147: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">strength</span>
+148:
+149: <span class="ruby-keyword kw">else</span>
+150: <span class="ruby-identifier">raise</span> <span class="ruby-node">"unknown S_vpi_value.format: #{val.format.inspect}"</span>
+151: <span class="ruby-keyword kw">end</span>
+152: <span class="ruby-keyword kw">end</span></pre>
</body>
</html>
\ No newline at end of file