<?xml version="1.0"?>
<target>
  <architecture>riscv</architecture>
  <feature name="org.gnu.gdb.riscv.cpu">
    <reg name="zero" bitsize="64" regnum="0"  type="int"/>
    <reg name="ra"   bitsize="64" regnum="1"  type="code_ptr"/>
    <reg name="sp"   bitsize="64" regnum="2"  type="data_ptr"/>
    <reg name="gp"   bitsize="64" regnum="3"  type="data_ptr"/>
    <reg name="tp"   bitsize="64" regnum="4"  type="data_ptr"/>
    <reg name="t0"   bitsize="64" regnum="5"  type="int"/>
    <reg name="t1"   bitsize="64" regnum="6"  type="int"/>
    <reg name="t2"   bitsize="64" regnum="7"  type="int"/>
    <reg name="fp"   bitsize="64" regnum="8"  type="data_ptr"/>
    <reg name="s1"   bitsize="64" regnum="9"  type="int"/>
    <reg name="a0"   bitsize="64" regnum="10" type="int"/>
    <reg name="a1"   bitsize="64" regnum="11" type="int"/>
    <reg name="a2"   bitsize="64" regnum="12" type="int"/>
    <reg name="a3"   bitsize="64" regnum="13" type="int"/>
    <reg name="a4"   bitsize="64" regnum="14" type="int"/>
    <reg name="a5"   bitsize="64" regnum="15" type="int"/>
    <reg name="a6"   bitsize="64" regnum="16" type="int"/>
    <reg name="a7"   bitsize="64" regnum="17" type="int"/>
    <reg name="s2"   bitsize="64" regnum="18" type="int"/>
    <reg name="s3"   bitsize="64" regnum="19" type="int"/>
    <reg name="s4"   bitsize="64" regnum="20" type="int"/>
    <reg name="s5"   bitsize="64" regnum="21" type="int"/>
    <reg name="s6"   bitsize="64" regnum="22" type="int"/>
    <reg name="s7"   bitsize="64" regnum="23" type="int"/>
    <reg name="s8"   bitsize="64" regnum="24" type="int"/>
    <reg name="s9"   bitsize="64" regnum="25" type="int"/>
    <reg name="s10"  bitsize="64" regnum="26" type="int"/>
    <reg name="s11"  bitsize="64" regnum="27" type="int"/>
    <reg name="t3"   bitsize="64" regnum="28" type="int"/>
    <reg name="t4"   bitsize="64" regnum="29" type="int"/>
    <reg name="t5"   bitsize="64" regnum="30" type="int"/>
    <reg name="t6"   bitsize="64" regnum="31" type="int"/>
    <reg name="pc"   bitsize="64" regnum="32" type="code_ptr"/>
  </feature>
  <feature name="org.gnu.gdb.riscv.fpu">
	<union id="float64_union">
      <field name="double" type="ieee_double"/>
	  <field name="float" type="ieee_single"/>
	  <field name="uint64" type="uint64"/>
    </union>

	<reg name="ft0"  bitsize="64" regnum="33" type="float64_union"/>
	<reg name="ft1"  bitsize="64" regnum="34" type="float64_union"/>
	<reg name="ft2"  bitsize="64" regnum="35" type="float64_union"/>
	<reg name="ft3"  bitsize="64" regnum="36" type="float64_union"/>
	<reg name="ft4"  bitsize="64" regnum="37" type="float64_union"/>
	<reg name="ft5"  bitsize="64" regnum="38" type="float64_union"/>
	<reg name="ft6"  bitsize="64" regnum="39" type="float64_union"/>
	<reg name="ft7"  bitsize="64" regnum="40" type="float64_union"/>
	<reg name="fs0"  bitsize="64" regnum="41" type="float64_union"/>
	<reg name="fs1"  bitsize="64" regnum="42" type="float64_union"/>
	<reg name="fa0"  bitsize="64" regnum="43" type="float64_union"/>
	<reg name="fa1"  bitsize="64" regnum="44" type="float64_union"/>
	<reg name="fa2"  bitsize="64" regnum="45" type="float64_union"/>
	<reg name="fa3"  bitsize="64" regnum="46" type="float64_union"/>
	<reg name="fa4"  bitsize="64" regnum="47" type="float64_union"/>
	<reg name="fa5"  bitsize="64" regnum="48" type="float64_union"/>
	<reg name="fa6"  bitsize="64" regnum="49" type="float64_union"/>
	<reg name="fa7"  bitsize="64" regnum="50" type="float64_union"/>
	<reg name="fs2"  bitsize="64" regnum="51" type="float64_union"/>
	<reg name="fs3"  bitsize="64" regnum="52" type="float64_union"/>
	<reg name="fs4"  bitsize="64" regnum="53" type="float64_union"/>
	<reg name="fs5"  bitsize="64" regnum="54" type="float64_union"/>
	<reg name="fs6"  bitsize="64" regnum="55" type="float64_union"/>
	<reg name="fs7"  bitsize="64" regnum="56" type="float64_union"/>
	<reg name="fs8"  bitsize="64" regnum="57" type="float64_union"/>
	<reg name="fs9"  bitsize="64" regnum="58" type="float64_union"/>
	<reg name="fs10" bitsize="64" regnum="59" type="float64_union"/>
	<reg name="fs11" bitsize="64" regnum="60" type="float64_union"/>
	<reg name="ft8"  bitsize="64" regnum="61" type="float64_union"/>
	<reg name="ft9"  bitsize="64" regnum="62" type="float64_union"/>
	<reg name="ft10" bitsize="64" regnum="63" type="float64_union"/>
	<reg name="ft11" bitsize="64" regnum="64" type="float64_union"/>

	<reg name="fflags" bitsize="32" regnum="66" type="int" />
	<reg name="frm"    bitsize="32" regnum="67" type="int" />
	<reg name="fcsr"   bitsize="32" regnum="68" type="int" />
  </feature>
  <feature name="org.gnu.gdb.riscv.csr">
    <!-- Regnum for CSR is (csr_regno + 65), used by remote protocol -->
    <!-- M-mode Information -->
    <reg name="mvendorid" bitsize="64" regnum="0xf52" type="int"/>
	<reg name="marchid"   bitsize="64" regnum="0xf53" type="int"/>
	<reg name="mimpid"    bitsize="64" regnum="0xf54" type="int"/>
	<reg name="mhartid"   bitsize="64" regnum="0xf55" type="int"/>
    <!-- M-mode Exception Setting -->
    <reg name="mstatus"       bitsize="64" regnum="0x341" type="int"/>
	<reg name="misa"          bitsize="64" regnum="0x342" type="int"/>
	<reg name="medeleg"       bitsize="64" regnum="0x343" type="int"/>
	<reg name="mideleg"       bitsize="64" regnum="0x344" type="int"/>
	<reg name="mie"           bitsize="64" regnum="0x345" type="int"/>
	<reg name="mtvec"         bitsize="64" regnum="0x346" type="int"/>
	<reg name="mcounteren"    bitsize="64" regnum="0x347" type="int"/>
	<!-- M-mode Exception Handling -->
	<reg name="mscratch"  bitsize="64" regnum="0x381" type="int"/>
	<reg name="mepc"      bitsize="64" regnum="0x382" type="int"/>
	<reg name="mcause"    bitsize="64" regnum="0x383" type="int"/>
	<reg name="mtval"     bitsize="64" regnum="0x384" type="int"/>
	<reg name="mip"       bitsize="64" regnum="0x385" type="int"/>
    <!-- M-mode Memory Protect -->
	<reg name="pmpcfg0"   bitsize="64" regnum="0x3e1" type="int"/>
	<reg name="pmpcfg2"   bitsize="64" regnum="0x3e3" type="int"/>
	<reg name="pmpaddr0"  bitsize="64" regnum="0x3f1" type="int"/>
	<reg name="pmpaddr1"  bitsize="64" regnum="0x3f2" type="int"/>
	<reg name="pmpaddr2"  bitsize="64" regnum="0x3f3" type="int"/>
	<reg name="pmpaddr3"  bitsize="64" regnum="0x3f4" type="int"/>
	<reg name="pmpaddr4"  bitsize="64" regnum="0x3f5" type="int"/>
	<reg name="pmpaddr5"  bitsize="64" regnum="0x3f6" type="int"/>
	<reg name="pmpaddr6"  bitsize="64" regnum="0x3f7" type="int"/>
	<reg name="pmpaddr7"  bitsize="64" regnum="0x3f8" type="int"/>
	<reg name="pmpaddr8"  bitsize="64" regnum="0x3f9" type="int"/>
	<reg name="pmpaddr9"  bitsize="64" regnum="0x3fa" type="int"/>
	<reg name="pmpaddr10" bitsize="64" regnum="0x3fb" type="int"/>
	<reg name="pmpaddr11" bitsize="64" regnum="0x3fc" type="int"/>
	<reg name="pmpaddr12" bitsize="64" regnum="0x3fd" type="int"/>
	<reg name="pmpaddr13" bitsize="64" regnum="0x3fe" type="int"/>
	<reg name="pmpaddr14" bitsize="64" regnum="0x3ff" type="int"/>
	<reg name="pmpaddr15" bitsize="64" regnum="0x400" type="int"/>
	<!-- M-mode Counter -->
	<reg name="mcycle"        bitsize="64" regnum="0xb41" type="int"/>
	<reg name="minstret"      bitsize="64" regnum="0xb43" type="int"/>
	<reg name="mhpmcounter3"  bitsize="64" regnum="0xb44" type="int"/>
	<reg name="mhpmcounter4"  bitsize="64" regnum="0xb45" type="int"/>
	<reg name="mhpmcounter5"  bitsize="64" regnum="0xb46" type="int"/>
	<reg name="mhpmcounter6"  bitsize="64" regnum="0xb47" type="int"/>
	<reg name="mhpmcounter7"  bitsize="64" regnum="0xb48" type="int"/>
	<reg name="mhpmcounter8"  bitsize="64" regnum="0xb49" type="int"/>
	<reg name="mhpmcounter9"  bitsize="64" regnum="0xb4a" type="int"/>
	<reg name="mhpmcounter10" bitsize="64" regnum="0xb4b" type="int"/>
	<reg name="mhpmcounter11" bitsize="64" regnum="0xb4c" type="int"/>
	<reg name="mhpmcounter12" bitsize="64" regnum="0xb4d" type="int"/>
	<reg name="mhpmcounter13" bitsize="64" regnum="0xb4e" type="int"/>
	<reg name="mhpmcounter14" bitsize="64" regnum="0xb4f" type="int"/>
	<reg name="mhpmcounter15" bitsize="64" regnum="0xb50" type="int"/>
	<reg name="mhpmcounter16" bitsize="64" regnum="0xb51" type="int"/>
	<reg name="mhpmcounter17" bitsize="64" regnum="0xb52" type="int"/>
	<reg name="mhpmcounter18" bitsize="64" regnum="0xb53" type="int"/>
	<reg name="mhpmcounter19" bitsize="64" regnum="0xb54" type="int"/>
	<reg name="mhpmcounter20" bitsize="64" regnum="0xb55" type="int"/>
	<reg name="mhpmcounter21" bitsize="64" regnum="0xb56" type="int"/>
	<reg name="mhpmcounter22" bitsize="64" regnum="0xb57" type="int"/>
	<reg name="mhpmcounter23" bitsize="64" regnum="0xb58" type="int"/>
	<reg name="mhpmcounter24" bitsize="64" regnum="0xb59" type="int"/>
	<reg name="mhpmcounter25" bitsize="64" regnum="0xb5a" type="int"/>
	<reg name="mhpmcounter26" bitsize="64" regnum="0xb5b" type="int"/>
	<reg name="mhpmcounter27" bitsize="64" regnum="0xb5c" type="int"/>
	<reg name="mhpmcounter28" bitsize="64" regnum="0xb5d" type="int"/>
	<reg name="mhpmcounter29" bitsize="64" regnum="0xb5e" type="int"/>
	<reg name="mhpmcounter30" bitsize="64" regnum="0xb5f" type="int"/>
	<reg name="mhpmcounter31" bitsize="64" regnum="0xb60" type="int"/>
	<reg name="mhpmevent3"    bitsize="64" regnum="0x364" type="int"/>
	<reg name="mhpmevent4"    bitsize="64" regnum="0x365" type="int"/>
	<reg name="mhpmevent5"    bitsize="64" regnum="0x366" type="int"/>
	<reg name="mhpmevent6"    bitsize="64" regnum="0x367" type="int"/>
	<reg name="mhpmevent7"    bitsize="64" regnum="0x368" type="int"/>
	<reg name="mhpmevent8"    bitsize="64" regnum="0x369" type="int"/>
	<reg name="mhpmevent9"    bitsize="64" regnum="0x36a" type="int"/>
	<reg name="mhpmevent10"   bitsize="64" regnum="0x36b" type="int"/>
	<reg name="mhpmevent11"   bitsize="64" regnum="0x36c" type="int"/>
	<reg name="mhpmevent12"   bitsize="64" regnum="0x36d" type="int"/>
	<reg name="mhpmevent13"   bitsize="64" regnum="0x36e" type="int"/>
	<reg name="mhpmevent14"   bitsize="64" regnum="0x36f" type="int"/>
	<reg name="mhpmevent15"   bitsize="64" regnum="0x370" type="int"/>
	<reg name="mhpmevent16"   bitsize="64" regnum="0x371" type="int"/>
	<reg name="mhpmevent17"   bitsize="64" regnum="0x372" type="int"/>
	<reg name="mhpmevent18"   bitsize="64" regnum="0x373" type="int"/>
	<reg name="mhpmevent19"   bitsize="64" regnum="0x374" type="int"/>
	<reg name="mhpmevent20"   bitsize="64" regnum="0x375" type="int"/>
	<reg name="mhpmevent21"   bitsize="64" regnum="0x376" type="int"/>
	<reg name="mhpmevent22"   bitsize="64" regnum="0x377" type="int"/>
	<reg name="mhpmevent23"   bitsize="64" regnum="0x378" type="int"/>
	<reg name="mhpmevent24"   bitsize="64" regnum="0x379" type="int"/>
	<reg name="mhpmevent25"   bitsize="64" regnum="0x37a" type="int"/>
	<reg name="mhpmevent26"   bitsize="64" regnum="0x37b" type="int"/>
	<reg name="mhpmevent27"   bitsize="64" regnum="0x37c" type="int"/>
	<reg name="mhpmevent28"   bitsize="64" regnum="0x37d" type="int"/>
	<reg name="mhpmevent29"   bitsize="64" regnum="0x37e" type="int"/>
	<reg name="mhpmevent30"   bitsize="64" regnum="0x37f" type="int"/>
	<reg name="mhpmevent31"   bitsize="64" regnum="0x380" type="int"/>
	<!-- M-mode Control vs Status -->
	<reg name="mcountinhibit" bitsize="64" regnum="0x361"  type="int"/>
	<reg name="mxstatus"      bitsize="64" regnum="0x801"  type="int"/>
	<reg name="mhcr"          bitsize="64" regnum="0x802"  type="int"/>
	<reg name="mcor"          bitsize="64" regnum="0x803"  type="int"/>
	<reg name="mhint"         bitsize="64" regnum="0x806"  type="int"/>
	<reg name="mrmr"          bitsize="64" regnum="0x807"  type="int"/>
	<reg name="mrvbr"         bitsize="64" regnum="0x808"  type="int"/>
	<reg name="mcer"          bitsize="64" regnum="0x809"  type="int"/>
	<reg name="mcounterwen"   bitsize="64" regnum="0x80a"  type="int"/>
	<reg name="mcounterinten" bitsize="64" regnum="0x80b"  type="int"/>
	<reg name="mcounterof"    bitsize="64" regnum="0x80c"  type="int"/>
	<reg name="mapbaddr"      bitsize="64" regnum="0x1002" type="int"/>
	<!-- M-mode Access Cache Extention -->
	<reg name="mcins"    bitsize="64" regnum="0x813"  type="int"/>
	<reg name="mcindex"  bitsize="64" regnum="0x814"  type="int"/>
	<reg name="mcdata0"  bitsize="64" regnum="0x815"  type="int"/>
	<reg name="mcdata1"  bitsize="64" regnum="0x816"  type="int"/>
	<reg name="mhpmcr"   bitsize="64" regnum="0x831"  type="int"/>
	<reg name="mhpmsr"   bitsize="64" regnum="0x832"  type="int"/>
	<reg name="mhpmer"   bitsize="64" regnum="0x833"  type="int"/>
	<reg name="msmpr"    bitsize="64" regnum="0x834"  type="int"/>
	<reg name="mteecfg"  bitsize="64" regnum="0x835"  type="int"/>
	<reg name="mcpuid"   bitsize="64" regnum="0x1001" type="int"/>
	<reg name="mapbaddr"   bitsize="64" regnum="0x1002" type="int"/>
	<reg name="mwmsr"    bitsize="64" regnum="0x1003" type="int"/>
	<!-- S-mode Exception Setting -->
	<reg name="sstatus"    bitsize="64" regnum="0x141" type="int"/>
	<reg name="sie"        bitsize="64" regnum="0x145" type="int"/>
	<reg name="stvec"      bitsize="64" regnum="0x146" type="int"/>
	<reg name="scounteren" bitsize="64" regnum="0x147" type="int"/>
	<!-- S-mode Exception Handling -->
	<reg name="sscratch" bitsize="64" regnum="0x181" type="int"/>
	<reg name="sepc"     bitsize="64" regnum="0x182" type="int"/>
	<reg name="scause"   bitsize="64" regnum="0x183" type="int"/>
	<reg name="stval"    bitsize="64" regnum="0x184" type="int"/>
	<reg name="sip"      bitsize="64" regnum="0x185" type="int"/>
	<!-- S-mode Address Convertion -->
	<reg name="satp"     bitsize="64" regnum="0x1c1" type="int"/>
	<!-- S-mode Control vs Status -->
	<reg name="sxstatus"      bitsize="64" regnum="0x601" type="int"/>
	<reg name="shcr"          bitsize="64" regnum="0x602" type="int"/>
	<reg name="scounterinten" bitsize="64" regnum="0x605" type="int"/>
	<reg name="sconterof"     bitsize="64" regnum="0x606" type="int"/>
	<reg name="shpminhibit"   bitsize="64" regnum="0x609" type="int"/>
	<reg name="shpmcr"        bitsize="64" regnum="0x60a" type="int"/>
	<reg name="shpmsr"        bitsize="64" regnum="0x60b" type="int"/>
	<reg name="shpmer"        bitsize="64" regnum="0x60c" type="int"/>
	<reg name="scycle"        bitsize="64" regnum="0x621" type="int"/>
	<reg name="sinstret"      bitsize="64" regnum="0x623" type="int"/>
	<reg name="shpmcounter3"  bitsize="64" regnum="0x624" type="int"/>
	<reg name="shpmcounter4"  bitsize="64" regnum="0x625" type="int"/>
	<reg name="shpmcounter5"  bitsize="64" regnum="0x626" type="int"/>
	<reg name="shpmcounter6"  bitsize="64" regnum="0x627" type="int"/>
	<reg name="shpmcounter7"  bitsize="64" regnum="0x628" type="int"/>
	<reg name="shpmcounter8"  bitsize="64" regnum="0x629" type="int"/>
	<reg name="shpmcounter9"  bitsize="64" regnum="0x62a" type="int"/>
	<reg name="shpmcounter10" bitsize="64" regnum="0x62b" type="int"/>
	<reg name="shpmcounter11" bitsize="64" regnum="0x62c" type="int"/>
	<reg name="shpmcounter12" bitsize="64" regnum="0x62d" type="int"/>
	<reg name="shpmcounter13" bitsize="64" regnum="0x62e" type="int"/>
	<reg name="shpmcounter14" bitsize="64" regnum="0x62f" type="int"/>
	<reg name="shpmcounter15" bitsize="64" regnum="0x630" type="int"/>
	<reg name="shpmcounter16" bitsize="64" regnum="0x631" type="int"/>
	<reg name="shpmcounter17" bitsize="64" regnum="0x632" type="int"/>
	<!-- Super User-mode MMU Extention -->
	<reg name="smir"     bitsize="64" regnum="0xa01" type="int"/>
	<reg name="smel"     bitsize="64" regnum="0xa02" type="int"/>
	<reg name="smeh"     bitsize="64" regnum="0xa03" type="int"/>
	<reg name="smcir"    bitsize="64" regnum="0xa04" type="int"/>
	<!-- U-mode Counter/Timer -->
	<reg name="cycle"        bitsize="64" regnum="0xc41" type="int"/>
	<reg name="time"         bitsize="64" regnum="0xc42" type="int"/>
	<reg name="instret"      bitsize="64" regnum="0xc43" type="int"/>
	<reg name="hpmcounter3"  bitsize="64" regnum="0xc44" type="int"/>
	<reg name="hpmcounter4"  bitsize="64" regnum="0xc45" type="int"/>
	<reg name="hpmcounter5"  bitsize="64" regnum="0xc46" type="int"/>
	<reg name="hpmcounter6"  bitsize="64" regnum="0xc47" type="int"/>
	<reg name="hpmcounter7"  bitsize="64" regnum="0xc48" type="int"/>
	<reg name="hpmcounter8"  bitsize="64" regnum="0xc49" type="int"/>
	<reg name="hpmcounter9"  bitsize="64" regnum="0xc4a" type="int"/>
	<reg name="hpmcounter10" bitsize="64" regnum="0xc4b" type="int"/>
	<reg name="hpmcounter11" bitsize="64" regnum="0xc4c" type="int"/>
	<reg name="hpmcounter12" bitsize="64" regnum="0xc4d" type="int"/>
	<reg name="hpmcounter13" bitsize="64" regnum="0xc4e" type="int"/>
	<reg name="hpmcounter14" bitsize="64" regnum="0xc4f" type="int"/>
	<reg name="hpmcounter15" bitsize="64" regnum="0xc50" type="int"/>
	<reg name="hpmcounter16" bitsize="64" regnum="0xc51" type="int"/>
	<reg name="hpmcounter17" bitsize="64" regnum="0xc52" type="int"/>
	<!-- U-mode Float Extend Control -->
	<reg name="fxcr" bitsize="64" regnum="0x841" type="int"/>
	<!-- For Debug -->
	<reg name="dcsr" bitsize="64" regnum="0x7f1" type="int"/>
	<reg name="dpc"  bitsize="64" regnum="0x7f2" type="int"/>
  </feature>
  <feature name="org.gnu.gdb.riscv.virtual">
	<reg name="priv"  bitsize="64" regnum="0x1041" type="int"/>
  </feature>
</target>