Skip to content

Commit

Permalink
Deploying to website from @ a244a54 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorbel1 committed Oct 11, 2024
1 parent 8829398 commit 45c6cde
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 9 deletions.
2 changes: 1 addition & 1 deletion index.json

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions rohd_hcl/ShiftRegister-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,15 @@ <h2>Constructors</h2>

<dl class="constructor-summary-list">
<dt id="ShiftRegister" class="callable">
<span class="name"><a href="../rohd_hcl/ShiftRegister/ShiftRegister.html">ShiftRegister</a></span><span class="signature">(<span class="parameter" id="-param-dataIn"><span class="type-annotation"><a href="https://pub.dev/documentation/rohd/0.5.3/rohd/Logic-class.html">Logic</a></span> <span class="parameter-name">dataIn</span>, {</span><span class="parameter" id="-param-clk"><span>required</span> <span class="type-annotation"><a href="https://pub.dev/documentation/rohd/0.5.3/rohd/Logic-class.html">Logic</a></span> <span class="parameter-name">clk</span>, </span><span class="parameter" id="-param-depth"><span>required</span> <span class="type-annotation"><a href="https://api.dart.dev/stable/3.5.3/dart-core/int-class.html">int</a></span> <span class="parameter-name">depth</span>, </span><span class="parameter" id="-param-enable"><span class="type-annotation"><a href="https://pub.dev/documentation/rohd/0.5.3/rohd/Logic-class.html">Logic</a>?</span> <span class="parameter-name">enable</span>, </span><span class="parameter" id="-param-reset"><span class="type-annotation"><a href="https://pub.dev/documentation/rohd/0.5.3/rohd/Logic-class.html">Logic</a>?</span> <span class="parameter-name">reset</span>, </span><span class="parameter" id="-param-resetValue"><span class="type-annotation">dynamic</span> <span class="parameter-name">resetValue</span>, </span><span class="parameter" id="-param-dataName"><span class="type-annotation"><a href="https://api.dart.dev/stable/3.5.3/dart-core/String-class.html">String</a></span> <span class="parameter-name">dataName</span> = <span class="default-value">&#39;data&#39;</span></span>})</span>
<span class="name"><a href="../rohd_hcl/ShiftRegister/ShiftRegister.html">ShiftRegister</a></span><span class="signature">(<span class="parameter" id="-param-dataIn"><span class="type-annotation"><a href="https://pub.dev/documentation/rohd/0.5.3/rohd/Logic-class.html">Logic</a></span> <span class="parameter-name">dataIn</span>, {</span><span class="parameter" id="-param-clk"><span>required</span> <span class="type-annotation"><a href="https://pub.dev/documentation/rohd/0.5.3/rohd/Logic-class.html">Logic</a></span> <span class="parameter-name">clk</span>, </span><span class="parameter" id="-param-depth"><span>required</span> <span class="type-annotation"><a href="https://api.dart.dev/stable/3.5.3/dart-core/int-class.html">int</a></span> <span class="parameter-name">depth</span>, </span><span class="parameter" id="-param-enable"><span class="type-annotation"><a href="https://pub.dev/documentation/rohd/0.5.3/rohd/Logic-class.html">Logic</a>?</span> <span class="parameter-name">enable</span>, </span><span class="parameter" id="-param-reset"><span class="type-annotation"><a href="https://pub.dev/documentation/rohd/0.5.3/rohd/Logic-class.html">Logic</a>?</span> <span class="parameter-name">reset</span>, </span><span class="parameter" id="-param-asyncReset"><span class="type-annotation"><a href="https://api.dart.dev/stable/3.5.3/dart-core/bool-class.html">bool</a></span> <span class="parameter-name">asyncReset</span> = <span class="default-value">false</span>, </span><span class="parameter" id="-param-resetValue"><span class="type-annotation">dynamic</span> <span class="parameter-name">resetValue</span>, </span><span class="parameter" id="-param-dataName"><span class="type-annotation"><a href="https://api.dart.dev/stable/3.5.3/dart-core/String-class.html">String</a></span> <span class="parameter-name">dataName</span> = <span class="default-value">&#39;data&#39;</span></span>})</span>
</dt>
<dd>
Creates a new shift register with specified <a href="../rohd_hcl/ShiftRegister/depth.html">depth</a> which is only active
when <code>enable</code>d. If <code>reset</code> is provided, it will reset to a default of <code>0</code>
at all stages synchronously with <code>clk</code> or to the provided <code>resetValue</code>.
when <code>enable</code>d. If <code>reset</code> is provided, it will reset synchronously with
<code>clk</code> or aynchronously if <code>asyncReset</code> is true. The <code>reset</code> will reset all
stages to a default of <code>0</code> or to the provided <code>resetValue</code>.
If <code>resetValue</code> is a <a href="https://api.dart.dev/stable/3.5.3/dart-core/List-class.html">List</a> the stages will reset to the corresponding
value in the list.
</dd>
</dl>
</section>
Expand Down
34 changes: 29 additions & 5 deletions rohd_hcl/ShiftRegister/ShiftRegister.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ <h1><span class="kind-constructor">ShiftRegister</span> constructor
<li><span class="parameter" id="-param-depth"><span>required</span> <span class="type-annotation"><a href="https://api.dart.dev/stable/3.5.3/dart-core/int-class.html">int</a></span> <span class="parameter-name">depth</span>, </span></li>
<li><span class="parameter" id="-param-enable"><span class="type-annotation"><a href="https://pub.dev/documentation/rohd/0.5.3/rohd/Logic-class.html">Logic</a>?</span> <span class="parameter-name">enable</span>, </span></li>
<li><span class="parameter" id="-param-reset"><span class="type-annotation"><a href="https://pub.dev/documentation/rohd/0.5.3/rohd/Logic-class.html">Logic</a>?</span> <span class="parameter-name">reset</span>, </span></li>
<li><span class="parameter" id="-param-asyncReset"><span class="type-annotation"><a href="https://api.dart.dev/stable/3.5.3/dart-core/bool-class.html">bool</a></span> <span class="parameter-name">asyncReset</span> = <span class="default-value">false</span>, </span></li>
<li><span class="parameter" id="-param-resetValue"><span class="type-annotation">dynamic</span> <span class="parameter-name">resetValue</span>, </span></li>
<li><span class="parameter" id="-param-dataName"><span class="type-annotation"><a href="https://api.dart.dev/stable/3.5.3/dart-core/String-class.html">String</a></span> <span class="parameter-name">dataName</span> = <span class="default-value">&#39;data&#39;</span>, </span></li>
</ol>})
Expand All @@ -75,8 +76,11 @@ <h1><span class="kind-constructor">ShiftRegister</span> constructor

<section class="desc markdown">
<p>Creates a new shift register with specified <a href="../../rohd_hcl/ShiftRegister/depth.html">depth</a> which is only active
when <code>enable</code>d. If <code>reset</code> is provided, it will reset to a default of <code>0</code>
at all stages synchronously with <code>clk</code> or to the provided <code>resetValue</code>.</p>
when <code>enable</code>d. If <code>reset</code> is provided, it will reset synchronously with
<code>clk</code> or aynchronously if <code>asyncReset</code> is true. The <code>reset</code> will reset all
stages to a default of <code>0</code> or to the provided <code>resetValue</code>.
If <code>resetValue</code> is a <a href="https://api.dart.dev/stable/3.5.3/dart-core/List-class.html">List</a> the stages will reset to the corresponding
value in the list.</p>
</section>


Expand All @@ -89,6 +93,7 @@ <h2><span>Implementation</span></h2>
required this.depth,
Logic? enable,
Logic? reset,
bool asyncReset = false,
dynamic resetValue,
this.dataName = &#39;data&#39;,
}) : width = dataIn.width,
Expand All @@ -99,6 +104,7 @@ <h2><span>Implementation</span></h2>
addOutput(&#39;${dataName}_out&#39;, width: width);

Map&lt;Logic, dynamic&gt;? resetValues;

if (reset != null) {
reset = addInput(&#39;reset&#39;, reset);

Expand All @@ -107,6 +113,23 @@ <h2><span>Implementation</span></h2>
resetValue =
addInput(&#39;resetValue&#39;, resetValue, width: resetValue.width);
}

if (resetValue is List) {
&#47;&#47; Check if list length is equal to depth
if (resetValue.length != depth) {
throw RohdHclException(
&#39;ResetValue list length must equal shift register depth.&#39;);
}

for (var i = 0; i &lt; resetValue.length; i++) {
final element = resetValue[i];
if (element is Logic) {
resetValue[i] =
addInput(&#39;resetValue$i&#39;, element, width: element.width);
}
}
}

resetValues = {};
}
}
Expand All @@ -117,7 +140,8 @@ <h2><span>Implementation</span></h2>
for (var i = 0; i &lt; depth; i++) {
final stageI = addOutput(_stageName(i), width: width);
conds.add(stageI &lt; dataStage);
resetValues?[stageI] = resetValue;

resetValues?[stageI] = resetValue is List ? resetValue[i] : resetValue;
dataStage = stageI;
}

Expand All @@ -127,8 +151,8 @@ <h2><span>Implementation</span></h2>
conds = [If(enable, then: conds)];
}

Sequential(
clk,
Sequential.multi(
[clk, if (asyncReset &amp;&amp; reset != null) reset],
reset: reset,
resetValues: resetValues,
conds,
Expand Down

0 comments on commit 45c6cde

Please sign in to comment.