Skip to content

Commit 80f29de

Browse files
committed
Update readme
Now it includes links and citation
1 parent 24b76d6 commit 80f29de

File tree

4 files changed

+34
-9
lines changed

4 files changed

+34
-9
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ With CYNQ:
6060
using namespace cynq;
6161

6262
// Configure the FPGA
63-
auto kArquitecture = HardwareArchitecture::UltraScale;
64-
auto platform = IHardware::Create(kArquitecture, "design.bit", "default.xclbin");
63+
auto kArch = HardwareArchitecture::UltraScale;
64+
auto platform = IHardware::Create(kArch, "design.bit", "default.xclbin");
6565

6666
// Extract the accelerator (IP Core) and DMA
6767
// Addresses are given by the design
@@ -89,3 +89,22 @@ outbuf->Sync(SyncType::DeviceToHost);
8989
So far, we have tested CYNQ on:
9090
9191
1. Xilinx KV26-based with Ubuntu 2022.04
92+
93+
## Links & References:
94+
95+
* Docs: https://ecaslab.github.io/cynq
96+
* Github: https://github.com/ECASLab/cynq
97+
98+
Cite Us:
99+
100+
```
101+
@misc{blabla,
102+
author = {{León-vega, Luis G.
103+
AND Ávila-Torres, Diego
104+
AND Castro-Godínez, Jorge
105+
}},
106+
title = {{CYNQ (v0.1)}},
107+
year = {2023},
108+
url = {https://github.com/ECASLab/cynq},
109+
}
110+
```

docs/Doxyfile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ OPTIMIZE_OUTPUT_VHDL = NO
291291
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
292292
# the files are not read by doxygen.
293293

294-
EXTENSION_MAPPING =
294+
EXTENSION_MAPPING =
295295

296296
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
297297
# according to the Markdown format, which allows for more readable

docs/html/index.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,19 @@ <h2>Index</h2>
116116
<h2>How does CYNQ look like?</h2>
117117
<p>CYNQ is pretty similar to PYNQ, let's have a look.</p>
118118
<p>PYNQ:</p>
119-
<div class="fragment"><div class="line">from pynq <span class="keyword">import</span> allocate, Overlay</div><div class="line"></div><div class="line"><span class="comment"># Configure the FPGA</span></div><div class="line">design = Overlay(<span class="stringliteral">&quot;design.bit&quot;</span>)</div><div class="line"></div><div class="line"><span class="comment"># Extract the accelerator (IP Core) and DMA</span></div><div class="line">dma = design.axi_dma_0</div><div class="line">accel = design.multiplication_accel_0</div><div class="line"></div><div class="line"><span class="comment"># Allocate buffers</span></div><div class="line">inbuf = allocate(shape=(input_elements,), dtype=np.uint16)</div><div class="line">outbuf = allocate(shape=(output_elements,), dtype=np.uint16)</div><div class="line"></div><div class="line"><span class="comment"># Run</span></div><div class="line">dma.sendchannel.transfer(inbuf)</div><div class="line">accel.write(accel.register_map.CTRL.address, 0x81)</div><div class="line">dma.recvchannel.transfer(outbuf)</div><div class="line">dma.recvchannel.wait()</div><div class="line"></div><div class="line"><span class="comment"># Dispose the buffers</span></div><div class="line">del input_hw</div><div class="line">del output_hw</div></div><!-- fragment --><p>With CYNQ:</p>
120-
<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;cynq/cynq.hpp&gt;</span></div><div class="line"></div><div class="line"><span class="keyword">using namespace </span><a class="code" href="namespacecynq.html">cynq</a>;</div><div class="line"></div><div class="line"><span class="comment">// Configure the FPGA</span></div><div class="line"><span class="keyword">auto</span> kArquitecture = HardwareArchitecture::UltraScale;</div><div class="line"><span class="keyword">auto</span> platform = <a class="code" href="classcynq_1_1IHardware.html#ab3cc41fbed5a6da306d8ae51153a3065">IHardware::Create</a>(kArquitecture, <span class="stringliteral">&quot;design.bit&quot;</span>, <span class="stringliteral">&quot;default.xclbin&quot;</span>);</div><div class="line"></div><div class="line"><span class="comment">// Extract the accelerator (IP Core) and DMA</span></div><div class="line"><span class="comment">// Addresses are given by the design</span></div><div class="line"><span class="keyword">auto</span> accel = platform-&gt;GetAccelerator(0xa000000);</div><div class="line"><span class="keyword">auto</span> dma = platform-&gt;GetDataMover(0xa0010000);</div><div class="line"></div><div class="line"><span class="comment">// Allocate buffers and get the pointers</span></div><div class="line"><span class="keyword">auto</span> inbuf = mover-&gt;GetBuffer(input_size);</div><div class="line"><span class="keyword">auto</span> outbuf = mover-&gt;GetBuffer(output_size);</div><div class="line">uint16_t* input_ptr = inbuf-&gt;HostAddress&lt;uint16_t&gt;().<span class="keyword">get</span>();</div><div class="line">uint16_t* output_ptr = outbuf-&gt;HostAddress&lt;uint16_t&gt;().<span class="keyword">get</span>();</div><div class="line"></div><div class="line"><span class="comment">// Run</span></div><div class="line">accel-&gt;Start(StartMode::Continuous);</div><div class="line">inbuf-&gt;Sync(SyncType::HostToDevice);</div><div class="line">mover-&gt;Upload(in_mem, infbuf-&gt;Size(), 0, ExecutionType::Sync);</div><div class="line">mover-&gt;Download(out_mem, outbuf-&gt;Size(), 0, ExecutionType::Sync);</div><div class="line">outbuf-&gt;Sync(SyncType::DeviceToHost);</div><div class="line"></div><div class="line"><span class="comment">// Dispose? We use RAII</span></div></div><!-- fragment --><h2>Currently tested</h2>
119+
<div class="fragment"><div class="line">from pynq import allocate, Overlay</div><div class="line"></div><div class="line"># Configure the FPGA</div><div class="line">design = Overlay(&quot;design.bit&quot;)</div><div class="line"></div><div class="line"># Extract the accelerator (IP Core) and DMA</div><div class="line">dma = design.axi_dma_0</div><div class="line">accel = design.multiplication_accel_0</div><div class="line"></div><div class="line"># Allocate buffers</div><div class="line">inbuf = allocate(shape=(input_elements,), dtype=np.uint16)</div><div class="line">outbuf = allocate(shape=(output_elements,), dtype=np.uint16)</div><div class="line"></div><div class="line"># Run</div><div class="line">dma.sendchannel.transfer(inbuf)</div><div class="line">accel.write(accel.register_map.CTRL.address, 0x81)</div><div class="line">dma.recvchannel.transfer(outbuf)</div><div class="line">dma.recvchannel.wait()</div><div class="line"></div><div class="line"># Dispose the buffers</div><div class="line">del input_hw</div><div class="line">del output_hw</div></div><!-- fragment --><p>With CYNQ:</p>
120+
<div class="fragment"><div class="line">{c++}</div><div class="line">#include &lt;cynq/cynq.hpp&gt;</div><div class="line"></div><div class="line">using namespace cynq;</div><div class="line"></div><div class="line">// Configure the FPGA</div><div class="line">auto kArch = HardwareArchitecture::UltraScale;</div><div class="line">auto platform = IHardware::Create(kArch, &quot;design.bit&quot;, &quot;default.xclbin&quot;);</div><div class="line"></div><div class="line">// Extract the accelerator (IP Core) and DMA</div><div class="line">// Addresses are given by the design</div><div class="line">auto accel = platform-&gt;GetAccelerator(0xa000000);</div><div class="line">auto dma = platform-&gt;GetDataMover(0xa0010000);</div><div class="line"></div><div class="line">// Allocate buffers and get the pointers</div><div class="line">auto inbuf = mover-&gt;GetBuffer(input_size);</div><div class="line">auto outbuf = mover-&gt;GetBuffer(output_size);</div><div class="line">uint16_t* input_ptr = inbuf-&gt;HostAddress&lt;uint16_t&gt;().get();</div><div class="line">uint16_t* output_ptr = outbuf-&gt;HostAddress&lt;uint16_t&gt;().get();</div><div class="line"></div><div class="line">// Run</div><div class="line">accel-&gt;Start(StartMode::Continuous);</div><div class="line">inbuf-&gt;Sync(SyncType::HostToDevice);</div><div class="line">mover-&gt;Upload(in_mem, infbuf-&gt;Size(), 0, ExecutionType::Sync);</div><div class="line">mover-&gt;Download(out_mem, outbuf-&gt;Size(), 0, ExecutionType::Sync);</div><div class="line">outbuf-&gt;Sync(SyncType::DeviceToHost);</div><div class="line"></div><div class="line">// Dispose? We use RAII</div></div><!-- fragment --><h2>Currently tested</h2>
121121
<p>So far, we have tested CYNQ on:</p>
122122
<ol type="1">
123-
<li>Xilinx KV26-based with Ubuntu 2022.04 </li>
123+
<li>Xilinx KV26-based with Ubuntu 2022.04</li>
124124
</ol>
125-
</div></div><!-- contents -->
125+
<h2>Links &amp; References:</h2>
126+
<ul>
127+
<li>Docs: <a href="https://ecaslab.github.io/cynq">https://ecaslab.github.io/cynq</a></li>
128+
<li>Github: <a href="https://github.com/ECASLab/cynq">https://github.com/ECASLab/cynq</a></li>
129+
</ul>
130+
<p>Cite Us:</p>
131+
<div class="fragment"><div class="line">@misc{blabla,</div><div class="line"> author = {{León-vega, Luis G.</div><div class="line"> AND Ávila-Torres, Diego</div><div class="line"> AND Castro-Godínez, Jorge</div><div class="line"> }},</div><div class="line"> title = {{CYNQ (v0.1)}},</div><div class="line"> year = {2023},</div><div class="line"> url = {https://github.com/ECASLab/cynq},</div><div class="line">} </div></div><!-- fragment --> </div></div><!-- contents -->
126132
</div><!-- doc-content -->
127133
<!-- start footer part -->
128134
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->

docs/html/md__media_lleon95_data_Personal_cynq_docs_GettingStarted.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@
138138
<p>To synchronise the buffers, it is possible to use <code>Sync()</code> method:</p>
139139
<div class="fragment"><div class="line">{c++}</div><div class="line">in_mem-&gt;Sync(SyncType::HostToDevice);</div><div class="line">out_mem-&gt;Sync(SyncType::DeviceToHost);</div></div><!-- fragment --><p>that takes any of the following values:</p>
140140
<ul>
141-
<li>cynq::SyncType::DeviceToHost: device to host synchronisation</li>
142-
<li>cynq::SyncType::HostToDevice: host to device synchronisation</li>
141+
<li><code>cynq::SyncType::DeviceToHost</code>: device to host synchronisation</li>
142+
<li><code>cynq::SyncType::HostToDevice</code>: host to device synchronisation</li>
143143
</ul>
144144
<p>Once the memory is synchronised, the data mover is used to upload the data to the AXI4-Stream or download from it.</p>
145145
<div class="fragment"><div class="line">{c++}</div><div class="line">// Upload: requires the buffer to be sync in HostToDevice</div><div class="line">dma-&gt;Upload(in_mem, in_mem-&gt;Size(), 0, ExecutionType::Sync);</div><div class="line">// Download: after its completion, the buffer must be sync DeviceToHost</div><div class="line">dma-&gt;Download(out_mem, out_mem-&gt;Size(), 0, ExecutionType::Sync);</div></div><!-- fragment --><p>Both methods takes: <code>(memory, size, offset, execution_type)</code>, where <code>size</code> is the amount of data to transfer in bytes, <code>offset</code> moves the starting point of the data and <code>execution_type</code> is the type of execution:</p>

0 commit comments

Comments
 (0)