<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>RISC-V Porting Guide on XWOS</title>
    <link>/en/Docs/Note/SOC/RISC-V/</link>
    <description>Recent content in RISC-V Porting Guide on XWOS</description>
    <generator>Hugo</generator>
    <language>en</language>
    <atom:link href="/en/Docs/Note/SOC/RISC-V/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>GD32V Porting Guide</title>
      <link>/en/Docs/Note/SOC/RISC-V/GD32V/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/en/Docs/Note/SOC/RISC-V/GD32V/</guid>
      <description>&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;/h2&gt;&#xA;&lt;p&gt;GD32V-related code:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Architecture Description Layer (ADL): &lt;code&gt;XWOS/xwcd/soc/riscv/nuclei/gcc&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;CPU Description Layer (CDL): &lt;code&gt;XWOS/xwcd/soc/riscv/nuclei/gcc/bumblebee&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;SoC Description Layer (SDL)&#xA;&lt;ul&gt;&#xA;&lt;li&gt;GD32V: &lt;code&gt;XWOS/xwcd/soc/riscv/nuclei/gcc/bumblebee/gd32v&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;boot-flow&#34;&gt;Boot Flow&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Program entry: &lt;code&gt;XWOS/xwcd/soc/riscv/nuclei/gcc/bumblebee/gd32v/soc.S: soc_boot&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;interrupts&#34;&gt;Interrupts&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Uses &lt;strong&gt;non-vectored mode&lt;/strong&gt;, unified entry: &lt;code&gt;XWOS/xwcd/soc/riscv/nuclei/gcc/bumblebee/gd32v/soc.S: soc_isr_entry&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Uses the RISC-V standard register &lt;code&gt;mscratch&lt;/code&gt; to implement a dual-stack working mode similar to ARM-Cortex-M&lt;/li&gt;&#xA;&lt;li&gt;Unified exception entry: &lt;code&gt;XWOS/xwcd/soc/riscv/nuclei/gcc/bumblebee/gd32v/soc.S: soc_esr_entry&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Source code:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;XWOS/xwcd/soc/riscv/nuclei/gcc/bumblebee/gd32v/xwosimpl_soc_irq.h&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;XWOS/xwcd/soc/riscv/nuclei/gcc/bumblebee/gd32v/xwosimpl_irq.h&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;XWOS/xwcd/soc/riscv/nuclei/gcc/bumblebee/gd32v/xwosimpl_irq.c&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;XWOS/xwcd/soc/riscv/nuclei/gcc/bumblebee/gd32v/soc.S&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;scheduler&#34;&gt;Scheduler&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Source code:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;XWOS/xwcd/soc/riscv/nuclei/gcc/bumblebee/gd32v/xwosimpl_skd.h&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;XWOS/xwcd/soc/riscv/nuclei/gcc/bumblebee/gd32v/xwosimpl_skd.c&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;XWOS/xwcd/soc/riscv/nuclei/gcc/bumblebee/gd32v/xwosasmimpl_skd.S&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;stack-layout&#34;&gt;Stack Layout&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;RISC-V requires the stack to be &lt;strong&gt;16-byte aligned&lt;/strong&gt;;&lt;/li&gt;&#xA;&lt;li&gt;RISC-V only uses &lt;strong&gt;full descending stacks&lt;/strong&gt;;&lt;/li&gt;&#xA;&lt;li&gt;RISC-V ABI documents divide registers into two types: caller-saved (i.e., volatile) and callee-saved (i.e., non-volatile).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h4 id=&#34;caller-saved-stack-layout&#34;&gt;Caller-Saved Stack Layout&lt;/h4&gt;&#xA;&lt;p&gt;When entering an interrupt from a thread, the interrupt entry routine automatically saves caller-saved registers to the stack:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
