Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2022-04-05 18:04:07 +08:00
parent 8c93d68c6b
commit de14a461d8
2 changed files with 155 additions and 93 deletions

View File

@ -95,14 +95,22 @@
<li>Senoko: Open Source Power Board for Novena</li>
</ul>
</section>
<section>
<h2>Hardware with Embedded Software</h2>
<ul>
<li>Software needs to be written</li>
<li class="fragment">Software needs to be <strong>tested</strong></li>
<li class="fragment">Software needs to be <i>debugged</i></li>
</ul>
</section>
<section>
<h2>About Renode</h2>
<ul>
<li>Whole-System Emulator</li>
<li>Supports concurrent emulation</li>
<li>Extensible with C# and Python</li>
<li>MIT Licensed</li>
<li>Windows, Mac, Linux</li>
<li>MIT Licensed</li>
</ul>
</section>
<section>
@ -153,21 +161,15 @@
<section>
<section data-transition="fade-out">
<h2>What is an Emulator?</h2>
<img class="fragment" src="media/DEC_VT100_terminal.jpg">
<!-- <ul>
<li>Console</li>
<li>Desktop</li>
<li>CPU</li>
</ul> -->
<img class="fragment" src="media/bbs-example.png">
</section>
<section data-transition="fade">
<h2>What is an Emulator?</h2>
<img src="media/DEC_VT100_terminal_cropped.jpg">
</section>
<section data-transition="fade-in">
<h2>What is an Emulator?</h2>
<img src="media/bbs-example.png">
<!-- <ul>
<li>Console</li>
<li>Desktop</li>
<li>CPU</li>
</ul> -->
</section>
<section>
<h2>Whole-System Emulator</h2>
@ -190,24 +192,17 @@
<li>Parallels</li>
</ul>
-->
</section> <section>
</section>
<section>
<h2>Transparent Emulator</h2>
<ul>
<li>HyperV</li>
<li>WSL2/Docker</li>
<li>qemu on Linux</li>
<li>Rosetta on Mac</li>
</ul>
</section>
<section>
<h2>Debugger/Emulator</h2>
<ul>
<li>FCEUX (Nintendo Entertainment System)</li>
<li>Dolphin (Wii / Gamecube)</li>
</ul>
</section>
<section>
<h2>Renode Is All of These</h2>
<h2>Renode Is Many of These</h2>
<ul>
<li>Console: Able to present an interactive environment</li>
<li>Transparent: Can run in CI via Robot commands</li>
@ -217,6 +212,20 @@
</section>
<section>
<section data-transition="fade-out">
<h2>What is a Computer?</h2>
<img class="fragment" src="media/bluenrg-block-diagram.png">
</section>
<section data-transition="fade">
<h2>What is a Computer?</h2>
<ul>
<li>A system of devices</li>
<li>One or more CPU</li>
<li>One or more buses</li>
<li>One or more blocks of memory</li>
<li>Some I/O</li>
</ul>
</section>
<section data-transition="fade-out">
<h2>What is a Computer?</h2>
<img class="fragment" src="media/bluenrg-block-diagram.png">
@ -269,6 +278,128 @@
</section>
</section>
<section>
<h2>That's Nice, but What About...</h2>
<ol>
<li>Loading firmware?</li>
<li>Adding peripherals?</li>
</ol>
</section>
<section>
<section>
<h2>What is "Firmware"?</h2>
<blockquote class="fragment strike">Firmware is a series of instructions executed by the CPU in
order to accomplish a task</blockquote>
<blockquote class="fragment">Firmware is Memory</blockquote>
</section>
<section>
<h2>Loading Firmware in Renode</h2>
<pre><code data-trim>
sysbus LoadELF @firmware.elf
</code></pre>
<pre class="fragment"><code data-trim>
sysbus LoadBinary @rom.bin 0x20000000
</code></pre>
<pre class="fragment"><code data-trim>
sysbus LoadSymbolsFrom @rom.elf
</code></pre>
</section>
<section>
<h2>How does Renode Interact With $VENDOR_TOOL?</h2>
<ul>
<li>Hopefully your vendor tool produces ELF files</li>
<li class="fragment">At the end of the day, it's all bytes. Just use <code>LoadBinary</code>!
</li>
</ul>
</section>
<section>
<h2>What About Boot ROMs?</h2>
<ol>
<li class="fragment strike semi-fade-out" data-fragment-index="1">Initialize peripherals</li>
<li class="fragment strike semi-fade-out" data-fragment-index="1">Check for boot override</li>
<li class="fragment strike semi-fade-out" data-fragment-index="1">Check for low-power state</li>
<li class="fragment strike semi-fade-out" data-fragment-index="1">Load firmware into RAM</li>
<li class="fragment strike semi-fade-out" data-fragment-index="1">Validate firmware</li>
<li>Jump to loaded program</li>
</ol>
<pre class="fragment"><code data-trim>
sysbus.cpu VectorTableOffset 0x20000000
sysbus.cpu PC 0x20000c00
</code></pre>
</section>
</section>
<section>
<section>
<h2>What about New Peripherals?</h2>
</section>
<section>
<h2>It's All About Small Victories</h2>
<ul>
<li>Serial ports are super rewarding</li>
<li>They're also usually simple!</li>
<li>They are easy to script</li>
</ul>
</section>
<section>
<h2>Reusing an Existing Port</h2>
</section>
<section>
<h2>Steps to Set Up a Serial Port</h2>
<ol>
<li class="fragment strike semi-fade-out" data-fragment-index="1">Enable peripheral</li>
<li class="fragment strike semi-fade-out" data-fragment-index="1">Set up clock</li>
<li class="fragment strike semi-fade-out" data-fragment-index="1">Mux GPIOs</li>
<li class="fragment strike semi-fade-out" data-fragment-index="1">Calculate baud rate</li>
<li>Write to UART TX register</li>
</ol>
</section>
<section>
<h2>Steps to Set Up a Serial Port</h2>
<img src="media/renode-xous-kernel-uart.png">
</section>
<section>
<h2>Steps to Set Up a Serial Port</h2>
<ul>
<li>Interrupt Support</li>
<li>DMA</li>
</ul>
</section>
<section>
<h2>Example Serial Port</h2>
<pre><code class="cs" data-trim>
{(long)Registers.RxTx, new DoubleWordRegister(this)
.WithValueField(0, 8,
writeCallback: (_, value) => {
this.TransmitCharacter((byte)value);
},
valueProviderCallback: _ => {
if(!TryGetCharacter(out var character))
{
this.Log(LogLevel.Warning, "Empty Rx FIFO.");
}
return character;
})
},
</code></pre>
</section>
<section>
<h2>What about Missing Definitions?</h2>
<ul>
<li>Most registers are unused</li>
<li>Most writes can be ignored</li>
</ul>
</section>
<section data-transition="fade-out">
<h2>Advantages of Emulation</h2>
<img src="media/betrusted-soc-uart-mux.png">
</section>
<section data-transition="fade-in">
<h2>Advantages of Emulation</h2>
<img src="media/renode-xous-double-uart-tiled.png">
</section>
</section>
<!--
<section>
<section>
<h2>Example of Weird Hardware</h2>
@ -335,78 +466,9 @@
<li>Time to break out C#</li>
</ul>
</section>
</section>
</section> -->
<section>
<section>
<h2>What is "Firmware"?</h2>
</section>
<section>
<h2>How does this interact with $VENDOR_TOOL?</h2>
</section>
<section>
<h2>What about boot ROMs?</h2>
</section>
<section>
<h2>What about missing registers?</h2>
<ul>
<li>Very few projects use built-in blocks</li>
</ul>
</section>
<section>
<h2>It's All About Small Victories</h2>
<ul>
<li>Serial ports are super rewarding</li>
<li>They're also usually simple!</li>
<li>They are easy to script</li>
</ul>
</section>
<section>
<h2>Steps to Set Up a Serial Port</h2>
<ol>
<li class="fragment semi-fade-out" data-fragment-index="1">Enable peripheral</li>
<li class="fragment semi-fade-out" data-fragment-index="1">Set up clock</li>
<li class="fragment semi-fade-out" data-fragment-index="1">Mux GPIOs</li>
<li class="fragment semi-fade-out" data-fragment-index="1">Calculate baud rate</li>
<li>Write to UART TX register</li>
</ol>
</section>
<section>
<h2>Steps to Set Up a Serial Port</h2>
<img src="media/renode-xous-kernel-uart.png">
</section>
<section data-transition="fade-out">
<h2>Advantages of Emulation</h2>
<img src="media/betrusted-soc-uart-mux.png">
</section>
<section data-transition="fade-in">
<h2>Advantages of Emulation</h2>
<img src="media/renode-xous-double-uart-tiled.png">
</section>
<section>
<h2>Steps to Set Up a Serial Port</h2>
<ul>
<li>Interrupt Support</li>
<li>DMA</li>
</ul>
</section>
<section>
<h2>Example Serial Port</h2>
<pre><code class="cs" data-trim>
{(long)Registers.RxTx, new DoubleWordRegister(this)
.WithValueField(0, 8,
writeCallback: (_, value) => {
this.TransmitCharacter((byte)value);
},
valueProviderCallback: _ => {
if(!TryGetCharacter(out var character))
{
this.Log(LogLevel.Warning, "Empty Rx FIFO.");
}
return character;
})
},
</code></pre>
</section>
<section>
<h2>Robot Framework: Running Tests in CI</h2>
<pre><code class="hljs" data-trim>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB