Whatever I was working on
This commit is contained in:
@@ -64,3 +64,55 @@ the last written one is.
|
|||||||
We can just say the last written one was 2 I guess
|
We can just say the last written one was 2 I guess
|
||||||
|
|
||||||
We also need an input that tells it to reset the accumulator
|
We also need an input that tells it to reset the accumulator
|
||||||
|
|
||||||
|
What if instead of calculating all the way up to R^16 I just calculated up to r^8
|
||||||
|
and then just had 2 parallel blocks?
|
||||||
|
|
||||||
|
Lets think about the worst case throughput. The theoretical layout would have
|
||||||
|
8 of these in parallel. A minimum size packet of 64 bytes for example, is 512
|
||||||
|
bits. This is less than 128*8, so it would only take one round. Therefore, we
|
||||||
|
take 16 cycles to do 64 bytes, or 32 bits per cycle. This is only 1/4 of our
|
||||||
|
target throughput. In order to reach our target throughput of 128 bits per cycle,
|
||||||
|
|
||||||
|
If the packet is enough to fit into the second phase of the multiplier, then it
|
||||||
|
can run in parallel and give up to 256 bits per 16 cycles. In order for this to
|
||||||
|
happen, the packet size must be greater than 128*16, or 256 bytes. I would really
|
||||||
|
like to be able to reach our target throughput with 64 byte packets, so we may
|
||||||
|
need to have more smaller multipliers that can run in parallle, at the cost of
|
||||||
|
latency for larger packets.
|
||||||
|
|
||||||
|
a 64 byte packet is 512 bytes, which takes up 4 128 bit lanes. If we have a group
|
||||||
|
of 2 multipliers, they can do 128\*2\*2 bits per 16 cycles, or 512 bits per 16
|
||||||
|
cycles, which is 32 bits per cycle as we said earlier. To hit our target of 128
|
||||||
|
bits per cycle we just instantiate 4 of them. This results in the same number of
|
||||||
|
multipliers (8), but configured differently to prioritize throughput over latency.
|
||||||
|
|
||||||
|
We need to have a demux or whatever go between the groups.
|
||||||
|
|
||||||
|
If we only do 4 effective lanes in parallel, then we only need to do the multiply
|
||||||
|
loop twice
|
||||||
|
|
||||||
|
r->r^2
|
||||||
|
|
||||||
|
This will take 26 cycles, which is not ideal. Could we figure out a way to do all
|
||||||
|
of these powers in one step, taking only 13 cycles?
|
||||||
|
|
||||||
|
Alternatively, we could only do a single parallel step and just calculate R^2. This
|
||||||
|
would mean we have 8 different hashes going on at the same time, and would drastically
|
||||||
|
increase latency, but I think that is a fair tradeoff
|
||||||
|
|
||||||
|
So basically we need to store incoming data as 128 bit words. We will first get
|
||||||
|
r and s as 128 bit words. We store both and start work on squaring r. We will
|
||||||
|
also be recieving data this whole time at 128 bits per cycle which we store in
|
||||||
|
a FIFO. Once R^2 is calculated, we start running it through the multiplier, with
|
||||||
|
a counter that tells us when we should be using R and when we should be using
|
||||||
|
r^2. We only have 1 value to worry about, when we get the last value we only
|
||||||
|
use R instead of R^2. we also need to remember to store the outputs on both
|
||||||
|
last cycles. Since we are storing the data in a FIFO, we will know which is the
|
||||||
|
last. There is also a possibility that the data will not be a full 128 bits, so
|
||||||
|
we need to handle adding the leading 1 as well.
|
||||||
|
|
||||||
|
We can use 1 multiplier, 2 data fifos, 2 constant buffers.
|
||||||
|
|
||||||
|
The utilization of the multiplier is kinda low though since its only used
|
||||||
|
once per packet instaead of every 16 bytes
|
||||||
@@ -1,144 +1,128 @@
|
|||||||
<mxfile host="Electron" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/26.2.2 Chrome/134.0.6998.178 Electron/35.1.2 Safari/537.36" version="26.2.2">
|
<mxfile host="Electron" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/26.2.2 Chrome/134.0.6998.178 Electron/35.1.2 Safari/537.36" version="26.2.2">
|
||||||
<diagram name="Page-1" id="gIy_vrPza4QP03Kn0wfk">
|
<diagram name="Page-1" id="b4c9RxKzofB-lxyaVzG6">
|
||||||
<mxGraphModel dx="655" dy="442" 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">
|
<mxGraphModel dx="794" dy="536" 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>
|
<root>
|
||||||
<mxCell id="0" />
|
<mxCell id="0" />
|
||||||
<mxCell id="1" parent="0" />
|
<mxCell id="1" parent="0" />
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-24" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="GA09nmFLpfHeItamLD5O-1" target="GA09nmFLpfHeItamLD5O-21">
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-19" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.75;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="FEGHAENOx_VuAQpIDQKO-1" target="FEGHAENOx_VuAQpIDQKO-15">
|
||||||
<mxGeometry relative="1" as="geometry" />
|
<mxGeometry relative="1" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-25" value="r" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="GA09nmFLpfHeItamLD5O-24">
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-20" value="last" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="FEGHAENOx_VuAQpIDQKO-19">
|
||||||
<mxGeometry x="0.5579" y="-1" relative="1" as="geometry">
|
<mxGeometry x="-0.5549" y="-1" relative="1" as="geometry">
|
||||||
<mxPoint x="9" y="5" as="offset" />
|
<mxPoint y="9" as="offset" />
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-35" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.75;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="GA09nmFLpfHeItamLD5O-1" target="GA09nmFLpfHeItamLD5O-34">
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-1" value="data fifo" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="120" y="120" width="280" height="40" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.75;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="FEGHAENOx_VuAQpIDQKO-2" target="FEGHAENOx_VuAQpIDQKO-1">
|
||||||
<mxGeometry relative="1" as="geometry" />
|
<mxGeometry relative="1" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-38" value="s" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="GA09nmFLpfHeItamLD5O-35">
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.25;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="FEGHAENOx_VuAQpIDQKO-2" target="FEGHAENOx_VuAQpIDQKO-6">
|
||||||
<mxGeometry x="-0.6624" y="1" relative="1" as="geometry">
|
|
||||||
<mxPoint x="-9" y="-9" as="offset" />
|
|
||||||
</mxGeometry>
|
|
||||||
</mxCell>
|
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-1" value="r/s" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
|
||||||
<mxGeometry x="360" y="200" width="80" height="40" as="geometry" />
|
|
||||||
</mxCell>
|
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-2" value="" style="endArrow=classic;html=1;rounded=0;entryX=0;entryY=0.25;entryDx=0;entryDy=0;" edge="1" parent="1" target="GA09nmFLpfHeItamLD5O-1">
|
|
||||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
||||||
<mxPoint x="320" y="210" as="sourcePoint" />
|
|
||||||
<mxPoint x="410" y="270" as="targetPoint" />
|
|
||||||
</mxGeometry>
|
|
||||||
</mxCell>
|
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-3" value="otk" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="GA09nmFLpfHeItamLD5O-2">
|
|
||||||
<mxGeometry x="-0.3946" y="1" relative="1" as="geometry">
|
|
||||||
<mxPoint x="-22" as="offset" />
|
|
||||||
</mxGeometry>
|
|
||||||
</mxCell>
|
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="GA09nmFLpfHeItamLD5O-4" target="GA09nmFLpfHeItamLD5O-6">
|
|
||||||
<mxGeometry relative="1" as="geometry" />
|
<mxGeometry relative="1" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-4" value="64-&gt;128" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.25;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="FEGHAENOx_VuAQpIDQKO-2" target="FEGHAENOx_VuAQpIDQKO-8">
|
||||||
<mxGeometry x="175" y="130" width="50" height="20" as="geometry" />
|
|
||||||
</mxCell>
|
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-5" value="" style="endArrow=classic;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" target="GA09nmFLpfHeItamLD5O-4">
|
|
||||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
||||||
<mxPoint x="120" y="140" as="sourcePoint" />
|
|
||||||
<mxPoint x="290" y="110" as="targetPoint" />
|
|
||||||
</mxGeometry>
|
|
||||||
</mxCell>
|
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-15" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="GA09nmFLpfHeItamLD5O-6" target="GA09nmFLpfHeItamLD5O-14">
|
|
||||||
<mxGeometry relative="1" as="geometry" />
|
|
||||||
</mxCell>
|
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-40" value="data_one_extended" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="GA09nmFLpfHeItamLD5O-15">
|
|
||||||
<mxGeometry x="-0.3532" y="-1" relative="1" as="geometry">
|
|
||||||
<mxPoint x="7" y="29" as="offset" />
|
|
||||||
</mxGeometry>
|
|
||||||
</mxCell>
|
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-6" value="bit add" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1">
|
|
||||||
<mxGeometry x="240" y="120" width="40" height="40" as="geometry" />
|
|
||||||
</mxCell>
|
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-8" value="" style="endArrow=classic;html=1;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" target="GA09nmFLpfHeItamLD5O-6">
|
|
||||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
|
||||||
<mxPoint x="260" y="80" as="sourcePoint" />
|
|
||||||
<mxPoint x="290" y="70" as="targetPoint" />
|
|
||||||
</mxGeometry>
|
|
||||||
</mxCell>
|
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-9" value="tkeep" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="GA09nmFLpfHeItamLD5O-8">
|
|
||||||
<mxGeometry x="-0.699" relative="1" as="geometry">
|
|
||||||
<mxPoint y="-16" as="offset" />
|
|
||||||
</mxGeometry>
|
|
||||||
</mxCell>
|
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-11" value="P" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
|
||||||
<mxGeometry x="540" y="180" width="80" height="20" as="geometry" />
|
|
||||||
</mxCell>
|
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-18" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="GA09nmFLpfHeItamLD5O-12" target="GA09nmFLpfHeItamLD5O-14">
|
|
||||||
<mxGeometry relative="1" as="geometry">
|
<mxGeometry relative="1" as="geometry">
|
||||||
<Array as="points">
|
<Array as="points">
|
||||||
<mxPoint x="340" y="100" />
|
<mxPoint x="100" y="210" />
|
||||||
|
<mxPoint x="100" y="250" />
|
||||||
|
<mxPoint x="260" y="250" />
|
||||||
|
<mxPoint x="260" y="220" />
|
||||||
</Array>
|
</Array>
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-36" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="GA09nmFLpfHeItamLD5O-12" target="GA09nmFLpfHeItamLD5O-34">
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-2" value="" style="shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;rotation=-90;" vertex="1" parent="1">
|
||||||
|
<mxGeometry y="160" width="120" height="40" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-29" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="FEGHAENOx_VuAQpIDQKO-4" target="FEGHAENOx_VuAQpIDQKO-27">
|
||||||
<mxGeometry relative="1" as="geometry">
|
<mxGeometry relative="1" as="geometry">
|
||||||
<Array as="points">
|
<Array as="points">
|
||||||
<mxPoint x="400" y="60" />
|
<mxPoint x="420" y="260" />
|
||||||
<mxPoint x="660" y="60" />
|
<mxPoint x="420" y="300" />
|
||||||
|
<mxPoint x="780" y="300" />
|
||||||
</Array>
|
</Array>
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-12" value="acc" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-4" value="s" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||||
<mxGeometry x="360" y="80" width="80" height="40" as="geometry" />
|
<mxGeometry x="280" y="240" width="120" height="40" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-14" value="+" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1">
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.25;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="FEGHAENOx_VuAQpIDQKO-2" target="FEGHAENOx_VuAQpIDQKO-4">
|
||||||
<mxGeometry x="320" y="120" width="40" height="40" as="geometry" />
|
|
||||||
</mxCell>
|
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-32" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="GA09nmFLpfHeItamLD5O-21" target="GA09nmFLpfHeItamLD5O-31">
|
|
||||||
<mxGeometry relative="1" as="geometry" />
|
|
||||||
</mxCell>
|
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-21" value="*" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1">
|
|
||||||
<mxGeometry x="440" y="120" width="40" height="40" as="geometry" />
|
|
||||||
</mxCell>
|
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-22" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="GA09nmFLpfHeItamLD5O-14" target="GA09nmFLpfHeItamLD5O-21">
|
|
||||||
<mxGeometry relative="1" as="geometry">
|
|
||||||
<mxPoint x="460" y="140" as="targetPoint" />
|
|
||||||
</mxGeometry>
|
|
||||||
</mxCell>
|
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-41" value="data_post_add" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="GA09nmFLpfHeItamLD5O-22">
|
|
||||||
<mxGeometry x="-0.1925" y="-1" relative="1" as="geometry">
|
|
||||||
<mxPoint x="8" y="19" as="offset" />
|
|
||||||
</mxGeometry>
|
|
||||||
</mxCell>
|
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-26" value="%" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1">
|
|
||||||
<mxGeometry x="560" y="120" width="40" height="40" as="geometry" />
|
|
||||||
</mxCell>
|
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-29" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.51;entryY=1.007;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="GA09nmFLpfHeItamLD5O-11" target="GA09nmFLpfHeItamLD5O-26">
|
|
||||||
<mxGeometry relative="1" as="geometry" />
|
|
||||||
</mxCell>
|
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-30" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1.022;entryY=0.482;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="GA09nmFLpfHeItamLD5O-26" target="GA09nmFLpfHeItamLD5O-12">
|
|
||||||
<mxGeometry relative="1" as="geometry">
|
<mxGeometry relative="1" as="geometry">
|
||||||
<Array as="points">
|
<Array as="points">
|
||||||
<mxPoint x="580" y="99" />
|
<mxPoint x="100" y="210" />
|
||||||
|
<mxPoint x="100" y="260" />
|
||||||
</Array>
|
</Array>
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-33" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="GA09nmFLpfHeItamLD5O-31" target="GA09nmFLpfHeItamLD5O-26">
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="FEGHAENOx_VuAQpIDQKO-6" target="FEGHAENOx_VuAQpIDQKO-8">
|
||||||
<mxGeometry relative="1" as="geometry" />
|
<mxGeometry relative="1" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-31" value="reg" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-6" value="multiplier" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||||
<mxGeometry x="500" y="130" width="40" height="20" as="geometry" />
|
<mxGeometry x="120" y="200" width="120" height="40" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-37" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="GA09nmFLpfHeItamLD5O-34">
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-16" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=0.25;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="FEGHAENOx_VuAQpIDQKO-8" target="FEGHAENOx_VuAQpIDQKO-15">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-22" value="r<sup>2</sup>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="FEGHAENOx_VuAQpIDQKO-16">
|
||||||
|
<mxGeometry x="-0.2366" y="1" relative="1" as="geometry">
|
||||||
|
<mxPoint x="2" y="-9" as="offset" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.75;exitDx=0;exitDy=0;entryX=0.75;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="FEGHAENOx_VuAQpIDQKO-8" target="FEGHAENOx_VuAQpIDQKO-15">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-23" value="r" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="FEGHAENOx_VuAQpIDQKO-17">
|
||||||
|
<mxGeometry x="-0.2762" y="1" relative="1" as="geometry">
|
||||||
|
<mxPoint x="3" y="11" as="offset" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-8" value="r<sup>2</sup>/r" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="280" y="200" width="120" height="40" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-28" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="FEGHAENOx_VuAQpIDQKO-11" target="FEGHAENOx_VuAQpIDQKO-27">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-11" value="Poly1305 Stage" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="480" y="120" width="240" height="160" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.125;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="FEGHAENOx_VuAQpIDQKO-1" target="FEGHAENOx_VuAQpIDQKO-11">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-21" value="data" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="FEGHAENOx_VuAQpIDQKO-12">
|
||||||
|
<mxGeometry x="-0.1705" relative="1" as="geometry">
|
||||||
|
<mxPoint y="-10" as="offset" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-15" value="" style="shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;rotation=90;size=10;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="410" y="210" width="40" height="20" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-18" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.625;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="FEGHAENOx_VuAQpIDQKO-15" target="FEGHAENOx_VuAQpIDQKO-11">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-25" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=0.125;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="FEGHAENOx_VuAQpIDQKO-1" target="FEGHAENOx_VuAQpIDQKO-11">
|
||||||
<mxGeometry relative="1" as="geometry">
|
<mxGeometry relative="1" as="geometry">
|
||||||
<mxPoint x="720" y="140" as="targetPoint" />
|
<Array as="points">
|
||||||
|
<mxPoint x="410" y="130" />
|
||||||
|
<mxPoint x="410" y="100" />
|
||||||
|
<mxPoint x="510" y="100" />
|
||||||
|
</Array>
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-39" value="tag" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="GA09nmFLpfHeItamLD5O-37">
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-26" value="sop" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="FEGHAENOx_VuAQpIDQKO-25">
|
||||||
<mxGeometry x="0.6531" y="2" relative="1" as="geometry">
|
<mxGeometry x="-0.0418" relative="1" as="geometry">
|
||||||
<mxPoint x="17" y="2" as="offset" />
|
<mxPoint x="13" y="-10" as="offset" />
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="GA09nmFLpfHeItamLD5O-34" value="+" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1">
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-30" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="FEGHAENOx_VuAQpIDQKO-27">
|
||||||
<mxGeometry x="640" y="120" width="40" height="40" as="geometry" />
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<mxPoint x="840" y="200" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-27" value="+" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="760" y="180" width="40" height="40" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="FEGHAENOx_VuAQpIDQKO-31" value="<h1 style="margin-top: 0px;">Poly1305</h1><p>Axi Stream&nbsp;</p>" style="text;html=1;whiteSpace=wrap;overflow=hidden;rounded=0;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="80" y="320" width="360" height="160" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
</root>
|
</root>
|
||||||
</mxGraphModel>
|
</mxGraphModel>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import cocotb
|
|||||||
from cocotb.clock import Clock
|
from cocotb.clock import Clock
|
||||||
from cocotb.triggers import Timer, RisingEdge, FallingEdge
|
from cocotb.triggers import Timer, RisingEdge, FallingEdge
|
||||||
from cocotb.queue import Queue
|
from cocotb.queue import Queue
|
||||||
|
from cocotb.handle import Immediate
|
||||||
|
|
||||||
from cocotbext.axi import AxiStreamBus, AxiStreamSource
|
from cocotbext.axi import AxiStreamBus, AxiStreamSource
|
||||||
|
|
||||||
@@ -29,7 +30,7 @@ class TB:
|
|||||||
self.expected_queue = Queue()
|
self.expected_queue = Queue()
|
||||||
self.output_queue = Queue()
|
self.output_queue = Queue()
|
||||||
|
|
||||||
cocotb.start_soon(Clock(self.dut.i_clk, CLK_PERIOD, units="ns").start())
|
cocotb.start_soon(Clock(self.dut.i_clk, CLK_PERIOD, unit="ns").start())
|
||||||
|
|
||||||
cocotb.start_soon(self.run_input())
|
cocotb.start_soon(self.run_input())
|
||||||
cocotb.start_soon(self.run_output())
|
cocotb.start_soon(self.run_output())
|
||||||
@@ -41,7 +42,7 @@ class TB:
|
|||||||
await self._cycle_reset(self.dut.i_rst, self.dut.i_clk)
|
await self._cycle_reset(self.dut.i_rst, self.dut.i_clk)
|
||||||
|
|
||||||
async def _cycle_reset(self, rst, clk):
|
async def _cycle_reset(self, rst, clk):
|
||||||
rst.setimmediatevalue(0)
|
rst.value = Immediate(0)
|
||||||
await RisingEdge(clk)
|
await RisingEdge(clk)
|
||||||
await RisingEdge(clk)
|
await RisingEdge(clk)
|
||||||
rst.value = 1
|
rst.value = 1
|
||||||
@@ -82,7 +83,7 @@ class TB:
|
|||||||
while True:
|
while True:
|
||||||
await RisingEdge(self.dut.i_clk)
|
await RisingEdge(self.dut.i_clk)
|
||||||
if self.dut.o_valid.value:
|
if self.dut.o_valid.value:
|
||||||
await self.output_queue.put(self.dut.o_result.value.integer)
|
await self.output_queue.put(self.dut.o_result.value.to_unsigned())
|
||||||
|
|
||||||
@cocotb.test
|
@cocotb.test
|
||||||
async def test_sanity(dut):
|
async def test_sanity(dut):
|
||||||
|
|||||||
Reference in New Issue
Block a user