Skip to content

Commit

Permalink
Add PE config calculator
Browse files Browse the repository at this point in the history
Co-authored-by: Hidde Moll <hidde@qbaylogic.com>
Co-authored-by: Ryan Slawson <ryan@qbaylogic.com>
  • Loading branch information
3 people committed Mar 6, 2025
1 parent a4fa2b8 commit 9fad017
Show file tree
Hide file tree
Showing 7 changed files with 463 additions and 6 deletions.
6 changes: 4 additions & 2 deletions bittide-instances/src/Bittide/Instances/Hitl/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ neighbors (via the index position in the vector) according to the
different hardware interfaces on the boards.
-}
fpgaSetup :: Vec FpgaCount (FpgaId, Vec LinkCount (Index FpgaCount))
{- FOURMOLU_DISABLE -}
fpgaSetup =
-- FPGA Id SFP0 SFP1 J4 J5 J6 J7 SMA
("210308B3B272", 3 :> 2 :> 4 :> 5 :> 6 :> 7 :> 1 :> Nil)
-- FPGA Id SFP0 SFP1 J4 J5 J6 J7 SMA
("210308B3B272", 3 :> 2 :> 4 :> 5 :> 6 :> 7 :> 1 :> Nil)
:> ("210308B0992E", 2 :> 3 :> 5 :> 6 :> 7 :> 4 :> 0 :> Nil)
:> ("210308B0AE73", 1 :> 0 :> 6 :> 7 :> 4 :> 5 :> 3 :> Nil)
:> ("210308B0AE6D", 0 :> 1 :> 7 :> 4 :> 5 :> 6 :> 2 :> Nil)
Expand All @@ -66,6 +67,7 @@ fpgaSetup =
:> ("210308B3A22D", 5 :> 4 :> 2 :> 1 :> 0 :> 3 :> 7 :> Nil)
:> ("210308B0B0C2", 4 :> 5 :> 3 :> 2 :> 1 :> 0 :> 6 :> Nil)
:> Nil
{- FOURMOLU_ENABLE -}

{- | The IDs of the Digilent chips on each of the FPGA boards of the test
setup. The indices match the position of each FPGA in the mining rig.
Expand Down
8 changes: 4 additions & 4 deletions bittide-instances/tests/unittests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ tests :: TestTree
tests =
testGroup
"Unittests"
[ CaptureUgn.tests
[ Axi.tests
, CaptureUgn.tests
, ClockControlWb.tests
, ScatterGather.tests
, SwitchDemoProcessingElement.tests
, DnaPortE2.tests
, Ord.tests
, ScatterGather.tests
, SwitchDemoProcessingElement.tests
, Time.tests
, Axi.tests
, Watchdog.tests
]

Expand Down
2 changes: 2 additions & 0 deletions bittide/bittide.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ library
Bittide.SharedTypes
Bittide.Switch
Bittide.SwitchDemoProcessingElement
Bittide.SwitchDemoProcessingElement.Calculator
Bittide.Transceiver
Bittide.Transceiver.Cdc
Bittide.Transceiver.Comma
Expand Down Expand Up @@ -223,6 +224,7 @@ test-suite unittests
Tests.StabilityChecker
Tests.Switch
Tests.SwitchDemoProcessingElement
Tests.SwitchDemoProcessingElement.Calculator
Tests.Transceiver
Tests.Transceiver.Prbs
Tests.Transceiver.WordAlign
Expand Down
154 changes: 154 additions & 0 deletions bittide/imgs/ugn_calculator.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
<mxfile host="65bd71144e">
<diagram id="EFb3Onlqe7iecdpRckU-" name="Page-1">
<mxGraphModel dx="1688" dy="938" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
<mxGeometry x="160" y="160" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="3" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="280" y="160" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="4" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="400" y="160" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="5" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
<mxGeometry x="520" y="160" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="6" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="640" y="160" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="7" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="760" y="160" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="8" value="clock domain cross" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="160" y="240" as="sourcePoint"/>
<mxPoint x="880" y="240" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="9" value="" style="whiteSpace=wrap;html=1;aspect=fixed;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry y="140" width="80" height="80" as="geometry"/>
</mxCell>
<mxCell id="10" value="" style="whiteSpace=wrap;html=1;aspect=fixed;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry y="260" width="80" height="80" as="geometry"/>
</mxCell>
<mxCell id="11" value="&lt;b&gt;Example 1: &lt;/b&gt;The blue node finishes reading at ` startWriteAtClosestTo`. It finishes reading &lt;b&gt;before&lt;/b&gt; the yellow node starts reading from the link the blue node writes to. Scheduler picks &quot;linkStart0&quot; as a start (and therefore k)" style="text;html=1;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="470" width="410" height="80" as="geometry"/>
</mxCell>
<mxCell id="12" value="dstCycle&lt;br&gt;&lt;br&gt;srcCycle" style="endArrow=classic;html=1;entryX=0.667;entryY=1;entryDx=0;entryDy=0;entryPerimeter=0;endFill=1;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="230" y="280" as="sourcePoint"/>
<mxPoint x="230.03999999999996" y="200" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="14" value="k" style="endArrow=classic;startArrow=classic;html=1;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="230" y="210" as="sourcePoint"/>
<mxPoint x="400" y="210" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="15" value="prevCalendarStart" style="endArrow=classic;html=1;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="160" y="80" as="sourcePoint"/>
<mxPoint x="160" y="150" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="16" value="linkStart0" style="endArrow=classic;html=1;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="400" y="80" as="sourcePoint"/>
<mxPoint x="400" y="150" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="17" value="linkStart1" style="endArrow=classic;html=1;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="759.1700000000001" y="80" as="sourcePoint"/>
<mxPoint x="759.1700000000001" y="150" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="18" value="linkSelectOffset" style="endArrow=classic;startArrow=classic;html=1;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="160" y="70" as="sourcePoint"/>
<mxPoint x="400" y="70" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="20" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
<mxGeometry x="160" y="560" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="21" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="280" y="560" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="22" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="400" y="560" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="23" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
<mxGeometry x="520" y="560" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="24" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="640" y="560" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="25" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="760" y="560" width="120" height="40" as="geometry"/>
</mxCell>
<mxCell id="26" value="clock domain cross" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="160" y="640" as="sourcePoint"/>
<mxPoint x="880" y="640" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="27" value="" style="whiteSpace=wrap;html=1;aspect=fixed;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry y="540" width="80" height="80" as="geometry"/>
</mxCell>
<mxCell id="28" value="" style="whiteSpace=wrap;html=1;aspect=fixed;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry y="660" width="80" height="80" as="geometry"/>
</mxCell>
<mxCell id="29" value="&lt;b&gt;Example 2: &lt;/b&gt;The blue node finishes reading at ` startWriteAtClosestTo`. It finishes reading &lt;b&gt;after&lt;/b&gt; the yellow node starts reading from the link the blue node writes to. Scheduler picks &quot;linkStart0&quot; as a start (and therefore k)" style="text;html=1;align=right;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="470" y="400" width="410" height="80" as="geometry"/>
</mxCell>
<mxCell id="30" value="dstCycle&lt;br&gt;&lt;br&gt;srcCycle" style="endArrow=classic;html=1;entryX=0.667;entryY=1;entryDx=0;entryDy=0;entryPerimeter=0;endFill=1;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="440" y="680" as="sourcePoint"/>
<mxPoint x="440.03999999999996" y="600" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="31" value="k" style="endArrow=classic;startArrow=classic;html=1;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="440" y="610" as="sourcePoint"/>
<mxPoint x="760" y="610" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="32" value="prevCalendarStart" style="endArrow=classic;html=1;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="160" y="480" as="sourcePoint"/>
<mxPoint x="160" y="550" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="33" value="linkStart0" style="endArrow=classic;html=1;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="400" y="480" as="sourcePoint"/>
<mxPoint x="400" y="550" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="34" value="linkStart1" style="endArrow=classic;html=1;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="759.1700000000001" y="480" as="sourcePoint"/>
<mxPoint x="759.1700000000001" y="550" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="35" value="linkSelectOffset" style="endArrow=classic;startArrow=classic;html=1;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="160" y="470" as="sourcePoint"/>
<mxPoint x="400" y="470" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="36" value="startWriteAtClosestTo" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="200" y="280" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="37" value="startWriteAtClosestTo" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="410" y="680" width="60" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Loading

0 comments on commit 9fad017

Please sign in to comment.