Compare commits
9 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
d5f74ee06c | 4 months ago |
|
|
a42e0b2e97 | 10 months ago |
|
|
a88ed95c63 | 10 months ago |
|
|
34bfa6846b | 10 months ago |
|
|
713be74950 | 10 months ago |
|
|
80ee519818 | 10 months ago |
|
|
30d128fa17 | 10 months ago |
|
|
341476ed8d | 10 months ago |
|
|
7f8fe89c78 | 10 months ago |
@ -0,0 +1,3 @@
|
||||
.vscode/
|
||||
.metals/
|
||||
.VSCodeCounter/
|
||||
@ -0,0 +1,44 @@
|
||||
STUID = 244050090
|
||||
STUNAME = Felix
|
||||
|
||||
# DO NOT modify the following code!!!
|
||||
|
||||
TRACER = tracer-rvlab
|
||||
GITFLAGS = -q --author='$(TRACER) <tracer@kairos.hdu.edu.cn>' --no-verify --allow-empty
|
||||
|
||||
RVLAB_HOME = $(RVDIFF_HOME)/..
|
||||
WORK_BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
|
||||
WORK_INDEX = $(RVLAB_HOME)/.git/index.$(WORK_BRANCH)
|
||||
TRACER_BRANCH = $(TRACER)
|
||||
|
||||
LOCK_DIR = $(RVLAB_HOME)/.git/
|
||||
|
||||
# prototype: git_soft_checkout(branch)
|
||||
define git_soft_checkout
|
||||
git checkout --detach -q && git reset --soft $(1) -q -- && git checkout $(1) -q --
|
||||
endef
|
||||
|
||||
# prototype: git_commit(msg)
|
||||
define git_commit
|
||||
-@flock $(LOCK_DIR) $(MAKE) -C $(RVLAB_HOME) .git_commit MSG='$(1)'
|
||||
-@sync $(LOCK_DIR)
|
||||
endef
|
||||
|
||||
.git_commit:
|
||||
-@while (test -e .git/index.lock); do sleep 0.1; done; `# wait for other git instances`
|
||||
-@git branch $(TRACER_BRANCH) -q 2>/dev/null || true `# create tracer branch if not existent`
|
||||
-@cp -a .git/index $(WORK_INDEX) `# backup git index`
|
||||
-@$(call git_soft_checkout, $(TRACER_BRANCH)) `# switch to tracer branch`
|
||||
-@git add . -A --ignore-errors `# add files to commit`
|
||||
-@(echo "> $(MSG)" && echo $(STUID) $(STUNAME) && uname -a && uptime `# generate commit msg`) \
|
||||
| git commit -F - $(GITFLAGS) `# commit changes in tracer branch`
|
||||
-@$(call git_soft_checkout, $(WORK_BRANCH)) `# switch to work branch`
|
||||
-@mv $(WORK_INDEX) .git/index `# restore git index`
|
||||
|
||||
.clean_index:
|
||||
rm -f $(WORK_INDEX)
|
||||
|
||||
_default:
|
||||
@echo "Please run 'make' under subprojects."
|
||||
|
||||
.PHONY: .git_commit .clean_index _default
|
||||
@ -0,0 +1,28 @@
|
||||
*.*
|
||||
*
|
||||
!*/
|
||||
!Makefile
|
||||
!*.mk
|
||||
!*.scala
|
||||
!*.[cSh]
|
||||
!*.v
|
||||
!*.cpp
|
||||
!*.cc
|
||||
!.gitignore
|
||||
!.scalafmt.conf
|
||||
!build.sc
|
||||
!README.md
|
||||
!utils/*
|
||||
build/
|
||||
|
||||
# mill
|
||||
out/
|
||||
.bsp/
|
||||
.idea/
|
||||
.idea_modules/
|
||||
test_run_dir/
|
||||
|
||||
# vscode
|
||||
.metals/
|
||||
.vscode/
|
||||
.VSCodeCounter/
|
||||
@ -0,0 +1,36 @@
|
||||
version = 2.6.4
|
||||
|
||||
maxColumn = 120
|
||||
align = most
|
||||
continuationIndent.defnSite = 2
|
||||
assumeStandardLibraryStripMargin = true
|
||||
docstrings = ScalaDoc
|
||||
lineEndings = preserve
|
||||
includeCurlyBraceInSelectChains = false
|
||||
danglingParentheses = true
|
||||
|
||||
align.tokens.add = [
|
||||
{
|
||||
code = ":"
|
||||
},
|
||||
{
|
||||
code = ":="
|
||||
},
|
||||
{
|
||||
code = "="
|
||||
},
|
||||
{
|
||||
code = "->"
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
newlines.alwaysBeforeCurlyBraceLambdaParams = false
|
||||
newlines.alwaysBeforeMultilineDef = false
|
||||
newlines.implicitParamListModifierForce = [before]
|
||||
|
||||
verticalMultiline.atDefnSite = true
|
||||
|
||||
optIn.annotationNewlines = true
|
||||
|
||||
rewrite.rules = [SortImports, PreferCurlyFors, AvoidInfix]
|
||||
@ -0,0 +1,46 @@
|
||||
BUILD_DIR = ./build
|
||||
DIFF_DIR = ../difftest/core
|
||||
DIFF_WORK_DIR = ../difftest
|
||||
|
||||
export PATH := $(PATH):$(abspath ./utils)
|
||||
|
||||
verilog:
|
||||
$(call git_commit, "generate verilog") # DO NOT REMOVE THIS LINE!!!
|
||||
$(MAKE) clean
|
||||
mkdir -p $(BUILD_DIR)
|
||||
mill -i __.test.runMain Elaborate -td $(BUILD_DIR)
|
||||
|
||||
test:
|
||||
@echo "make test"
|
||||
$(call git_commit, "test chisel module") # DO NOT REMOVE THIS LINE!!!
|
||||
$(MAKE) clean
|
||||
mkdir -p $(BUILD_DIR)
|
||||
mill -i __.test.runMain TestMain -td $(BUILD_DIR)
|
||||
|
||||
count:
|
||||
find ./playground/ -name "*.scala" | xargs wc -l
|
||||
|
||||
help:
|
||||
mill -i __.test.runMain Elaborate --help
|
||||
|
||||
compile:
|
||||
mill -i __.compile
|
||||
|
||||
bsp:
|
||||
mill -i mill.bsp.BSP/install
|
||||
|
||||
reformat:
|
||||
mill -i __.reformat
|
||||
|
||||
checkformat:
|
||||
mill -i __.checkFormat
|
||||
|
||||
clean:
|
||||
-rm -rf $(BUILD_DIR)
|
||||
|
||||
.PHONY: test verilog help compile bsp reformat checkformat clean
|
||||
|
||||
sim:
|
||||
@echo "Write this Makefile by yourself."
|
||||
|
||||
-include ../Makefile
|
||||
@ -0,0 +1,38 @@
|
||||
# Chisel Project Template
|
||||
|
||||
Another version of the [Chisel template](https://github.com/ucb-bar/chisel-template) supporting mill.
|
||||
mill is another Scala/Java build tool without obscure DSL like SBT. It is much faster than SBT.
|
||||
|
||||
Contents at a glance:
|
||||
|
||||
- `.gitignore` - helps Git ignore junk like generated files, build products, and temporary files.
|
||||
- `build.sc` - instructs mill to build the Chisel project
|
||||
- `Makefile` - rules to call mill
|
||||
- `playground/src/GCD.scala` - GCD source file
|
||||
- `playground/src/DecoupledGCD.scala` - another GCD source file
|
||||
- `playground/src/Elaborate.scala` - wrapper file to call chisel command with the GCD module
|
||||
- `playground/test/src/GCDSpec.scala` - GCD tester
|
||||
|
||||
Feel free to rename or delete files under `playground/` or use them as a reference/template.
|
||||
|
||||
## Getting Started
|
||||
|
||||
First, install mill by referring to the documentation [here](https://com-lihaoyi.github.io/mill).
|
||||
|
||||
To run all tests in this design (recommended for test-driven development):
|
||||
|
||||
```bash
|
||||
make test
|
||||
```
|
||||
|
||||
To generate Verilog:
|
||||
|
||||
```bash
|
||||
make verilog
|
||||
```
|
||||
|
||||
## Change FIRRTL Compiler
|
||||
|
||||
You can change the FIRRTL compiler between SFC (Scala-based FIRRTL compiler) and
|
||||
MFC (MLIR-based FIRRTL compiler) by modifying the `useMFC` variable in `playground/src/Elaborate.scala`.
|
||||
The latter one requires `firtool`, which is included under `utils/`.
|
||||
@ -0,0 +1,45 @@
|
||||
// import Mill dependency
|
||||
import mill._
|
||||
import mill.scalalib._
|
||||
import mill.scalalib.scalafmt.ScalafmtModule
|
||||
import mill.scalalib.TestModule.ScalaTest
|
||||
// support BSP
|
||||
import mill.bsp._
|
||||
|
||||
object playground extends ScalaModule with ScalafmtModule { m =>
|
||||
val useChisel5 = false
|
||||
val useChisel6 = true
|
||||
override def scalaVersion = "2.13.10"
|
||||
override def scalacOptions = Seq(
|
||||
"-language:reflectiveCalls",
|
||||
"-deprecation",
|
||||
"-feature",
|
||||
"-Xcheckinit"
|
||||
)
|
||||
override def ivyDeps = Agg(
|
||||
if (useChisel5) ivy"org.chipsalliance::chisel:5.0.0"
|
||||
else if (useChisel6) ivy"org.chipsalliance::chisel:6.1.0"
|
||||
else
|
||||
ivy"edu.berkeley.cs::chisel3:3.6.0"
|
||||
)
|
||||
override def scalacPluginIvyDeps = Agg(
|
||||
if (useChisel5) ivy"org.chipsalliance:::chisel-plugin:5.0.0"
|
||||
else if (useChisel6) ivy"org.chipsalliance:::chisel-plugin:6.1.0"
|
||||
else
|
||||
ivy"edu.berkeley.cs:::chisel3-plugin:3.6.0"
|
||||
)
|
||||
object test extends ScalaTests with ScalaTest {
|
||||
override def ivyDeps = m.ivyDeps() ++ Agg(
|
||||
ivy"com.lihaoyi::utest:0.8.1",
|
||||
if (useChisel5 || useChisel6) ivy"edu.berkeley.cs::chiseltest:5.0.0"
|
||||
else
|
||||
ivy"edu.berkeley.cs::chiseltest:0.6.0"
|
||||
)
|
||||
}
|
||||
def repositoriesTask = T.task {
|
||||
Seq(
|
||||
coursier.MavenRepository("https://maven.aliyun.com/repository/central"),
|
||||
coursier.MavenRepository("https://repo.scala-sbt.org/scalasbt/maven-releases")
|
||||
) ++ super.repositoriesTask()
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package gcd
|
||||
|
||||
import chisel3._
|
||||
import chisel3.util.Decoupled
|
||||
|
||||
class GcdInputBundle(val w: Int) extends Bundle {
|
||||
val value1 = UInt(w.W)
|
||||
val value2 = UInt(w.W)
|
||||
}
|
||||
|
||||
class GcdOutputBundle(val w: Int) extends Bundle {
|
||||
val value1 = UInt(w.W)
|
||||
val value2 = UInt(w.W)
|
||||
val gcd = UInt(w.W)
|
||||
}
|
||||
|
||||
/** Compute Gcd using subtraction method. Subtracts the smaller from the larger until register y is zero. value input
|
||||
* register x is then the Gcd. Unless first input is zero then the Gcd is y. Can handle stalls on the producer or
|
||||
* consumer side
|
||||
*/
|
||||
class DecoupledGcd(width: Int) extends Module {
|
||||
val input = IO(Flipped(Decoupled(new GcdInputBundle(width))))
|
||||
val output = IO(Decoupled(new GcdOutputBundle(width)))
|
||||
|
||||
val xInitial = Reg(UInt())
|
||||
val yInitial = Reg(UInt())
|
||||
val x = Reg(UInt())
|
||||
val y = Reg(UInt())
|
||||
val busy = RegInit(false.B)
|
||||
val resultValid = RegInit(false.B)
|
||||
|
||||
input.ready := !busy
|
||||
output.valid := resultValid
|
||||
output.bits := DontCare
|
||||
|
||||
when(busy) {
|
||||
when(x > y) {
|
||||
x := x - y
|
||||
}.otherwise {
|
||||
y := y - x
|
||||
}
|
||||
when(x === 0.U || y === 0.U) {
|
||||
when(x === 0.U) {
|
||||
output.bits.gcd := y
|
||||
}.otherwise {
|
||||
output.bits.gcd := x
|
||||
}
|
||||
|
||||
output.bits.value1 := xInitial
|
||||
output.bits.value2 := yInitial
|
||||
resultValid := true.B
|
||||
|
||||
when(output.ready && resultValid) {
|
||||
busy := false.B
|
||||
resultValid := false.B
|
||||
}
|
||||
}
|
||||
}.otherwise {
|
||||
when(input.valid) {
|
||||
val bundle = input.deq()
|
||||
x := bundle.value1
|
||||
y := bundle.value2
|
||||
xInitial := bundle.value1
|
||||
yInitial := bundle.value2
|
||||
busy := true.B
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
object Elaborate extends App {
|
||||
val firtoolOptions = Array(
|
||||
"--lowering-options=" + List(
|
||||
// make yosys happy
|
||||
// see https://github.com/llvm/circt/blob/main/docs/VerilogGeneration.md
|
||||
"disallowLocalVariables",
|
||||
"disallowPackedArrays",
|
||||
"locationInfoStyle=wrapInAtSquareBracket"
|
||||
).reduce(_ + "," + _)
|
||||
)
|
||||
circt.stage.ChiselStage.emitSystemVerilogFile(new gcd.GCD(), args, firtoolOptions)
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package gcd
|
||||
|
||||
import chisel3._
|
||||
|
||||
/** Compute GCD using subtraction method. Subtracts the smaller from the larger until register y is zero. value in
|
||||
* register x is then the GCD
|
||||
*/
|
||||
class GCD extends Module {
|
||||
val io = IO(new Bundle {
|
||||
val value1 = Input(UInt(16.W))
|
||||
val value2 = Input(UInt(16.W))
|
||||
val loadingValues = Input(Bool())
|
||||
val outputGCD = Output(UInt(16.W))
|
||||
val outputValid = Output(Bool())
|
||||
})
|
||||
|
||||
val x = Reg(UInt())
|
||||
val y = Reg(UInt())
|
||||
|
||||
when(x > y) { x := x - y }.otherwise { y := y - x }
|
||||
|
||||
when(io.loadingValues) {
|
||||
x := io.value1
|
||||
y := io.value2
|
||||
}
|
||||
|
||||
io.outputGCD := x
|
||||
io.outputValid := y === 0.U
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
// See README.md for license details.
|
||||
|
||||
package gcd
|
||||
|
||||
import chisel3._
|
||||
import chisel3.experimental.BundleLiterals._
|
||||
import chisel3.simulator.EphemeralSimulator._
|
||||
import org.scalatest.freespec.AnyFreeSpec
|
||||
import org.scalatest.matchers.must.Matchers
|
||||
|
||||
/** This is a trivial example of how to run this Specification From within sbt use:
|
||||
* {{{
|
||||
* testOnly gcd.GCDSpec
|
||||
* }}}
|
||||
* From a terminal shell use:
|
||||
* {{{
|
||||
* sbt 'testOnly gcd.GCDSpec'
|
||||
* }}}
|
||||
* Testing from mill:
|
||||
* {{{
|
||||
* mill %NAME%.test.testOnly gcd.GCDSpec
|
||||
* }}}
|
||||
*/
|
||||
class GCDSpec extends AnyFreeSpec with Matchers {
|
||||
"Gcd should calculate proper greatest common denominator" in {
|
||||
simulate(new DecoupledGcd(16)) { dut =>
|
||||
val testValues = for {
|
||||
x <- 0 to 10
|
||||
y <- 0 to 10
|
||||
} yield (x, y)
|
||||
val inputSeq = testValues.map { case (x, y) => (new GcdInputBundle(16)).Lit(_.value1 -> x.U, _.value2 -> y.U) }
|
||||
val resultSeq = testValues.map { case (x, y) =>
|
||||
(new GcdOutputBundle(16)).Lit(_.value1 -> x.U, _.value2 -> y.U, _.gcd -> BigInt(x).gcd(BigInt(y)).U)
|
||||
}
|
||||
|
||||
dut.reset.poke(true.B)
|
||||
dut.clock.step()
|
||||
dut.reset.poke(false.B)
|
||||
dut.clock.step()
|
||||
|
||||
var sent, received, cycles: Int = 0
|
||||
while (sent != 100 && received != 100) {
|
||||
assert(cycles <= 1000, "timeout reached")
|
||||
|
||||
if (sent < 100) {
|
||||
dut.input.valid.poke(true.B)
|
||||
dut.input.bits.value1.poke(testValues(sent)._1.U)
|
||||
dut.input.bits.value2.poke(testValues(sent)._2.U)
|
||||
if (dut.input.ready.peek().litToBoolean) {
|
||||
sent += 1
|
||||
}
|
||||
}
|
||||
|
||||
if (received < 100) {
|
||||
dut.output.ready.poke(true.B)
|
||||
if (dut.output.valid.peekValue().asBigInt == 1) {
|
||||
dut.output.bits.gcd.expect(BigInt(testValues(received)._1).gcd(testValues(received)._2))
|
||||
received += 1
|
||||
}
|
||||
}
|
||||
|
||||
// Step the simulation forward.
|
||||
dut.clock.step()
|
||||
cycles += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env bash
|
||||
firtool.elf.strip --lowering-options=disallowLocalVariables,disallowPackedArrays,locationInfoStyle=wrapInAtSquareBracket $@
|
||||
Binary file not shown.
@ -0,0 +1,4 @@
|
||||
*.vcd
|
||||
obj_dir
|
||||
|
||||
trace.*
|
||||
@ -0,0 +1,128 @@
|
||||
TOP_NAME := top
|
||||
SRC_DIR := ./core
|
||||
SRC_FILE := $(shell find $(SRC_DIR) -name '*.svh') $(shell find $(SRC_DIR) -name '*.h') $(shell find $(SRC_DIR) -name '*.v') $(shell find $(SRC_DIR) -name '*.sv')
|
||||
CHISEL_DIR = ../chisel
|
||||
BUILD_DIR = $(CHISEL_DIR)/build
|
||||
TESTBIN_DIR = ./test/bin/am-tests/add.bin
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
obj_dir/V$(TOP_NAME): src/* $(SRC_FILE)
|
||||
verilator --cc -Wno-fatal --exe --trace-fst --trace-structs -LDFLAGS "-lpthread" --build src/sim_mycpu.cpp $(SRC_FILE) -I$(SRC_DIR) --top $(TOP_NAME) -j `nproc`
|
||||
|
||||
envtest:
|
||||
$(call git_commit, "env test") # DO NOT REMOVE THIS LINE!!!
|
||||
$(MAKE) -C $(CHISEL_DIR) verilog
|
||||
$(MAKE) lab1
|
||||
|
||||
verilog:
|
||||
$(MAKE) -C $(CHISEL_DIR) verilog
|
||||
cp $(CHISEL_DIR)/build/PuaCpu.v $(SRC_DIR)
|
||||
|
||||
trace: obj_dir/V$(TOP_NAME)
|
||||
$(call git_commit, "trace") # DO NOT REMOVE THIS LINE!!!
|
||||
./obj_dir/V$(TOP_NAME) $(TESTBIN_DIR) -rvtest -trace 10000000 -pc
|
||||
|
||||
test:
|
||||
$(MAKE) -C $(CHISEL_DIR) test
|
||||
|
||||
clean:
|
||||
rm -rf obj_dir
|
||||
rm -rf core/Puacpu.v
|
||||
|
||||
perf: obj_dir/V$(TOP_NAME)
|
||||
$(call git_commit, "perf test RTL") # DO NOT REMOVE THIS LINE!!!
|
||||
count=0; \
|
||||
for test in ./test/bin/riscv-test/benchmarks/*; do \
|
||||
count=$$((count + 1)); \
|
||||
echo "Running test $$count: $$test"; \
|
||||
./obj_dir/V$(TOP_NAME) $$test -rvtest -pc -perf; \
|
||||
done; \
|
||||
|
||||
lab1: obj_dir/V$(TOP_NAME)
|
||||
$(call git_commit, "test lab1") # DO NOT REMOVE THIS LINE!!!
|
||||
./obj_dir/V$(TOP_NAME) ./test/bin/lab-test/lab1.bin -rvtest -initgprs -trace 10000000 -pc
|
||||
|
||||
trace_lab1: obj_dir/V$(TOP_NAME)
|
||||
$(call git_commit, "trace lab1") # DO NOT REMOVE THIS LINE!!!
|
||||
./obj_dir/V$(TOP_NAME) ./test/bin/lab-test/lab1.bin -rvtest -initgprs -cpu_trace
|
||||
|
||||
TESTS234 := lab2 lab3 lab4
|
||||
TRACE_TESTS234 := $(addprefix trace_,$(TESTS234))
|
||||
|
||||
$(TESTS234): %: obj_dir/V$(TOP_NAME)
|
||||
$(call git_commit, "test $@") # DO NOT REMOVE THIS LINE!!!
|
||||
./obj_dir/V$(TOP_NAME) ./test/bin/lab-test/$@.bin -rvtest -trace 10000000 -pc
|
||||
|
||||
$(TRACE_TESTS234): trace_%: obj_dir/V$(TOP_NAME)
|
||||
$(call git_commit, "trace $*") # DO NOT REMOVE THIS LINE!!!
|
||||
./obj_dir/V$(TOP_NAME) ./test/bin/lab-test/$*.bin -rvtest -cpu_trace
|
||||
|
||||
lab5: obj_dir/V$(TOP_NAME)
|
||||
$(call git_commit, "test lab5") # DO NOT REMOVE THIS LINE!!!
|
||||
./obj_dir/V$(TOP_NAME) ./test/bin/lab-test/lab5.bin -rvtest -trace 10000000 -pc -hasdelayslot
|
||||
|
||||
trace_lab5: obj_dir/V$(TOP_NAME)
|
||||
$(call git_commit, "trace lab5") # DO NOT REMOVE THIS LINE!!!
|
||||
./obj_dir/V$(TOP_NAME) ./test/bin/lab-test/lab5.bin -rvtest -cpu_trace -hasdelayslot
|
||||
|
||||
TEST67 := lab6 lab7
|
||||
TRACE_TESTS67 := $(addprefix trace_,$(TEST67))
|
||||
|
||||
$(TEST67): obj_dir/V$(TOP_NAME)
|
||||
$(call git_commit, "test $@") # DO NOT REMOVE THIS LINE!!!
|
||||
count=0; \
|
||||
for test in ./test/bin/am-tests/*; do \
|
||||
count=$$((count + 1)); \
|
||||
echo "Running test $$count: $$test"; \
|
||||
./obj_dir/V$(TOP_NAME) $$test -rvtest -pc; \
|
||||
done; \
|
||||
count=$$((count + 1)); \
|
||||
echo "Running test $$count: ./test/bin/lab-test/lab6.bin"; \
|
||||
./obj_dir/V$(TOP_NAME) ./test/bin/lab-test/lab6.bin -rvtest -pc -perf; \
|
||||
echo "Total tests run: $$count";
|
||||
|
||||
$(TRACE_TESTS67): obj_dir/V$(TOP_NAME)
|
||||
$(call git_commit, "trace $*") # DO NOT REMOVE THIS LINE!!!
|
||||
rm -rf ./trace.txt
|
||||
count=0; \
|
||||
for test in ./test/bin/am-tests/*; do \
|
||||
count=$$((count + 1)); \
|
||||
echo "Running test $$count: $$test"; \
|
||||
./obj_dir/V$(TOP_NAME) $$test -rvtest -cpu_trace -writeappend; \
|
||||
done; \
|
||||
count=$$((count + 1)); \
|
||||
echo "Running test $$count: ./test/bin/lab-test/lab6.bin"; \
|
||||
./obj_dir/V$(TOP_NAME) ./test/bin/lab-test/lab6.bin -rvtest -cpu_trace -writeappend; \
|
||||
echo "Total tests run: $$count";
|
||||
|
||||
lab8: obj_dir/V$(TOP_NAME)
|
||||
$(call git_commit, "test lab8") # DO NOT REMOVE THIS LINE!!!
|
||||
./obj_dir/V$(TOP_NAME) ./test/bin/lab-test/lab8.bin -rvtest -trace 10000000 -pc -onlymodem
|
||||
|
||||
trace_lab8: obj_dir/V$(TOP_NAME)
|
||||
$(call git_commit, "trace lab8") # DO NOT REMOVE THIS LINE!!!
|
||||
rm -rf ./trace.txt
|
||||
./obj_dir/V$(TOP_NAME) ./test/bin/lab-test/lab8.bin -rvtest -cpu_trace -onlymodem
|
||||
|
||||
lab9: obj_dir/V$(TOP_NAME)
|
||||
$(call git_commit, "test lab9") # DO NOT REMOVE THIS LINE!!!
|
||||
count=0; \
|
||||
for test in $$(find ./test/bin/riscv-test/ \( -name "*rv64ui-p-*" -o -name "*rv64um-p-*" -o -name "*rv64mi-p-*" \) | grep -vE "*rv64ui-p-fence_i|*rv64mi-p-access"); do \
|
||||
count=$$((count + 1)); \
|
||||
echo "Running test $$count: $$test"; \
|
||||
./obj_dir/V$(TOP_NAME) $$test -rvtest -pc; \
|
||||
done; \
|
||||
echo "Total tests run: $$count";
|
||||
|
||||
trace_lab9: obj_dir/V$(TOP_NAME)
|
||||
$(call git_commit, "trace lab9") # DO NOT REMOVE THIS LINE!!!
|
||||
count=0; \
|
||||
for test in $$(find ./test/bin/riscv-test/ \( -name "*rv64ui-p-*" -o -name "*rv64um-p-*" -o -name "*rv64mi-p-*" \) | grep -vE "*rv64ui-p-fence_i|*rv64mi-p-access"); do \
|
||||
count=$$((count + 1)); \
|
||||
echo "Running test $$count: $$test"; \
|
||||
./obj_dir/V$(TOP_NAME) $$test -rvtest -cpu_trace -writeappend; \
|
||||
done; \
|
||||
echo "Total tests run: $$count";
|
||||
|
||||
-include ../Makefile
|
||||
@ -0,0 +1,33 @@
|
||||
# 🧬 RISCV-DIFFTEST
|
||||
|
||||
对 SRAM 结构的 [RISCV-LAB](https://code.educoder.net/ppg69fuwb/riscv-lab) 提供差分测试支持
|
||||
|
||||
差分测试框架修改自 [soc-simulator](https://github.com/cyyself/soc-simulator)
|
||||
|
||||
## 📑 目录说明
|
||||
|
||||
- `core` **存放待测试处理器的代码**,其顶层信号应与 `top_sram_wrapper` 中信号定义一致
|
||||
- `test` 存放测试代码
|
||||
- `src` 存放模拟器代码
|
||||
|
||||
## 🔨 使用方法
|
||||
|
||||
1. 将 CPU 代码放置到相对于本文件夹的 `core` 文件夹中。
|
||||
2. 在本文件夹下,使用 `make` 命令完成编译编译结果位于 `obj_dir/Vtop`
|
||||
3. 每次修改 CPU 代码后,需要重新 `make`,如果引入了一些时间早于编译产物的代码,需要先 `make clean` 再 `make`
|
||||
|
||||
## 🧪 参数说明
|
||||
|
||||
`makefile` 中已经预置了常用命令
|
||||
|
||||
在命令 `./obj_dir/Vtop` 后面可以加上不同参数,可以实现不同的功能:
|
||||
|
||||
- `无参数` 运行串口测试工具,打印 RISC-V LOGO
|
||||
- `<测试文件路径> -rvtest` 运行对应测试文件的差分测试
|
||||
|
||||
- 在上述命令后继续增加参数:
|
||||
- `-trace <记录波形时长>` 记录波形,并导出
|
||||
- `-starttrace <开始记录波形的时刻>` 从指定时刻开始记录一段固定时长的波形
|
||||
- `-pc` 报错时将额外输出最近的 PC 历史记录
|
||||
- `-delay` 行为不一致时将继续运行一段时间再停止
|
||||
- `-cpu_trace` 记录被测试的处理器的程序运行历史信息,生成 trace.txt
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,54 @@
|
||||
module top(
|
||||
input clock,
|
||||
input reset,
|
||||
// Interrupts
|
||||
input mei, // to PLIC
|
||||
input msi, // to CLINT
|
||||
input mti, // to CLINT
|
||||
input sei, // to PLIC
|
||||
// inst sram interface
|
||||
output inst_sram_en,
|
||||
output [ 3:0] inst_sram_wen,
|
||||
output [31:0] inst_sram_addr,
|
||||
output [31:0] inst_sram_wdata,
|
||||
input [31:0] inst_sram_rdata,
|
||||
// data sram interface
|
||||
output data_sram_en,
|
||||
output [ 7:0] data_sram_wen,
|
||||
output [31:0] data_sram_addr,
|
||||
output [63:0] data_sram_wdata,
|
||||
input [63:0] data_sram_rdata,
|
||||
// trace debug interface
|
||||
output debug_commit,
|
||||
output [63:0] debug_pc,
|
||||
output [4:0 ] debug_rf_wnum,
|
||||
output [63:0] debug_rf_wdata
|
||||
);
|
||||
|
||||
PuaCpu core(
|
||||
.clock (clock),
|
||||
.reset (reset),
|
||||
// interrupts
|
||||
.io_ext_int_mei (mei),
|
||||
.io_ext_int_mti (mti),
|
||||
.io_ext_int_msi (msi),
|
||||
// inst sram interface
|
||||
.io_inst_sram_en (inst_sram_en),
|
||||
.io_inst_sram_wen (inst_sram_wen),
|
||||
.io_inst_sram_addr (inst_sram_addr),
|
||||
.io_inst_sram_wdata (inst_sram_wdata),
|
||||
.io_inst_sram_rdata (inst_sram_rdata),
|
||||
// data sram interface
|
||||
.io_data_sram_en (data_sram_en),
|
||||
.io_data_sram_wen (data_sram_wen),
|
||||
.io_data_sram_addr (data_sram_addr),
|
||||
.io_data_sram_wdata (data_sram_wdata),
|
||||
.io_data_sram_rdata (data_sram_rdata),
|
||||
// debug
|
||||
.io_debug_pc (debug_pc),
|
||||
.io_debug_commit (debug_commit),
|
||||
.io_debug_rf_wnum (debug_rf_wnum),
|
||||
.io_debug_rf_wdata (debug_rf_wdata)
|
||||
);
|
||||
|
||||
endmodule
|
||||
@ -0,0 +1,10 @@
|
||||
#ifndef MMIO_DEV_H
|
||||
#define MMIO_DEV_H
|
||||
|
||||
class mmio_dev {
|
||||
public:
|
||||
virtual bool do_read (uint64_t start_addr, uint64_t size, uint8_t* buffer) = 0;
|
||||
virtual bool do_write(uint64_t start_addr, uint64_t size, const uint8_t* buffer) = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,140 @@
|
||||
#ifndef MMIO_MEM_H
|
||||
#define MMIO_MEM_H
|
||||
|
||||
#include "mmio_dev.hpp"
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
extern bool running;
|
||||
|
||||
class mmio_mem : public mmio_dev
|
||||
{
|
||||
public:
|
||||
mmio_mem(size_t size_bytes)
|
||||
{
|
||||
mem = new unsigned char[size_bytes];
|
||||
mem_size = size_bytes;
|
||||
}
|
||||
mmio_mem(size_t size_bytes, const unsigned char *init_binary, size_t init_binary_len) : mmio_mem(size_bytes)
|
||||
{
|
||||
// Initalize memory
|
||||
assert(init_binary_len <= size_bytes, "init_binary_len is larger than memory size.");
|
||||
memcpy(mem, init_binary, init_binary_len);
|
||||
}
|
||||
mmio_mem(size_t size_bytes, const char *init_file) : mmio_mem(size_bytes)
|
||||
{
|
||||
std::ifstream file(init_file, std::ios::in | std::ios::binary | std::ios::ate);
|
||||
size_t file_size = file.tellg();
|
||||
file.seekg(std::ios_base::beg);
|
||||
if (file_size > mem_size)
|
||||
{
|
||||
std::cerr << "mmio_mem size is not big enough for init file." << std::endl;
|
||||
file_size = size_bytes;
|
||||
}
|
||||
file.read((char *)mem, file_size);
|
||||
}
|
||||
~mmio_mem()
|
||||
{
|
||||
delete[] mem;
|
||||
}
|
||||
bool do_read(uint64_t start_addr, uint64_t size, uint8_t *buffer)
|
||||
{
|
||||
if (start_addr + size <= mem_size)
|
||||
{
|
||||
memcpy(buffer, &mem[start_addr], size);
|
||||
return true;
|
||||
}
|
||||
else if (allow_warp)
|
||||
{
|
||||
start_addr %= mem_size;
|
||||
if (start_addr + size <= mem_size)
|
||||
{
|
||||
memcpy(buffer, &mem[start_addr], size);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
bool do_write(uint64_t start_addr, uint64_t size, const uint8_t *buffer)
|
||||
{
|
||||
if (start_addr + size <= mem_size)
|
||||
{
|
||||
memcpy(&mem[start_addr], buffer, size);
|
||||
if (diff_mem_write)
|
||||
{
|
||||
for (int i = 0; i < size; i++)
|
||||
if (mem[start_addr + i] != diff_mem[start_addr + i])
|
||||
{
|
||||
running = false;
|
||||
printf("Error writeback cache at addr %lx\n", start_addr + i);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (allow_warp)
|
||||
{
|
||||
start_addr %= mem_size;
|
||||
if (start_addr + size <= mem_size)
|
||||
{
|
||||
memcpy(&mem[start_addr], buffer, size);
|
||||
if (diff_mem_write)
|
||||
{
|
||||
for (int i = 0; i < size; i++)
|
||||
if (mem[start_addr + i] != diff_mem[start_addr + i])
|
||||
{
|
||||
running = false;
|
||||
printf("Error writeback cache at addr %lx\n", start_addr + i);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
void load_binary(uint64_t start_addr, const char *init_file)
|
||||
{
|
||||
std::ifstream file(init_file, std::ios::in | std::ios::binary | std::ios::ate);
|
||||
size_t file_size = file.tellg();
|
||||
file.seekg(std::ios_base::beg);
|
||||
if (start_addr >= mem_size || file_size > mem_size - start_addr)
|
||||
{
|
||||
std::cerr << "memory size is not big enough for init file." << std::endl;
|
||||
file_size = mem_size;
|
||||
}
|
||||
file.read((char *)mem + start_addr, file_size);
|
||||
}
|
||||
void save_binary(const char *filename)
|
||||
{
|
||||
std::ofstream file(filename, std::ios::out | std::ios::binary);
|
||||
file.write((char *)mem, mem_size);
|
||||
}
|
||||
void set_allow_warp(bool value)
|
||||
{
|
||||
allow_warp = true;
|
||||
}
|
||||
unsigned char *get_mem_ptr()
|
||||
{
|
||||
return mem;
|
||||
}
|
||||
void set_diff_mem(unsigned char *diff_mem_addr)
|
||||
{
|
||||
diff_mem = diff_mem_addr;
|
||||
diff_mem_write = true;
|
||||
}
|
||||
|
||||
private:
|
||||
bool diff_mem_write = false;
|
||||
unsigned char *mem;
|
||||
unsigned char *diff_mem;
|
||||
size_t mem_size;
|
||||
bool allow_warp = false;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,123 @@
|
||||
#ifndef NSCSCC_SRAM_HPP
|
||||
#define NSCSCC_SRAM_HPP
|
||||
|
||||
#include <verilated.h>
|
||||
#include <condition_variable>
|
||||
#include <cstdint>
|
||||
#include <set>
|
||||
|
||||
#define AUTO_SIG(name, msb, lsb) \
|
||||
typename std::conditional <(msb-lsb+1) <= 8, CData, \
|
||||
typename std::conditional <(msb-lsb+1) <= 16, SData, \
|
||||
typename std::conditional <(msb-lsb+1) <= 32, IData, QData >::type >::type >::type name
|
||||
|
||||
#define AUTO_IN(name, msb, lsb) AUTO_SIG(name, msb, lsb)
|
||||
#define AUTO_OUT(name, msb, lsb) AUTO_SIG(name, msb, lsb)
|
||||
|
||||
struct nscscc_sram;
|
||||
|
||||
struct nscscc_sram_ptr {
|
||||
// inst channel
|
||||
AUTO_IN (*inst_sram_en, 0, 0) = NULL;
|
||||
AUTO_IN (*inst_sram_wen, 3, 0) = NULL;
|
||||
AUTO_IN (*inst_sram_addr, 31, 0) = NULL;
|
||||
AUTO_IN (*inst_sram_wdata, 31, 0) = NULL;
|
||||
AUTO_OUT(*inst_sram_rdata, 31, 0) = NULL;
|
||||
// data channel
|
||||
AUTO_IN (*data_sram_en, 0, 0) = NULL;
|
||||
AUTO_IN (*data_sram_wen, 7, 0) = NULL;
|
||||
AUTO_IN (*data_sram_addr, 31, 0) = NULL;
|
||||
AUTO_IN (*data_sram_wdata, 63, 0) = NULL;
|
||||
AUTO_OUT(*data_sram_rdata, 63, 0) = NULL;
|
||||
bool check() {
|
||||
std::set <void*> s;
|
||||
s.insert((void*)inst_sram_en);
|
||||
s.insert((void*)inst_sram_wen);
|
||||
s.insert((void*)inst_sram_addr);
|
||||
s.insert((void*)inst_sram_wdata);
|
||||
s.insert((void*)inst_sram_rdata);
|
||||
s.insert((void*)data_sram_en);
|
||||
s.insert((void*)data_sram_wen);
|
||||
s.insert((void*)data_sram_addr);
|
||||
s.insert((void*)data_sram_wdata);
|
||||
s.insert((void*)data_sram_rdata);
|
||||
return s.size() == 10 && s.count(NULL) == 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct nscscc_sram_ref {
|
||||
// inst channel
|
||||
AUTO_IN (&inst_sram_en, 0, 0);
|
||||
AUTO_IN (&inst_sram_wen, 3, 0);
|
||||
AUTO_IN (&inst_sram_addr, 31, 0);
|
||||
AUTO_IN (&inst_sram_wdata, 31, 0);
|
||||
AUTO_OUT(&inst_sram_rdata, 31, 0);
|
||||
// data channel
|
||||
AUTO_IN (&data_sram_en, 0, 0);
|
||||
AUTO_IN (&data_sram_wen, 7, 0);
|
||||
AUTO_IN (&data_sram_addr, 31, 0);
|
||||
AUTO_IN (&data_sram_wdata, 63, 0);
|
||||
AUTO_OUT(&data_sram_rdata, 63, 0);
|
||||
nscscc_sram_ref(nscscc_sram_ptr &ptr):
|
||||
inst_sram_en (*(ptr.inst_sram_en)),
|
||||
inst_sram_wen (*(ptr.inst_sram_wen)),
|
||||
inst_sram_addr (*(ptr.inst_sram_addr)),
|
||||
inst_sram_wdata (*(ptr.inst_sram_wdata)),
|
||||
inst_sram_rdata (*(ptr.inst_sram_rdata)),
|
||||
data_sram_en (*(ptr.data_sram_en)),
|
||||
data_sram_wen (*(ptr.data_sram_wen)),
|
||||
data_sram_addr (*(ptr.data_sram_addr)),
|
||||
data_sram_wdata (*(ptr.data_sram_wdata)),
|
||||
data_sram_rdata (*(ptr.data_sram_rdata))
|
||||
{}
|
||||
nscscc_sram_ref(nscscc_sram &sram);
|
||||
};
|
||||
|
||||
struct nscscc_sram {
|
||||
// inst channel
|
||||
AUTO_IN (inst_sram_en, 0, 0);
|
||||
AUTO_IN (inst_sram_wen, 3, 0);
|
||||
AUTO_IN (inst_sram_addr, 31, 0);
|
||||
AUTO_IN (inst_sram_wdata, 31, 0);
|
||||
AUTO_OUT(inst_sram_rdata, 31, 0);
|
||||
// data channel
|
||||
AUTO_IN (data_sram_en, 0, 0);
|
||||
AUTO_IN (data_sram_wen, 7, 0);
|
||||
AUTO_IN (data_sram_addr, 31, 0);
|
||||
AUTO_IN (data_sram_wdata, 63, 0);
|
||||
AUTO_OUT(data_sram_rdata, 63, 0);
|
||||
nscscc_sram() {
|
||||
// reset all pointer to zero
|
||||
memset(this,0,sizeof(*this));
|
||||
}
|
||||
void update_input(nscscc_sram_ref &ref) {
|
||||
inst_sram_en = ref.inst_sram_en;
|
||||
inst_sram_wen = ref.inst_sram_wen;
|
||||
inst_sram_addr = ref.inst_sram_addr;
|
||||
inst_sram_wdata = ref.inst_sram_wdata;
|
||||
data_sram_en = ref.data_sram_en;
|
||||
data_sram_wen = ref.data_sram_wen;
|
||||
data_sram_addr = ref.data_sram_addr;
|
||||
data_sram_wdata = ref.data_sram_wdata;
|
||||
}
|
||||
void update_output(nscscc_sram_ref &ref) {
|
||||
ref.inst_sram_rdata = inst_sram_rdata;
|
||||
ref.data_sram_rdata = data_sram_rdata;
|
||||
}
|
||||
};
|
||||
|
||||
nscscc_sram_ref::nscscc_sram_ref(nscscc_sram &sram):
|
||||
inst_sram_en (sram.inst_sram_en),
|
||||
inst_sram_wen (sram.inst_sram_wen),
|
||||
inst_sram_addr (sram.inst_sram_addr),
|
||||
inst_sram_wdata (sram.inst_sram_wdata),
|
||||
inst_sram_rdata (sram.inst_sram_rdata),
|
||||
data_sram_en (sram.data_sram_en),
|
||||
data_sram_wen (sram.data_sram_wen),
|
||||
data_sram_addr (sram.data_sram_addr),
|
||||
data_sram_wdata (sram.data_sram_wdata),
|
||||
data_sram_rdata (sram.data_sram_rdata)
|
||||
{}
|
||||
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,76 @@
|
||||
#ifndef NSCSCC_SRAM_SLAVE
|
||||
#define NSCSCC_SRAM_SLAVE
|
||||
|
||||
#include "nscscc_sram.hpp"
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
class nscscc_sram_slave
|
||||
{
|
||||
public:
|
||||
nscscc_sram_slave()
|
||||
{
|
||||
}
|
||||
void beat(nscscc_sram_ref &pin)
|
||||
{
|
||||
inst_channel(pin);
|
||||
data_channel(pin);
|
||||
}
|
||||
void inst_channel(nscscc_sram_ref &pin)
|
||||
{
|
||||
if (pin.inst_sram_en)
|
||||
{
|
||||
assert(!pin.inst_sram_wen);
|
||||
do_read(pin.inst_sram_addr & address_mask, 4, (uint8_t *)&(pin.inst_sram_rdata));
|
||||
}
|
||||
}
|
||||
void data_channel(nscscc_sram_ref &pin)
|
||||
{
|
||||
if (pin.data_sram_en)
|
||||
{
|
||||
if (pin.data_sram_wen)
|
||||
{
|
||||
std::vector<std::pair<int, int>> write_range = strb_to_range(pin.data_sram_wen);
|
||||
for (std::pair<int, int> sub_range : write_range)
|
||||
{
|
||||
int &addr = sub_range.first;
|
||||
int &len = sub_range.second;
|
||||
do_write(((pin.data_sram_addr & address_mask) & 0xfffffff8) + addr, len, ((uint8_t *)&(pin.data_sram_wdata)) + addr);
|
||||
}
|
||||
}
|
||||
do_read(pin.data_sram_addr & address_mask, 8, (uint8_t *)&(pin.data_sram_rdata));
|
||||
}
|
||||
}
|
||||
void set_address_mask(uint32_t new_mask)
|
||||
{
|
||||
address_mask = new_mask;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void do_read(uint64_t start_addr, uint64_t size, uint8_t *buffer) = 0;
|
||||
virtual void do_write(uint64_t start_addr, uint64_t size, const uint8_t *buffer) = 0;
|
||||
|
||||
private:
|
||||
uint32_t address_mask = 0xffffffff;
|
||||
std::vector<std::pair<int, int>> strb_to_range(AUTO_IN(wen, 7, 0))
|
||||
{
|
||||
std::vector<std::pair<int, int>> res;
|
||||
int l = 0;
|
||||
while (l < 8)
|
||||
{
|
||||
if ((wen >> l) & 1)
|
||||
{
|
||||
int r = l;
|
||||
while ((wen >> r) & 1 && r < 8)
|
||||
r++;
|
||||
res.emplace_back(l, r - l);
|
||||
l = r + 1;
|
||||
}
|
||||
else
|
||||
l++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,94 @@
|
||||
#ifndef NSCSCC_SRAM_XBAR
|
||||
#define NSCSCC_SRAM_XBAR
|
||||
|
||||
#include "nscscc_sram_slave.hpp"
|
||||
#include "mmio_dev.hpp"
|
||||
|
||||
#include <map>
|
||||
#include <utility>
|
||||
#include <algorithm>
|
||||
#include <climits>
|
||||
|
||||
void debug()
|
||||
{
|
||||
}
|
||||
|
||||
class nscscc_sram_xbar : public nscscc_sram_slave
|
||||
{
|
||||
public:
|
||||
nscscc_sram_xbar()
|
||||
{
|
||||
}
|
||||
bool add_dev(uint64_t start_addr, uint64_t length, mmio_dev *dev, bool byte_mode = false)
|
||||
{
|
||||
std::tuple<uint64_t, uint64_t, bool> addr_range = std::make_tuple(start_addr, start_addr + length, byte_mode);
|
||||
if (start_addr % length)
|
||||
return false;
|
||||
// check range
|
||||
auto it = devices.upper_bound(addr_range);
|
||||
if (it != devices.end())
|
||||
{
|
||||
uint64_t l_max = std::max(std::get<0>(it->first), std::get<0>(addr_range));
|
||||
uint64_t r_min = std::min(std::get<1>(it->first), std::get<1>(addr_range));
|
||||
if (l_max < r_min)
|
||||
return false; // overleap
|
||||
}
|
||||
if (it != devices.begin())
|
||||
{
|
||||
it = std::prev(it);
|
||||
uint64_t l_max = std::max(std::get<0>(it->first), std::get<0>(addr_range));
|
||||
uint64_t r_min = std::min(std::get<1>(it->first), std::get<1>(addr_range));
|
||||
if (l_max < r_min)
|
||||
return false; // overleap
|
||||
}
|
||||
// overleap check pass
|
||||
devices[addr_range] = dev;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected:
|
||||
void do_read(uint64_t start_addr, uint64_t size, unsigned char *buffer)
|
||||
{
|
||||
auto it = devices.upper_bound(std::make_tuple(start_addr, ULONG_MAX, true));
|
||||
if (it == devices.begin())
|
||||
{
|
||||
*((uint32_t *)buffer) = 0xdec0dee3;
|
||||
return;
|
||||
}
|
||||
it = std::prev(it);
|
||||
if (std::get<0>(it->first) <= start_addr && start_addr + 1 <= std::get<1>(it->first))
|
||||
{
|
||||
uint64_t dev_size = std::get<1>(it->first) - std::get<0>(it->first);
|
||||
if (std::get<2>(it->first))
|
||||
size = 1; // treat as byte device
|
||||
else
|
||||
start_addr -= start_addr & (size - 1);
|
||||
it->second->do_read(start_addr % dev_size, size, buffer + (start_addr % size));
|
||||
}
|
||||
else
|
||||
*((uint32_t *)buffer) = 0xdec0dee3;
|
||||
}
|
||||
void do_write(uint64_t start_addr, uint64_t size, const unsigned char *buffer)
|
||||
{
|
||||
auto it = devices.upper_bound(std::make_tuple(start_addr, ULONG_MAX, true));
|
||||
if (it == devices.begin())
|
||||
{
|
||||
*((uint32_t *)buffer) = 0xdec0dee3;
|
||||
return;
|
||||
}
|
||||
it = std::prev(it);
|
||||
uint64_t end_addr = start_addr + size;
|
||||
if (std::get<0>(it->first) <= start_addr && end_addr <= std::get<1>(it->first))
|
||||
{
|
||||
uint64_t dev_size = std::get<1>(it->first) - std::get<0>(it->first);
|
||||
it->second->do_write(start_addr % dev_size, size, buffer);
|
||||
}
|
||||
else
|
||||
*((uint32_t *)buffer) = 0xdec0dee3;
|
||||
}
|
||||
|
||||
private:
|
||||
std::map<std::tuple<uint64_t, uint64_t, bool>, mmio_dev *> devices;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,124 @@
|
||||
#ifndef RV_CLINT_HPP
|
||||
#define RV_CLINT_HPP
|
||||
|
||||
#include "mmio_dev.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
template <unsigned int nr_hart = 1>
|
||||
class rv_clint : public mmio_dev
|
||||
{
|
||||
public:
|
||||
rv_clint()
|
||||
{
|
||||
mtime = 0;
|
||||
for (int i = 0; i < nr_hart; i++)
|
||||
{
|
||||
mtimecmp[i] = 0;
|
||||
msip[i] = 0;
|
||||
}
|
||||
}
|
||||
bool do_read(uint64_t start_addr, uint64_t size, unsigned char *buffer)
|
||||
{
|
||||
if (start_addr >= 0x4000)
|
||||
{
|
||||
// mtimecmp, mtime
|
||||
if (start_addr >= 0xbff8 && start_addr + size <= 0xc000)
|
||||
{
|
||||
// mtime
|
||||
memcpy(buffer, ((char *)(&mtime)) + start_addr - 0xbff8, size);
|
||||
// printf("read mtime\n");
|
||||
}
|
||||
else if (start_addr >= 0x4000 && start_addr + size <= 0x4000 + 8 * nr_hart)
|
||||
{
|
||||
memcpy(buffer, ((char *)(&mtimecmp)) + start_addr - 0x4000, size);
|
||||
// printf("read mtimecmp\n");
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// msip
|
||||
if (start_addr + size <= 4 * nr_hart)
|
||||
{
|
||||
memcpy(buffer, ((char *)(&msip)) + start_addr, size);
|
||||
// printf("read msip\n");
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool do_write(uint64_t start_addr, uint64_t size, const unsigned char *buffer)
|
||||
{
|
||||
if (start_addr >= 0x4000)
|
||||
{
|
||||
// mtimecmp, mtime
|
||||
if (start_addr >= 0xbff8 && start_addr + size <= 0xc000)
|
||||
{
|
||||
// mtime
|
||||
memcpy(((char *)(&mtime)) + start_addr - 0xbff8, buffer, size);
|
||||
// printf("write mtime\n");
|
||||
}
|
||||
else if (start_addr >= 0x4000 && start_addr + size <= 0x4000 + 8 * nr_hart)
|
||||
{
|
||||
memcpy(((char *)(&mtimecmp)) + start_addr - 0x4000, buffer, size);
|
||||
// printf("write mtimecmp %lx mtime %lx size %d diff %lx\n",mtimecmp[0],mtime,(int)size,mtimecmp[0]-mtime);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// msip
|
||||
if (start_addr + size <= 4 * nr_hart)
|
||||
{
|
||||
memcpy(((char *)(&msip)) + start_addr, buffer, size);
|
||||
for (int i = 0; i < nr_hart; i++)
|
||||
msip[i] &= 1;
|
||||
// printf("write msip[0] %x\n",msip[0]);
|
||||
// printf("write msip[0] %x\n",msip[1]);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
void tick()
|
||||
{
|
||||
mtime++;
|
||||
}
|
||||
void synchronize(uint64_t time)
|
||||
{
|
||||
mtime = time;
|
||||
}
|
||||
uint64_t get_mtime()
|
||||
{
|
||||
return mtime;
|
||||
}
|
||||
bool m_s_irq(unsigned int hart_id)
|
||||
{ // machine software irq
|
||||
if (hart_id >= nr_hart)
|
||||
assert(false);
|
||||
else
|
||||
return (msip[hart_id] & 1);
|
||||
}
|
||||
bool m_t_irq(unsigned int hart_id)
|
||||
{ // machine timer irq
|
||||
if (hart_id >= nr_hart)
|
||||
assert(false);
|
||||
else
|
||||
return mtime > mtimecmp[hart_id];
|
||||
}
|
||||
void set_cmp(uint64_t new_val)
|
||||
{
|
||||
mtimecmp = new_val;
|
||||
}
|
||||
|
||||
private:
|
||||
uint64_t mtime;
|
||||
uint64_t mtimecmp[nr_hart];
|
||||
uint32_t msip[nr_hart];
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,466 @@
|
||||
#ifndef RV_COMMON
|
||||
#define RV_COMMON
|
||||
|
||||
union rv_instr
|
||||
{
|
||||
struct rv_r
|
||||
{
|
||||
unsigned int opcode : 7;
|
||||
unsigned int rd : 5;
|
||||
unsigned int funct3 : 3;
|
||||
unsigned int rs1 : 5;
|
||||
unsigned int rs2 : 5;
|
||||
unsigned int funct7 : 7;
|
||||
} r_type;
|
||||
|
||||
struct rv_i
|
||||
{
|
||||
unsigned int opcode : 7;
|
||||
unsigned int rd : 5;
|
||||
unsigned int funct3 : 3;
|
||||
unsigned int rs1 : 5;
|
||||
int imm12 : 12;
|
||||
} i_type;
|
||||
|
||||
struct rv_s
|
||||
{
|
||||
unsigned int opcode : 7;
|
||||
unsigned int imm_4_0 : 5;
|
||||
unsigned int funct3 : 3;
|
||||
unsigned int rs1 : 5;
|
||||
unsigned int rs2 : 5;
|
||||
int imm_11_5 : 7;
|
||||
} s_type;
|
||||
|
||||
struct rv_b
|
||||
{
|
||||
unsigned int opcode : 7;
|
||||
unsigned int imm_11 : 1;
|
||||
unsigned int imm_4_1 : 4;
|
||||
unsigned int funct3 : 3;
|
||||
unsigned int rs1 : 5;
|
||||
unsigned int rs2 : 5;
|
||||
unsigned int imm_10_5 : 6;
|
||||
int imm_12 : 1;
|
||||
} b_type;
|
||||
|
||||
struct rv_u
|
||||
{
|
||||
unsigned int opcode : 7;
|
||||
unsigned int rd : 5;
|
||||
int imm_31_12 : 20;
|
||||
} u_type;
|
||||
|
||||
struct rv_j
|
||||
{
|
||||
unsigned int opcode : 7;
|
||||
unsigned int rd : 5;
|
||||
unsigned int imm_19_12 : 8;
|
||||
unsigned int imm_11 : 1;
|
||||
unsigned int imm_10_1 : 10;
|
||||
int imm_20 : 1;
|
||||
} j_type;
|
||||
};
|
||||
|
||||
static_assert(sizeof(rv_instr) == 4, "Instruction Struct Error");
|
||||
|
||||
enum rv64i_opcode
|
||||
{
|
||||
OPCODE_LUI = 0b0110111,
|
||||
OPCODE_AUIPC = 0b0010111,
|
||||
OPCODE_JAL = 0b1101111,
|
||||
OPCODE_JALR = 0b1100111,
|
||||
OPCODE_BRANCH = 0b1100011,
|
||||
OPCODE_LOAD = 0b0000011,
|
||||
OPCODE_STORE = 0b0100011,
|
||||
OPCODE_OPIMM = 0b0010011,
|
||||
OPCODE_OPIMM32 = 0b0011011,
|
||||
OPCODE_OP = 0b0110011,
|
||||
OPCODE_OP32 = 0b0111011,
|
||||
OPCODE_FENCE = 0b0001111,
|
||||
OPCODE_SYSTEM = 0b1110011,
|
||||
OPCODE_AMO = 0b0101111
|
||||
};
|
||||
|
||||
// Concat(instr(1,0),instr(15,13))
|
||||
enum rv64c_opcode
|
||||
{ // without f/d
|
||||
OPCODE_C_ADDI4SPN = 0b00000,
|
||||
OPCODE_C_LW = 0b00010,
|
||||
OPCODE_C_LD = 0b00011,
|
||||
OPCODE_C_SW = 0b00110,
|
||||
OPCODE_C_SD = 0b00111,
|
||||
OPCODE_C_ADDI = 0b01000,
|
||||
OPCODE_C_ADDIW = 0b01001,
|
||||
OPCODE_C_LI = 0b01010,
|
||||
OPCODE_C_ADDI16SPN_LUI = 0b01011,
|
||||
OPCODE_C_ALU = 0b01100,
|
||||
OPCODE_C_J = 0b01101,
|
||||
OPCODE_C_BEQZ = 0b01110,
|
||||
OPCODE_C_BNEZ = 0b01111,
|
||||
OPCODE_C_SLLI = 0b10000,
|
||||
OPCODE_C_LWSP = 0b10010,
|
||||
OPCODE_C_LDSP = 0b10011,
|
||||
OPCODE_C_JR_MV_EB_JALR_ADD = 0b10100,
|
||||
OPCODE_C_SWSP = 0b10110,
|
||||
OPCODE_C_SDSP = 0b10111
|
||||
};
|
||||
|
||||
enum rv64c_funct2
|
||||
{
|
||||
FUNCT2_SUB = 0b00,
|
||||
FUNCT2_XOR_ADDW = 0b01,
|
||||
FUNCT2_OR = 0b10,
|
||||
FUNCT2_AND = 0b11
|
||||
};
|
||||
|
||||
enum funct3_branch
|
||||
{
|
||||
FUNCT3_BEQ = 0b000,
|
||||
FUNCT3_BNE = 0b001,
|
||||
FUNCT3_BLT = 0b100,
|
||||
FUNCT3_BGE = 0b101,
|
||||
FUNCT3_BLTU = 0b110,
|
||||
FUNCT3_BGEU = 0b111
|
||||
};
|
||||
enum funct3_load
|
||||
{
|
||||
FUNCT3_LB = 0b000,
|
||||
FUNCT3_LH = 0b001,
|
||||
FUNCT3_LW = 0b010,
|
||||
FUNCT3_LD = 0b011,
|
||||
FUNCT3_LBU = 0b100,
|
||||
FUNCT3_LHU = 0b101,
|
||||
FUNCT3_LWU = 0b110
|
||||
};
|
||||
enum funct3_store
|
||||
{
|
||||
FUNCT3_SB = 0b000,
|
||||
FUNCT3_SH = 0b001,
|
||||
FUNCT3_SW = 0b010,
|
||||
FUNCT3_SD = 0b011
|
||||
};
|
||||
|
||||
enum funct3_op
|
||||
{
|
||||
FUNCT3_ADD_SUB = 0b000,
|
||||
FUNCT3_SLL = 0b001,
|
||||
FUNCT3_SLT = 0b010,
|
||||
FUNCT3_SLTU = 0b011,
|
||||
FUNCT3_XOR = 0b100,
|
||||
FUNCT3_SRL_SRA = 0b101,
|
||||
FUNCT3_OR = 0b110,
|
||||
FUNCT3_AND = 0b111
|
||||
};
|
||||
|
||||
enum funct3_m
|
||||
{
|
||||
FUNCT3_MUL = 0b000,
|
||||
FUNCT3_MULH = 0b001,
|
||||
FUNCT3_MULHSU = 0b010,
|
||||
FUNCT3_MULHU = 0b011,
|
||||
FUNCT3_DIV = 0b100,
|
||||
FUNCT3_DIVU = 0b101,
|
||||
FUNCT3_REM = 0b110,
|
||||
FUNCT3_REMU = 0b111
|
||||
};
|
||||
|
||||
enum funct3_system
|
||||
{
|
||||
FUNCT3_PRIV = 0b000,
|
||||
FUNCT3_CSRRW = 0b001,
|
||||
FUNCT3_CSRRS = 0b010,
|
||||
FUNCT3_CSRRC = 0b011,
|
||||
FUNCT3_HLSV = 0b100,
|
||||
FUNCT3_CSRRWI = 0b101,
|
||||
FUNCT3_CSRRSI = 0b110,
|
||||
FUNCT3_CSRRCI = 0b111
|
||||
};
|
||||
|
||||
enum funct7_priv
|
||||
{
|
||||
FUNCT7_ECALL_EBREAK = 0b0000000,
|
||||
FUNCT7_SRET_WFI = 0b0001000,
|
||||
FUNCT7_MRET = 0b0011000,
|
||||
FUNCT7_SFENCE_VMA = 0b0001001
|
||||
};
|
||||
|
||||
enum amo_funct
|
||||
{
|
||||
AMOLR = 0b00010,
|
||||
AMOSC = 0b00011,
|
||||
AMOSWAP = 0b00001,
|
||||
AMOADD = 0b00000,
|
||||
AMOXOR = 0b00100,
|
||||
AMOAND = 0b01100,
|
||||
AMOOR = 0b01000,
|
||||
AMOMIN = 0b10000,
|
||||
AMOMAX = 0b10100,
|
||||
AMOMINU = 0b11000,
|
||||
AMOMAXU = 0b11100
|
||||
};
|
||||
|
||||
enum funct7
|
||||
{
|
||||
FUNCT7_NORMAL = 0b0000000,
|
||||
FUNCT7_SUB_SRA = 0b0100000,
|
||||
FUNCT7_MUL = 0b0000001
|
||||
};
|
||||
|
||||
enum funct6
|
||||
{
|
||||
FUNCT6_NORMAL = 0b000000,
|
||||
FUNCT6_SRA = 0b010000
|
||||
};
|
||||
|
||||
enum priv_mode
|
||||
{
|
||||
U_MODE = 0,
|
||||
S_MODE = 1,
|
||||
H_MODE = 2,
|
||||
M_MODE = 3
|
||||
};
|
||||
|
||||
enum rv_csr_addr
|
||||
{
|
||||
// Unprivileged Counter/Timers
|
||||
csr_cycle = 0xc00,
|
||||
csr_time = 0xc01,
|
||||
csr_instret = 0xc02,
|
||||
// Supervisor Trap Setup
|
||||
csr_sstatus = 0x100,
|
||||
csr_sie = 0x104,
|
||||
csr_stvec = 0x105,
|
||||
csr_scounteren = 0x106,
|
||||
// Supervisor Trap Handling
|
||||
csr_sscratch = 0x140,
|
||||
csr_sepc = 0x141,
|
||||
csr_scause = 0x142,
|
||||
csr_stval = 0x143,
|
||||
csr_sip = 0x144,
|
||||
// Supervisor Protection and Translation
|
||||
csr_satp = 0x180,
|
||||
// Machine Information Registers
|
||||
csr_mvendorid = 0xf11,
|
||||
csr_marchid = 0xf12,
|
||||
csr_mimpid = 0xf13,
|
||||
csr_mhartid = 0xf14,
|
||||
csr_mconfigptr = 0xf15,
|
||||
// Machine Trap Setup
|
||||
csr_mstatus = 0x300,
|
||||
csr_misa = 0x301,
|
||||
csr_medeleg = 0x302,
|
||||
csr_mideleg = 0x303,
|
||||
csr_mie = 0x304,
|
||||
csr_mtvec = 0x305,
|
||||
csr_mcounteren = 0x306,
|
||||
// Machine Trap Handling
|
||||
csr_mscratch = 0x340,
|
||||
csr_mepc = 0x341,
|
||||
csr_mcause = 0x342,
|
||||
csr_mtval = 0x343,
|
||||
csr_mip = 0x344,
|
||||
// Machine Memory Protection
|
||||
csr_pmpcfg0 = 0x3a0,
|
||||
csr_pmpcfg1 = 0x3a1,
|
||||
csr_pmpcfg2 = 0x3a2,
|
||||
csr_pmpcfg3 = 0x3a3,
|
||||
csr_pmpaddr0 = 0x3b0,
|
||||
csr_pmpaddr1 = 0x3b1,
|
||||
csr_pmpaddr2 = 0x3b2,
|
||||
csr_pmpaddr3 = 0x3b3,
|
||||
csr_pmpaddr4 = 0x3b4,
|
||||
csr_pmpaddr5 = 0x3b5,
|
||||
csr_pmpaddr6 = 0x3b6,
|
||||
csr_pmpaddr7 = 0x3b7,
|
||||
csr_pmpaddr8 = 0x3b8,
|
||||
csr_pmpaddr9 = 0x3b9,
|
||||
csr_pmpaddr10 = 0x3ba,
|
||||
csr_pmpaddr11 = 0x3bb,
|
||||
csr_pmpaddr12 = 0x3bc,
|
||||
csr_pmpaddr13 = 0x3bd,
|
||||
csr_pmpaddr14 = 0x3be,
|
||||
csr_pmpaddr15 = 0x3bf,
|
||||
// Machine Counter/Timers
|
||||
csr_mcycle = 0xb00,
|
||||
csr_minstret = 0xb02,
|
||||
csr_tselect = 0x7a0,
|
||||
csr_tdata1 = 0x7a1
|
||||
};
|
||||
|
||||
#define rv_ext(x) (1 << (x - 'a'))
|
||||
|
||||
struct csr_misa_def
|
||||
{
|
||||
uint64_t ext : 26;
|
||||
uint64_t blank : 36;
|
||||
uint64_t mxl : 2;
|
||||
};
|
||||
|
||||
struct csr_mstatus_def
|
||||
{
|
||||
uint64_t blank0 : 1;
|
||||
uint64_t sie : 1; // supervisor interrupt enable
|
||||
uint64_t blank1 : 1;
|
||||
uint64_t mie : 1; // machine interrupt enable
|
||||
uint64_t blank2 : 1;
|
||||
uint64_t spie : 1; // sie prior to trapping
|
||||
uint64_t ube : 1; // u big-endian, zero
|
||||
uint64_t mpie : 1; // mie prior to trapping
|
||||
uint64_t spp : 1; // supervisor previous privilege mode.
|
||||
uint64_t vs : 2; // without vector, zero
|
||||
uint64_t mpp : 2; // machine previous privilege mode.
|
||||
uint64_t fs : 2; // without float, zero
|
||||
uint64_t xs : 2; // without user ext, zero
|
||||
uint64_t mprv : 1; // Modify PRiVilege (Turn on virtual memory and protection for load/store in M-Mode) when mpp is not M-Mode
|
||||
// mprv will be used by OpenSBI.
|
||||
uint64_t sum : 1; // permit Supervisor User Memory access
|
||||
uint64_t mxr : 1; // Make eXecutable Readable
|
||||
uint64_t tvm : 1; // Trap Virtual Memory (raise trap when sfence.vma and sinval.vma executing in S-Mode)
|
||||
uint64_t tw : 1; // Timeout Wait for WFI
|
||||
uint64_t tsr : 1; // Trap SRET
|
||||
uint64_t blank3 : 9;
|
||||
uint64_t uxl : 2; // user xlen
|
||||
uint64_t sxl : 2; // supervisor xlen
|
||||
uint64_t sbe : 1; // s big-endian
|
||||
uint64_t mbe : 1; // m big-endian
|
||||
uint64_t blank4 : 25;
|
||||
uint64_t sd : 1; // no vs,fs,xs, zero
|
||||
};
|
||||
|
||||
struct csr_sstatus_def
|
||||
{
|
||||
uint64_t blank0 : 1;
|
||||
uint64_t sie : 1; // supervisor interrupt enable
|
||||
uint64_t blank1 : 3;
|
||||
uint64_t spie : 1; // sie prior to trapping
|
||||
uint64_t ube : 1; // u big-endian, zero
|
||||
uint64_t blank2 : 1; // mie prior to trapping
|
||||
uint64_t spp : 1; // supervisor previous privilege mode.
|
||||
uint64_t vs : 2; // without vector, zero
|
||||
uint64_t blank3 : 2; // machine previous privilege mode.
|
||||
uint64_t fs : 2; // without float, zero
|
||||
uint64_t xs : 2; // without user ext, zero
|
||||
uint64_t blank4 : 1;
|
||||
uint64_t sum : 1; // permit Supervisor User Memory access
|
||||
uint64_t mxr : 1; // Make eXecutable Readable
|
||||
uint64_t blank5 : 12;
|
||||
uint64_t uxl : 2; // user xlen
|
||||
uint64_t blank6 : 29;
|
||||
uint64_t sd : 1; // no vs,fs,xs, zero
|
||||
};
|
||||
|
||||
struct csr_cause_def
|
||||
{
|
||||
uint64_t cause : 63;
|
||||
uint64_t interrupt : 1;
|
||||
csr_cause_def(uint64_t cause, uint64_t interrupt = 0) : cause(cause), interrupt(interrupt) {}
|
||||
csr_cause_def() : cause(0), interrupt(0) {}
|
||||
};
|
||||
|
||||
struct csr_tvec_def
|
||||
{
|
||||
uint64_t mode : 2; // 0: Direct, 1: Vectored
|
||||
uint64_t base : 62;
|
||||
};
|
||||
|
||||
struct int_def
|
||||
{ // interrupt pending
|
||||
uint64_t blank0 : 1;
|
||||
uint64_t s_s_ip : 1; // 1
|
||||
uint64_t blank1 : 1;
|
||||
uint64_t m_s_ip : 1; // 3
|
||||
uint64_t blank2 : 1;
|
||||
uint64_t s_t_ip : 1; // 5
|
||||
uint64_t blank3 : 1;
|
||||
uint64_t m_t_ip : 1; // 7
|
||||
uint64_t blank4 : 1;
|
||||
uint64_t s_e_ip : 1; // 9
|
||||
uint64_t blank5 : 1;
|
||||
uint64_t m_e_ip : 1; // 11
|
||||
};
|
||||
|
||||
enum rv_int_code
|
||||
{
|
||||
int_s_sw = 1,
|
||||
int_m_sw = 3,
|
||||
int_s_timer = 5,
|
||||
int_m_timer = 7,
|
||||
int_s_ext = 9,
|
||||
int_m_ext = 11
|
||||
};
|
||||
|
||||
// supervisor interrupt mask
|
||||
const uint64_t s_int_mask = (1ull << int_s_ext) | (1ull << int_s_sw) | (1ull << int_s_timer);
|
||||
// machine interrupt mask
|
||||
const uint64_t m_int_mask = s_int_mask | (1ull << int_m_ext) | (1ull << int_m_sw) | (1ull << int_m_timer);
|
||||
|
||||
enum rv_exc_code
|
||||
{
|
||||
exc_instr_misalign = 0,
|
||||
exc_instr_acc_fault = 1,
|
||||
exc_illegal_instr = 2,
|
||||
exc_breakpoint = 3,
|
||||
exc_load_misalign = 4,
|
||||
exc_load_acc_fault = 5,
|
||||
exc_store_misalign = 6, // including amo
|
||||
exc_store_acc_fault = 7, // including amo
|
||||
exc_ecall_from_user = 8,
|
||||
exc_ecall_from_supervisor = 9,
|
||||
exc_ecall_from_machine = 11,
|
||||
exc_instr_pgfault = 12,
|
||||
exc_load_pgfault = 13,
|
||||
exc_store_pgfault = 15, // including amo
|
||||
exc_custom_ok = 24
|
||||
};
|
||||
|
||||
const uint64_t s_exc_mask = (1 << 16) - 1 - (1 << exc_ecall_from_machine);
|
||||
|
||||
struct csr_counteren_def
|
||||
{
|
||||
uint64_t cycle : 1;
|
||||
uint64_t time : 1;
|
||||
uint64_t instr_retire : 1;
|
||||
uint64_t blank : 61;
|
||||
};
|
||||
|
||||
const uint64_t counter_mask = (1 << 0) | (1 << 2);
|
||||
|
||||
struct sv39_pte
|
||||
{
|
||||
uint64_t V : 1; // valid
|
||||
uint64_t R : 1; // read
|
||||
uint64_t W : 1; // write
|
||||
uint64_t X : 1; // execute
|
||||
uint64_t U : 1; // user
|
||||
uint64_t G : 1; // global
|
||||
uint64_t A : 1; // access
|
||||
uint64_t D : 1; // dirty
|
||||
uint64_t RSW : 2; // reserved for use by supervisor softwar
|
||||
uint64_t PPN0 : 9;
|
||||
uint64_t PPN1 : 9;
|
||||
uint64_t PPN2 : 26;
|
||||
uint64_t reserved : 7;
|
||||
uint64_t PBMT : 2; // Svpbmt is not implemented, return 0
|
||||
uint64_t N : 1;
|
||||
};
|
||||
static_assert(sizeof(sv39_pte) == 8, "sv39_pte shoule be 8 bytes.");
|
||||
// Note: A and D not implement. So use them as permission bit and raise page fault.
|
||||
|
||||
struct satp_def
|
||||
{
|
||||
uint64_t ppn : 44;
|
||||
uint64_t asid : 16;
|
||||
uint64_t mode : 4;
|
||||
};
|
||||
|
||||
struct sv39_va
|
||||
{
|
||||
uint64_t page_off : 12;
|
||||
uint64_t vpn_0 : 9;
|
||||
uint64_t vpn_1 : 9;
|
||||
uint64_t vpn_2 : 9;
|
||||
uint64_t blank : 25;
|
||||
};
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,136 @@
|
||||
#ifndef RV_PLIC_HPP
|
||||
#define RV_PLIC_HPP
|
||||
|
||||
#include "mmio_dev.hpp"
|
||||
#include <cstring>
|
||||
#include <climits>
|
||||
#include <bitset>
|
||||
|
||||
// We need 2 context corresponding to meip and seip per hart.
|
||||
template <int nr_source = 1, int nr_context = 2>
|
||||
class rv_plic : public mmio_dev {
|
||||
public:
|
||||
rv_plic() {
|
||||
for (int i=0;i<(nr_source+1);i++) {
|
||||
priority[i] = 0;
|
||||
}
|
||||
for (int i=0;i<((nr_source+1+31)/32);i++) {
|
||||
pending[i] = 0;
|
||||
claimed[i] = 0;
|
||||
}
|
||||
for (int i=0;i<nr_context;i++) {
|
||||
for (int j=0;j<((nr_source+1+31)/32);j++) enable[i][j] = 0;
|
||||
threshold[i] = 0;
|
||||
claim[i] = 0;
|
||||
}
|
||||
}
|
||||
void update_ext(int source_id, bool fired) {
|
||||
pending[source_id/32] &= ~(1u << (source_id % 32));
|
||||
if (fired) pending[source_id/32] |= 1u << (source_id % 32);
|
||||
}
|
||||
bool get_int(int context_id) {
|
||||
uint64_t max_priority = 0;
|
||||
uint64_t max_priority_int = 0;
|
||||
for (int i=1;i<=nr_source;i++) {
|
||||
if (priority[i] >= threshold[context_id] && (pending[i/32]>>(i%32)) && (enable[context_id][i/32]>>(i%32)) && !(claimed[i/32]>>(i%32))) {
|
||||
if (priority[i] > max_priority) {
|
||||
max_priority = priority[i];
|
||||
max_priority_int = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (max_priority_int) claim[context_id] = max_priority_int;
|
||||
else claim[context_id] = 0;
|
||||
return claim[context_id] != 0;
|
||||
}
|
||||
bool do_read(uint64_t start_addr, uint64_t size, unsigned char* buffer) {
|
||||
// printf("PLIC read: 0x%lx, size: 0x%lx\n", start_addr, size);
|
||||
// assert(size == 4);
|
||||
if (start_addr + size <= 0x1000) { // [0x4,0x1000] interrupt source priority
|
||||
if (start_addr == 0) return false;
|
||||
if (start_addr > 4 * nr_source || start_addr + size > 4 * (nr_source + 1)) return false;
|
||||
*((uint32_t*)buffer) = priority[start_addr/4];
|
||||
return true;
|
||||
}
|
||||
else if (start_addr + size <= 0x1080) { // [0x1000,0x1080] interrupt pending bits
|
||||
uint64_t idx = (start_addr - 0x1000) / 4;
|
||||
if (idx > nr_source) return false;
|
||||
*((uint32_t*)buffer) = pending[idx];
|
||||
return true;
|
||||
}
|
||||
else if (start_addr + size <= 0x2000) {
|
||||
return false; // error
|
||||
}
|
||||
else if (start_addr + size <= 0x200000) { // enable bits for sources on context
|
||||
uint64_t context_id = (start_addr - 0x2000) / 0x80;
|
||||
uint64_t pos = start_addr % 0x80;
|
||||
if (context_id >= nr_context) return false;
|
||||
if (pos > nr_source) return false;
|
||||
*((uint32_t*)buffer) = enable[context_id][pos];
|
||||
return true;
|
||||
}
|
||||
else { // priority threshold and claim/complete
|
||||
uint64_t context_id = (start_addr - 0x200000) / 0x1000;
|
||||
if (context_id > nr_context) return false;
|
||||
uint64_t offset = start_addr % 0x1000;
|
||||
if (offset == 0) { // priority threshold
|
||||
*((uint32_t*)buffer) = threshold[context_id];
|
||||
return true;
|
||||
}
|
||||
else if (offset == 4) { // claim/complete
|
||||
(*((uint32_t*)buffer)) = claim[context_id];
|
||||
claimed[claim[context_id]/32] |= 1u << (claim[context_id]%32);
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool do_write(uint64_t start_addr, uint64_t size, const unsigned char* buffer) {
|
||||
if (start_addr + size <= 0x1000) { // [0x4,0x1000] interrupt source priority
|
||||
if (start_addr == 0) return false;
|
||||
if (start_addr > 4 * nr_source || start_addr + size > 4 * (nr_source + 1)) return false;
|
||||
priority[start_addr/4] = *((uint32_t*)buffer);
|
||||
return true;
|
||||
}
|
||||
else if (start_addr + size <= 0x1080) { // [0x1000,0x1080] interrupt pending bits
|
||||
return true;
|
||||
}
|
||||
else if (start_addr + size <= 0x2000) {
|
||||
return false; // error
|
||||
}
|
||||
else if (start_addr + size <= 0x200000) { // enable bits for sources on context
|
||||
uint64_t context_id = (start_addr - 0x2000) / 0x80;
|
||||
uint64_t pos = start_addr % 0x80;
|
||||
if (context_id >= nr_context) return false;
|
||||
if (pos > nr_source) return false;
|
||||
enable[context_id][pos] = *((uint32_t*)buffer);
|
||||
return true;
|
||||
}
|
||||
else { // priority threshold and claim/complete
|
||||
uint64_t context_id = (start_addr - 0x200000) / 0x1000;
|
||||
if (context_id > nr_context) return false;
|
||||
uint64_t offset = start_addr % 0x1000;
|
||||
if (offset == 0) { // priority threshold
|
||||
threshold[context_id] = *((uint32_t*)buffer);
|
||||
return true;
|
||||
}
|
||||
else if (offset == 4) { // claim/complete
|
||||
claimed[(*((uint32_t*)buffer))/32] &= ~(1u << ((*((uint32_t*)buffer)%32)));
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
private:
|
||||
// source 0 is reserved.
|
||||
uint32_t priority[nr_source+1];
|
||||
uint32_t pending[(nr_source+1+31)/32];
|
||||
uint32_t enable[nr_context][(nr_source+1+31)/32];
|
||||
uint32_t threshold[nr_context];
|
||||
uint32_t claim[nr_context];
|
||||
uint32_t claimed[(nr_source+1+31)/32];
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,798 @@
|
||||
#ifndef RV_CSR_HPP
|
||||
#define RV_CSR_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <bitset>
|
||||
#include <assert.h>
|
||||
|
||||
#include "rv_common.hpp"
|
||||
#include "rv_systembus.hpp"
|
||||
#include "rv_sv39.hpp"
|
||||
|
||||
extern bool run_riscv_test;
|
||||
extern bool perf_counter;
|
||||
extern long long total_instr;
|
||||
extern long long total_cycle;
|
||||
extern bool only_modeM;
|
||||
class rv_priv
|
||||
{
|
||||
public:
|
||||
void difftest_preexec(uint64_t pua_mcycle, uint64_t pua_minstret, uint64_t pua_mip, bool interrupt_on)
|
||||
{
|
||||
cur_need_trap = false;
|
||||
mcycle = pua_mcycle;
|
||||
minstret = pua_minstret;
|
||||
ip = pua_mip;
|
||||
cur_priv = next_priv;
|
||||
}
|
||||
rv_priv(uint64_t hart_id, uint64_t &pc, rv_systembus &bus) : hart_id(hart_id), cur_pc(pc), bus(bus), sv39(bus)
|
||||
{
|
||||
reset();
|
||||
}
|
||||
void reset()
|
||||
{
|
||||
trap_pc = 0;
|
||||
cur_need_trap = false;
|
||||
cur_priv = M_MODE;
|
||||
next_priv = M_MODE;
|
||||
status = 0;
|
||||
csr_mstatus_def *mstatus = (csr_mstatus_def *)&status;
|
||||
csr_misa_def *isa = (csr_misa_def *)&misa;
|
||||
if (only_modeM && run_riscv_test)
|
||||
{
|
||||
isa->ext = rv_ext('i') | rv_ext('m') | rv_ext('u');
|
||||
mstatus->mpp = M_MODE;
|
||||
}
|
||||
else
|
||||
{
|
||||
mstatus->uxl = 2;
|
||||
isa->ext = rv_ext('i') | rv_ext('m') | rv_ext('u');
|
||||
}
|
||||
isa->mxl = 2; // rv64
|
||||
isa->blank = 0;
|
||||
medeleg = 0;
|
||||
mideleg = 0;
|
||||
ie = 0;
|
||||
mtvec = 0;
|
||||
mscratch = 0;
|
||||
mepc = 0;
|
||||
mcause = 0;
|
||||
mtval = 0;
|
||||
mcounteren = 0;
|
||||
ip = 0;
|
||||
mcycle = 0;
|
||||
minstret = 0;
|
||||
stvec = 0;
|
||||
sscratch = 0;
|
||||
sepc = 0;
|
||||
scause = 0;
|
||||
stval = 0;
|
||||
satp = 0;
|
||||
scounteren = 0;
|
||||
}
|
||||
void check_and_raise_int()
|
||||
{ // TODO: Find interrupts trap priority compare to exceptions. Now interrupts are prior to exceptions.
|
||||
/*
|
||||
An interrupt i will trap to M-mode (causing the privilege mode to change to M-mode) if all of
|
||||
the following are true: (a) either the current privilege mode is M and the MIE bit in the mstatus
|
||||
register is set, or the current privilege mode has less privilege than M-mode; (b) bit i is set in both
|
||||
mip and mie; and (c) if register mideleg exists, bit i is not set in mideleg
|
||||
*/
|
||||
/*
|
||||
An interrupt i will trap to S-mode if both of the following are true: (a) either the current privilege
|
||||
mode is S and the SIE bit in the sstatus register is set, or the current privilege mode has less
|
||||
privilege than S-mode; and (b) bit i is set in both sip and sie.
|
||||
*/
|
||||
/*
|
||||
out of spec: mideleg layout as sip rather than mip.
|
||||
M[EST]I bits in mideleg is hardwired 0.
|
||||
OpenSBI will not delegate these ints to S-Mode. So we don't need to implement.
|
||||
*/
|
||||
// Note: WFI is not affacted by mstatus.mie and mstatus.sie and mideleg, but we implement WFI as nop currently.
|
||||
csr_mstatus_def *mstatus = (csr_mstatus_def *)&status;
|
||||
uint64_t int_bits = ip & ie;
|
||||
uint64_t final_int_index = exc_custom_ok;
|
||||
if (cur_priv == M_MODE)
|
||||
{
|
||||
// Note: We should use mideleg as interrupt disable in M-Mode as interrupts didn't transfer to lower levels.
|
||||
uint64_t mmode_int_bits = int_bits & (~mideleg);
|
||||
if (mmode_int_bits && mstatus->mie)
|
||||
final_int_index = int2index(mmode_int_bits);
|
||||
}
|
||||
else
|
||||
{
|
||||
// check traps to smode or mmode
|
||||
uint64_t int_index = int2index(int_bits);
|
||||
if ((1ul << int_index) & mideleg)
|
||||
{ // delegate to s
|
||||
// Note: If delegate to S but sie is 0, we should not raise trap to M-Mode.
|
||||
if (mstatus->sie || cur_priv < S_MODE)
|
||||
final_int_index = int_index;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mstatus->mie || cur_priv < M_MODE)
|
||||
final_int_index = int_index;
|
||||
}
|
||||
}
|
||||
if (final_int_index != exc_custom_ok)
|
||||
raise_trap(csr_cause_def(final_int_index, 1));
|
||||
}
|
||||
void pre_exec(bool meip, bool msip, bool mtip, bool seip)
|
||||
{
|
||||
mcycle++;
|
||||
int_def *ip_bits = (int_def *)&ip;
|
||||
ip_bits->m_e_ip = meip;
|
||||
ip_bits->m_s_ip = msip;
|
||||
ip_bits->m_t_ip = mtip;
|
||||
ip_bits->s_e_ip = seip;
|
||||
cur_need_trap = false;
|
||||
cur_priv = next_priv;
|
||||
check_and_raise_int();
|
||||
}
|
||||
bool need_trap()
|
||||
{
|
||||
return cur_need_trap;
|
||||
}
|
||||
uint64_t get_trap_pc()
|
||||
{
|
||||
return trap_pc;
|
||||
}
|
||||
void post_exec()
|
||||
{
|
||||
if (!cur_need_trap)
|
||||
minstret++;
|
||||
cur_need_trap = false;
|
||||
csr_mstatus_def *mstatus = (csr_mstatus_def *)&status;
|
||||
assert(mstatus->blank0 == 0);
|
||||
assert(mstatus->blank1 == 0);
|
||||
assert(mstatus->blank2 == 0);
|
||||
assert(mstatus->blank3 == 0);
|
||||
assert(mstatus->blank4 == 0);
|
||||
}
|
||||
|
||||
// The following CSR operations didn't check permissions.
|
||||
// If the csr didn't exist, return false. (and core should call raise_trap to raise illeagal instruction)
|
||||
bool csr_read(rv_csr_addr csr_index, uint64_t &csr_result)
|
||||
{
|
||||
switch (csr_index)
|
||||
{
|
||||
case csr_mvendorid:
|
||||
csr_result = 0;
|
||||
break;
|
||||
case csr_marchid:
|
||||
csr_result = 0;
|
||||
break;
|
||||
case csr_mimpid:
|
||||
csr_result = 0;
|
||||
break;
|
||||
case csr_mhartid:
|
||||
csr_result = hart_id;
|
||||
break;
|
||||
case csr_mconfigptr:
|
||||
csr_result = 0;
|
||||
break;
|
||||
case csr_mstatus:
|
||||
csr_result = status;
|
||||
break;
|
||||
case csr_misa:
|
||||
{
|
||||
csr_result = misa;
|
||||
break;
|
||||
}
|
||||
case csr_medeleg:
|
||||
csr_result = medeleg;
|
||||
break;
|
||||
case csr_mideleg:
|
||||
csr_result = mideleg;
|
||||
break;
|
||||
case csr_mie:
|
||||
csr_result = ie;
|
||||
break;
|
||||
case csr_mtvec:
|
||||
csr_result = mtvec;
|
||||
break;
|
||||
case csr_mcounteren:
|
||||
csr_result = mcounteren;
|
||||
break;
|
||||
case csr_mscratch:
|
||||
csr_result = mscratch;
|
||||
break;
|
||||
case csr_mepc:
|
||||
csr_result = mepc;
|
||||
break;
|
||||
case csr_mcause:
|
||||
csr_result = mcause;
|
||||
break;
|
||||
case csr_mtval:
|
||||
csr_result = mtval;
|
||||
break;
|
||||
case csr_mip:
|
||||
csr_result = ip;
|
||||
break;
|
||||
case csr_mcycle:
|
||||
csr_result = mcycle;
|
||||
break;
|
||||
case csr_minstret:
|
||||
csr_result = minstret;
|
||||
break;
|
||||
case csr_cycle:
|
||||
{
|
||||
csr_result = mcycle;
|
||||
break;
|
||||
}
|
||||
case csr_tselect:
|
||||
csr_result = 1;
|
||||
break;
|
||||
case csr_tdata1:
|
||||
csr_result = 0;
|
||||
break;
|
||||
default:
|
||||
{
|
||||
csr_result = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool csr_write(rv_csr_addr csr_index, uint64_t csr_data)
|
||||
{
|
||||
switch (csr_index)
|
||||
{
|
||||
case csr_misa:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case csr_mstatus:
|
||||
{
|
||||
csr_mstatus_def *nstatus = (csr_mstatus_def *)&csr_data;
|
||||
csr_mstatus_def *mstatus = (csr_mstatus_def *)&status;
|
||||
if (only_modeM && run_riscv_test)
|
||||
{
|
||||
mstatus->mie = nstatus->mie;
|
||||
mstatus->mpie = nstatus->mpie;
|
||||
}
|
||||
else
|
||||
{
|
||||
// mstatus->sie = nstatus->sie;
|
||||
mstatus->mie = nstatus->mie;
|
||||
// mstatus->spie = nstatus->spie;
|
||||
mstatus->mpie = nstatus->mpie;
|
||||
assert(mstatus->spie != 2);
|
||||
assert(mstatus->mpie != 2);
|
||||
// mstatus->spp = nstatus->spp;
|
||||
mstatus->mpp = (nstatus->mpp == 3 || nstatus->mpp == 0) ? nstatus->mpp : 0;
|
||||
mstatus->mprv = nstatus->mprv;
|
||||
// mstatus->sum = nstatus->sum; // always true
|
||||
// mstatus->mxr = nstatus->mxr; // always true
|
||||
// mstatus->tvm = nstatus->tvm;
|
||||
// mstatus->tw = nstatus->tw; // not supported but wfi impl as nop
|
||||
// mstatus->tsr = nstatus->tsr;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case csr_mie:
|
||||
ie = csr_data & m_int_mask;
|
||||
break;
|
||||
case csr_mtvec:
|
||||
{
|
||||
csr_tvec_def *tvec = (csr_tvec_def *)&csr_data;
|
||||
assert(tvec->mode <= 1);
|
||||
mtvec = csr_data;
|
||||
break;
|
||||
}
|
||||
case csr_mcounteren:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case csr_mscratch:
|
||||
mscratch = csr_data;
|
||||
break;
|
||||
case csr_mepc:
|
||||
mepc = csr_data;
|
||||
break;
|
||||
case csr_mcause:
|
||||
mcause = csr_data;
|
||||
break;
|
||||
case csr_mtval:
|
||||
mtval = csr_data;
|
||||
break;
|
||||
case csr_mip:
|
||||
ip = csr_data & m_int_mask;
|
||||
break;
|
||||
case csr_mcycle:
|
||||
mcycle = csr_data;
|
||||
break;
|
||||
case csr_tselect:
|
||||
break;
|
||||
case csr_tdata1:
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool csr_setbit(rv_csr_addr csr_index, uint64_t csr_mask)
|
||||
{
|
||||
uint64_t tmp;
|
||||
bool ret = csr_read(csr_index, tmp);
|
||||
if (!ret)
|
||||
return false;
|
||||
tmp |= csr_mask;
|
||||
ret &= csr_write(csr_index, tmp);
|
||||
return ret;
|
||||
}
|
||||
bool csr_clearbit(rv_csr_addr csr_index, uint64_t csr_mask)
|
||||
{
|
||||
uint64_t tmp;
|
||||
bool ret = csr_read(csr_index, tmp);
|
||||
if (!ret)
|
||||
return false;
|
||||
tmp &= ~csr_mask;
|
||||
ret &= csr_write(csr_index, tmp);
|
||||
return ret;
|
||||
}
|
||||
bool csr_op_permission_check(uint16_t csr_index, bool write)
|
||||
{
|
||||
/*
|
||||
We can make a simple implementation for csr_cycle as following:
|
||||
0. "cycle" is the only user level CSR we need to implement to pass the RISC-V Test.
|
||||
1. mcounteren can be read only zero, so any privilege level other than Machine will cause trap.
|
||||
2. If S-Mode didn't implement, we can just check whether the privilege mode is Machine for illegal instruction check.
|
||||
*/
|
||||
if (cur_priv != M_MODE)
|
||||
return false;
|
||||
if ((((csr_index >> 10) & 3) == 3) && write)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
// Note: The core should raise exceptions when return value is not exc_custom_ok.
|
||||
// fetch instruction
|
||||
rv_exc_code va_if(uint64_t start_addr, uint64_t size, uint8_t *buffer, uint64_t &bad_va)
|
||||
{
|
||||
if (size == 4 && start_addr % 4 == 2)
|
||||
{
|
||||
rv_exc_code res0 = va_if(start_addr, 2, buffer, bad_va);
|
||||
if (res0 != exc_custom_ok)
|
||||
return res0;
|
||||
rv_exc_code res1 = va_if(start_addr + 2, 2, buffer + 2, bad_va);
|
||||
if (res1 != exc_custom_ok)
|
||||
return res1;
|
||||
return exc_custom_ok;
|
||||
}
|
||||
else
|
||||
{
|
||||
bad_va = start_addr;
|
||||
const satp_def *satp_reg = (satp_def *)&satp;
|
||||
if (cur_priv == M_MODE || satp_reg->mode == 0)
|
||||
{
|
||||
bool pstatus = bus.pa_read(start_addr, size, buffer);
|
||||
if (!pstatus)
|
||||
return exc_instr_acc_fault;
|
||||
else
|
||||
return exc_custom_ok;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Note: If the pc misalign but didn't beyond page range, the exception should be raise by core.
|
||||
if ((start_addr >> 12) != ((start_addr + size - 1) >> 12))
|
||||
return exc_instr_misalign;
|
||||
sv39_tlb_entry *tlb_e = sv39.local_tlbe_get(*satp_reg, start_addr);
|
||||
if (!tlb_e || !tlb_e->A || !tlb_e->X)
|
||||
return exc_instr_pgfault;
|
||||
if ((cur_priv == U_MODE && !tlb_e->U) || (cur_priv == S_MODE && tlb_e->U))
|
||||
return exc_instr_pgfault;
|
||||
uint64_t pa = tlb_e->ppa + (start_addr % ((tlb_e->pagesize == 1) ? (1 << 12) : ((tlb_e->pagesize == 2) ? (1 << 21) : (1 << 30))));
|
||||
bool pstatus = bus.pa_read(pa, size, buffer);
|
||||
if (!pstatus)
|
||||
return exc_instr_acc_fault;
|
||||
else
|
||||
return exc_custom_ok;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rv_exc_code va_read(uint64_t start_addr, uint64_t size, uint8_t *buffer)
|
||||
{
|
||||
const satp_def *satp_reg = (satp_def *)&satp;
|
||||
const csr_mstatus_def *mstatus = (csr_mstatus_def *)&status;
|
||||
if ((cur_priv == M_MODE && (!mstatus->mprv || mstatus->mpp == M_MODE)) || satp_reg->mode == 0)
|
||||
{
|
||||
bool pstatus = bus.pa_read(start_addr, size, buffer);
|
||||
if (!pstatus)
|
||||
return exc_load_acc_fault;
|
||||
else
|
||||
return exc_custom_ok;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((start_addr >> 12) != ((start_addr + size - 1) >> 12))
|
||||
return exc_load_misalign;
|
||||
sv39_tlb_entry *tlb_e = sv39.local_tlbe_get(*satp_reg, start_addr);
|
||||
if (!tlb_e || !tlb_e->A || (!tlb_e->R && !(mstatus->mxr && !tlb_e->X)))
|
||||
return exc_load_pgfault;
|
||||
priv_mode priv = (mstatus->mprv && cur_priv == M_MODE) ? static_cast<priv_mode>(mstatus->mpp) : cur_priv;
|
||||
if (priv == U_MODE && !tlb_e->U)
|
||||
return exc_load_pgfault;
|
||||
if (!mstatus->sum && priv == S_MODE && tlb_e->U)
|
||||
return exc_load_acc_fault;
|
||||
uint64_t pa = tlb_e->ppa + (start_addr % ((tlb_e->pagesize == 1) ? (1 << 12) : ((tlb_e->pagesize == 2) ? (1 << 21) : (1 << 30))));
|
||||
bool pstatus = bus.pa_read(pa, size, buffer);
|
||||
if (!pstatus)
|
||||
return exc_load_acc_fault;
|
||||
else
|
||||
return exc_custom_ok;
|
||||
}
|
||||
}
|
||||
|
||||
rv_exc_code va_write(uint64_t start_addr, uint64_t size, const uint8_t *buffer)
|
||||
{
|
||||
const satp_def *satp_reg = (satp_def *)&satp;
|
||||
const csr_mstatus_def *mstatus = (csr_mstatus_def *)&status;
|
||||
if ((cur_priv == M_MODE && (!mstatus->mprv || mstatus->mpp == M_MODE)) || satp_reg->mode == 0)
|
||||
{
|
||||
if (run_riscv_test)
|
||||
{
|
||||
if (start_addr == 0x80001000)
|
||||
{
|
||||
uint64_t tohost = *(uint64_t *)buffer;
|
||||
if (tohost == 1)
|
||||
{
|
||||
if (tohost == 1)
|
||||
{
|
||||
printf("\033[32mTest Pass!\n");
|
||||
if (perf_counter)
|
||||
{
|
||||
printf("Total instr: %lld\n", total_instr);
|
||||
printf("Total cycle: %lld\n", total_cycle);
|
||||
printf("IPC: %lf\n", (double)total_instr / total_cycle);
|
||||
}
|
||||
printf("\033[0m"); // Reset the text color to default
|
||||
exit(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Failed with value 0x%lx\n", tohost);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
bool pstatus = bus.pa_write(start_addr, size, buffer);
|
||||
if (!pstatus)
|
||||
return exc_store_acc_fault;
|
||||
else
|
||||
return exc_custom_ok;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((start_addr >> 12) != ((start_addr + size - 1) >> 12))
|
||||
return exc_store_misalign;
|
||||
sv39_tlb_entry *tlb_e = sv39.local_tlbe_get(*satp_reg, start_addr);
|
||||
if (!tlb_e || !tlb_e->A || !tlb_e->D || !tlb_e->W)
|
||||
return exc_store_pgfault;
|
||||
priv_mode priv = (mstatus->mprv && cur_priv == M_MODE) ? static_cast<priv_mode>(mstatus->mpp) : cur_priv;
|
||||
if (priv == U_MODE && !tlb_e->U)
|
||||
return exc_store_pgfault;
|
||||
if (!mstatus->sum && priv == S_MODE && tlb_e->U)
|
||||
return exc_store_pgfault;
|
||||
uint64_t pa = tlb_e->ppa + (start_addr % ((tlb_e->pagesize == 1) ? (1 << 12) : ((tlb_e->pagesize == 2) ? (1 << 21) : (1 << 30))));
|
||||
if (run_riscv_test)
|
||||
{
|
||||
if (pa == 0x80001000)
|
||||
{
|
||||
uint64_t tohost = *(uint64_t *)buffer;
|
||||
if (tohost == 1)
|
||||
{
|
||||
if (tohost == 1)
|
||||
{
|
||||
printf("\033[32mTest Pass!\n");
|
||||
if (perf_counter)
|
||||
{
|
||||
printf("Total instr: %lld\n", total_instr);
|
||||
printf("Total cycle: %lld\n", total_cycle);
|
||||
printf("IPC: %lf\n", (double)total_instr / total_cycle);
|
||||
}
|
||||
printf("\033[0m"); // Reset the text color to default
|
||||
exit(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Failed with value 0x%lx\n", tohost);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
bool pstatus = bus.pa_write(pa, size, buffer);
|
||||
if (!pstatus)
|
||||
return exc_store_pgfault;
|
||||
else
|
||||
return exc_custom_ok;
|
||||
}
|
||||
}
|
||||
// note: core should check whether amoop and start_addr is valid
|
||||
rv_exc_code va_lr(uint64_t start_addr, uint64_t size, uint8_t *buffer)
|
||||
{
|
||||
assert(size == 4 || size == 8);
|
||||
const satp_def *satp_reg = (satp_def *)&satp;
|
||||
const csr_mstatus_def *mstatus = (csr_mstatus_def *)&status;
|
||||
if ((cur_priv == M_MODE && (!mstatus->mprv || mstatus->mpp == M_MODE)) || satp_reg->mode == 0)
|
||||
{
|
||||
bool pstatus = bus.pa_lr(start_addr, size, buffer, hart_id);
|
||||
if (!pstatus)
|
||||
return exc_store_acc_fault;
|
||||
else
|
||||
return exc_custom_ok;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((start_addr >> 12) != ((start_addr + size - 1) >> 12))
|
||||
return exc_store_misalign;
|
||||
sv39_tlb_entry *tlb_e = sv39.local_tlbe_get(*satp_reg, start_addr);
|
||||
if (!tlb_e || !tlb_e->A || (!tlb_e->R && !(mstatus->mxr && !tlb_e->X)))
|
||||
return exc_store_pgfault;
|
||||
priv_mode priv = (mstatus->mprv && cur_priv == M_MODE) ? static_cast<priv_mode>(mstatus->mpp) : cur_priv;
|
||||
if (priv == U_MODE && !tlb_e->U)
|
||||
return exc_store_pgfault;
|
||||
if (!mstatus->sum && priv == S_MODE && tlb_e->U)
|
||||
return exc_store_acc_fault;
|
||||
uint64_t pa = tlb_e->ppa + (start_addr % ((tlb_e->pagesize == 1) ? (1 << 12) : ((tlb_e->pagesize == 2) ? (1 << 21) : (1 << 30))));
|
||||
bool pstatus = bus.pa_lr(pa, size, buffer, hart_id);
|
||||
if (!pstatus)
|
||||
return exc_store_acc_fault;
|
||||
else
|
||||
return exc_custom_ok;
|
||||
}
|
||||
}
|
||||
// Note: if va_sc return != exc_custom_ok, sc_fail shouldn't commit.
|
||||
rv_exc_code va_sc(uint64_t start_addr, uint64_t size, const uint8_t *buffer, bool &sc_fail)
|
||||
{
|
||||
assert(size == 4 || size == 8);
|
||||
const satp_def *satp_reg = (satp_def *)&satp;
|
||||
const csr_mstatus_def *mstatus = (csr_mstatus_def *)&status;
|
||||
if ((cur_priv == M_MODE && (!mstatus->mprv || mstatus->mpp == M_MODE)) || satp_reg->mode == 0)
|
||||
{
|
||||
bool pstatus = bus.pa_sc(start_addr, size, buffer, hart_id, sc_fail);
|
||||
if (!pstatus)
|
||||
return exc_store_acc_fault;
|
||||
else
|
||||
return exc_custom_ok;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((start_addr >> 12) != ((start_addr + size - 1) >> 12))
|
||||
return exc_store_misalign;
|
||||
sv39_tlb_entry *tlb_e = sv39.local_tlbe_get(*satp_reg, start_addr);
|
||||
if (!tlb_e || !tlb_e->A || !tlb_e->D || !tlb_e->W)
|
||||
return exc_store_pgfault;
|
||||
priv_mode priv = (mstatus->mprv && cur_priv == M_MODE) ? static_cast<priv_mode>(mstatus->mpp) : cur_priv;
|
||||
if (priv == U_MODE && !tlb_e->U)
|
||||
return exc_store_pgfault;
|
||||
if (!mstatus->sum && priv == S_MODE && tlb_e->U)
|
||||
return exc_store_pgfault;
|
||||
uint64_t pa = tlb_e->ppa + (start_addr % ((tlb_e->pagesize == 1) ? (1 << 12) : ((tlb_e->pagesize == 2) ? (1 << 21) : (1 << 30))));
|
||||
bool pstatus = bus.pa_sc(pa, size, buffer, hart_id, sc_fail);
|
||||
if (!pstatus)
|
||||
return exc_store_pgfault;
|
||||
else
|
||||
return exc_custom_ok;
|
||||
}
|
||||
}
|
||||
rv_exc_code va_amo(uint64_t start_addr, uint64_t size, amo_funct op, int64_t src, int64_t &dst)
|
||||
{
|
||||
assert(size == 4 || size == 8);
|
||||
const satp_def *satp_reg = (satp_def *)&satp;
|
||||
const csr_mstatus_def *mstatus = (csr_mstatus_def *)&status;
|
||||
if ((cur_priv == M_MODE && (!mstatus->mprv || mstatus->mpp == M_MODE)) || satp_reg->mode == 0)
|
||||
{
|
||||
bool pstatus = bus.pa_amo_op(start_addr, size, op, src, dst);
|
||||
if (!pstatus)
|
||||
return exc_store_acc_fault;
|
||||
else
|
||||
return exc_custom_ok;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((start_addr >> 12) != ((start_addr + size - 1) >> 12))
|
||||
return exc_store_misalign;
|
||||
sv39_tlb_entry *tlb_e = sv39.local_tlbe_get(*satp_reg, start_addr);
|
||||
if (!tlb_e || !tlb_e->A || !tlb_e->D || !tlb_e->W)
|
||||
return exc_store_pgfault;
|
||||
priv_mode priv = (mstatus->mprv && cur_priv == M_MODE) ? static_cast<priv_mode>(mstatus->mpp) : cur_priv;
|
||||
if (priv == U_MODE && !tlb_e->U)
|
||||
return exc_store_pgfault;
|
||||
if (!mstatus->sum && priv == S_MODE && tlb_e->U)
|
||||
return exc_store_pgfault;
|
||||
uint64_t pa = tlb_e->ppa + (start_addr % ((tlb_e->pagesize == 1) ? (1 << 12) : ((tlb_e->pagesize == 2) ? (1 << 21) : (1 << 30))));
|
||||
bool pstatus = bus.pa_amo_op(pa, size, op, src, dst);
|
||||
if (!pstatus)
|
||||
return exc_store_pgfault;
|
||||
else
|
||||
return exc_custom_ok;
|
||||
}
|
||||
}
|
||||
|
||||
void ecall()
|
||||
{
|
||||
csr_cause_def cause;
|
||||
cause.cause = cur_priv + 8;
|
||||
cause.interrupt = 0;
|
||||
raise_trap(cause);
|
||||
}
|
||||
void ebreak()
|
||||
{
|
||||
csr_cause_def cause;
|
||||
cause.cause = exc_breakpoint;
|
||||
cause.interrupt = 0;
|
||||
raise_trap(cause);
|
||||
}
|
||||
bool mret()
|
||||
{ // if return false, raise illegal instruction
|
||||
if (cur_priv != M_MODE)
|
||||
return false;
|
||||
csr_mstatus_def *mstatus = (csr_mstatus_def *)&status;
|
||||
mstatus->mie = mstatus->mpie;
|
||||
next_priv = static_cast<priv_mode>(mstatus->mpp);
|
||||
mstatus->mpie = 1;
|
||||
if (mstatus->mpp != M_MODE)
|
||||
mstatus->mprv = 0;
|
||||
mstatus->mpp = U_MODE;
|
||||
cur_need_trap = true;
|
||||
trap_pc = mepc;
|
||||
return true;
|
||||
}
|
||||
bool sret()
|
||||
{ // if return false, raise illegal instruction
|
||||
const csr_mstatus_def *mstatus = (csr_mstatus_def *)&status;
|
||||
if (cur_priv < S_MODE || mstatus->tsr)
|
||||
return false;
|
||||
csr_mstatus_def *sstatus = (csr_mstatus_def *)&status;
|
||||
sstatus->sie = sstatus->spie;
|
||||
next_priv = static_cast<priv_mode>(sstatus->spp);
|
||||
sstatus->spie = 1;
|
||||
if (sstatus->spp != M_MODE)
|
||||
sstatus->mprv = 0; // It's correct to set mprv rather than sprv.
|
||||
sstatus->spp = U_MODE;
|
||||
cur_need_trap = true;
|
||||
trap_pc = sepc;
|
||||
return true;
|
||||
}
|
||||
bool sfence_vma(uint64_t vaddr, uint64_t asid)
|
||||
{
|
||||
const csr_mstatus_def *mstatus = (csr_mstatus_def *)&status;
|
||||
if (cur_priv < S_MODE || (cur_priv == S_MODE && mstatus->tvm))
|
||||
return false;
|
||||
sv39.sfence_vma(vaddr, asid);
|
||||
return true;
|
||||
}
|
||||
void raise_trap(csr_cause_def cause, uint64_t tval = 0)
|
||||
{
|
||||
assert(!cur_need_trap);
|
||||
cur_need_trap = true;
|
||||
bool trap_to_s = false;
|
||||
// printf("trap %ld, tval = 0x%lx, pc=0x%lx, mode=%d\n",cause.cause,tval,cur_pc,cur_priv);
|
||||
// check delegate to s
|
||||
if (cur_priv != M_MODE)
|
||||
{
|
||||
if (cause.interrupt)
|
||||
{
|
||||
if (mideleg & (1 << cause.cause))
|
||||
trap_to_s = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (medeleg & (1 << cause.cause))
|
||||
trap_to_s = true;
|
||||
}
|
||||
}
|
||||
if (trap_to_s)
|
||||
{
|
||||
stval = tval;
|
||||
scause = *((uint64_t *)&cause);
|
||||
sepc = cur_pc;
|
||||
csr_sstatus_def *sstatus = (csr_sstatus_def *)&status;
|
||||
sstatus->spie = sstatus->sie;
|
||||
sstatus->sie = 0;
|
||||
sstatus->spp = cur_priv;
|
||||
csr_tvec_def *tvec = (csr_tvec_def *)&stvec;
|
||||
trap_pc = (tvec->base << 2) + ((tvec->mode == 1) ? (cause.cause) * 4 : 0);
|
||||
next_priv = S_MODE;
|
||||
}
|
||||
else
|
||||
{
|
||||
mtval = tval;
|
||||
mcause = *((uint64_t *)&cause);
|
||||
mepc = cur_pc;
|
||||
csr_mstatus_def *mstatus = (csr_mstatus_def *)&status;
|
||||
mstatus->mpie = mstatus->mie;
|
||||
mstatus->mie = 0;
|
||||
mstatus->mpp = cur_priv;
|
||||
csr_tvec_def *tvec = (csr_tvec_def *)&mtvec;
|
||||
trap_pc = (tvec->base << 2) + (tvec->mode ? (cause.cause) * 4 : 0);
|
||||
next_priv = M_MODE;
|
||||
}
|
||||
if (cause.cause == exc_instr_pgfault && tval == trap_pc)
|
||||
assert(false);
|
||||
}
|
||||
uint64_t get_cycle()
|
||||
{
|
||||
return mcycle;
|
||||
}
|
||||
|
||||
private:
|
||||
uint64_t int2index(uint64_t int_mask)
|
||||
{ // with priority
|
||||
/*
|
||||
According to spec, multiple simultaneous
|
||||
interrupts destined for M-mode are handled
|
||||
in the following decreasing :
|
||||
MEI, MSI, MTI, SEI, SSI, STI.
|
||||
*/
|
||||
if (int_mask & (1ull << int_m_ext))
|
||||
{
|
||||
return int_m_ext;
|
||||
}
|
||||
else if (int_mask & (1ull << int_m_sw))
|
||||
{
|
||||
return int_m_sw;
|
||||
}
|
||||
else if (int_mask & (1ull << int_m_timer))
|
||||
{
|
||||
return int_m_timer;
|
||||
}
|
||||
else if (int_mask & (1ull << int_s_ext))
|
||||
{
|
||||
return int_s_ext;
|
||||
}
|
||||
else if (int_mask & (1ull << int_s_sw))
|
||||
{
|
||||
return int_s_sw;
|
||||
}
|
||||
else if (int_mask & (1ull << int_s_timer))
|
||||
{
|
||||
return int_s_timer;
|
||||
}
|
||||
else
|
||||
return exc_custom_ok;
|
||||
}
|
||||
// status
|
||||
const uint64_t &cur_pc;
|
||||
priv_mode cur_priv;
|
||||
uint64_t hart_id;
|
||||
// hart
|
||||
bool cur_need_trap;
|
||||
uint64_t trap_pc;
|
||||
priv_mode next_priv;
|
||||
// sv39
|
||||
rv_sv39<32> sv39;
|
||||
// pbus
|
||||
rv_systembus &bus;
|
||||
// CSRs
|
||||
uint64_t status;
|
||||
uint64_t misa;
|
||||
uint64_t medeleg;
|
||||
uint64_t mideleg;
|
||||
uint64_t ie;
|
||||
uint64_t mtvec;
|
||||
uint64_t mscratch;
|
||||
uint64_t mepc;
|
||||
uint64_t mcause;
|
||||
uint64_t mtval;
|
||||
uint64_t mcounteren;
|
||||
uint64_t ip;
|
||||
uint64_t mcycle;
|
||||
uint64_t minstret;
|
||||
|
||||
uint64_t stvec;
|
||||
uint64_t sscratch;
|
||||
uint64_t sepc;
|
||||
uint64_t scause;
|
||||
uint64_t stval;
|
||||
uint64_t satp;
|
||||
|
||||
uint64_t scounteren;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,184 @@
|
||||
#ifndef RV_SYSTEMBUS
|
||||
#define RV_SYSTEMBUS
|
||||
|
||||
#include "rv_common.hpp"
|
||||
#include <cstdint>
|
||||
#include <assert.h>
|
||||
#include <algorithm>
|
||||
#include "mmio_dev.hpp"
|
||||
#include <map>
|
||||
#include <utility>
|
||||
#include <climits>
|
||||
|
||||
extern long long current_pc;
|
||||
|
||||
// TODO: add pma and check pma
|
||||
class rv_systembus
|
||||
{
|
||||
public:
|
||||
bool pa_read(uint64_t start_addr, uint64_t size, uint8_t *buffer)
|
||||
{
|
||||
// if (start_addr < 0x80000000)
|
||||
// {
|
||||
// printf("pc = 0x%016lx\n", current_pc);
|
||||
// printf("mmio read %lx size %lu data ", start_addr, size);
|
||||
// for (uint64_t i = 0; i < size; i++)
|
||||
// {
|
||||
// printf("%02x", buffer[i]);
|
||||
// }
|
||||
// printf("\n");
|
||||
// }
|
||||
auto it = devices.upper_bound(std::make_pair(start_addr, ULONG_MAX));
|
||||
if (it == devices.begin())
|
||||
return false;
|
||||
it = std::prev(it);
|
||||
uint64_t end_addr = start_addr + size;
|
||||
if (it->first.first <= start_addr && end_addr <= it->first.second)
|
||||
{
|
||||
uint64_t dev_size = it->first.second - it->first.first;
|
||||
return it->second.first->do_read(it->second.second ? start_addr : start_addr % dev_size, size, buffer);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
bool pa_write(uint64_t start_addr, uint64_t size, const uint8_t *buffer)
|
||||
{
|
||||
// if (start_addr < 0x80000000)
|
||||
// {
|
||||
// printf("pc = 0x%016lx\n", current_pc);
|
||||
// printf("mmio write %lx size %lu data ", start_addr, size);
|
||||
// for (uint64_t i = 0; i < size; i++)
|
||||
// {
|
||||
// printf("%02x", buffer[i]);
|
||||
// }
|
||||
// printf("\n");
|
||||
// }
|
||||
if (start_addr <= lr_pa && lr_pa + size <= start_addr + size)
|
||||
{
|
||||
lr_valid = false;
|
||||
}
|
||||
auto it = devices.upper_bound(std::make_pair(start_addr, ULONG_MAX));
|
||||
if (it == devices.begin())
|
||||
return false;
|
||||
it = std::prev(it);
|
||||
uint64_t end_addr = start_addr + size;
|
||||
if (it->first.first <= start_addr && end_addr <= it->first.second)
|
||||
{
|
||||
uint64_t dev_size = it->first.second - it->first.first;
|
||||
return it->second.first->do_write(it->second.second ? start_addr : start_addr % dev_size, size, buffer);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
// note: check address alignment in the core and raise address misalign exception
|
||||
bool pa_lr(uint64_t pa, uint64_t size, uint8_t *dst, uint64_t hart_id)
|
||||
{
|
||||
lr_pa = pa;
|
||||
lr_size = size;
|
||||
lr_valid = true;
|
||||
lr_hart = hart_id;
|
||||
return pa_read(pa, size, dst);
|
||||
}
|
||||
// Note: if pa_write return false, sc_fail shouldn't commit.
|
||||
bool pa_sc(uint64_t pa, uint64_t size, const uint8_t *src, uint64_t hart_id, bool &sc_fail)
|
||||
{
|
||||
if (!lr_valid || lr_pa != pa || lr_size != size || lr_hart != hart_id)
|
||||
{
|
||||
sc_fail = true;
|
||||
if (hart_id == lr_hart)
|
||||
lr_valid = false;
|
||||
return true;
|
||||
}
|
||||
sc_fail = false;
|
||||
lr_valid = false;
|
||||
return pa_write(pa, size, src);
|
||||
}
|
||||
// note: core should check whether amoop is valid
|
||||
bool pa_amo_op(uint64_t pa, uint64_t size, amo_funct op, int64_t src, int64_t &dst)
|
||||
{
|
||||
int64_t res;
|
||||
bool read_ok = true;
|
||||
if (size == 4)
|
||||
{
|
||||
int32_t res32;
|
||||
read_ok &= pa_read(pa, size, (uint8_t *)&res32);
|
||||
res = res32;
|
||||
}
|
||||
else
|
||||
{
|
||||
read_ok &= pa_read(pa, size, (uint8_t *)&res);
|
||||
}
|
||||
if (!read_ok)
|
||||
return false;
|
||||
int64_t to_write;
|
||||
switch (op)
|
||||
{
|
||||
case AMOSWAP:
|
||||
to_write = src;
|
||||
break;
|
||||
case AMOADD:
|
||||
to_write = src + res;
|
||||
break;
|
||||
case AMOAND:
|
||||
to_write = src & res;
|
||||
break;
|
||||
case AMOOR:
|
||||
to_write = src | res;
|
||||
break;
|
||||
case AMOXOR:
|
||||
to_write = src ^ res;
|
||||
break;
|
||||
case AMOMAX:
|
||||
to_write = std::max(src, res);
|
||||
break;
|
||||
case AMOMIN:
|
||||
to_write = std::min(src, res);
|
||||
break;
|
||||
case AMOMAXU:
|
||||
to_write = std::max((uint64_t)src, (uint64_t)res);
|
||||
break;
|
||||
case AMOMINU:
|
||||
to_write = std::min((uint64_t)src, (uint64_t)res);
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
}
|
||||
dst = res;
|
||||
return pa_write(pa, size, (uint8_t *)&to_write);
|
||||
}
|
||||
bool add_dev(uint64_t start_addr, uint64_t length, mmio_dev *dev, bool raw_addr = false)
|
||||
{
|
||||
std::pair<uint64_t, uint64_t> addr_range = std::make_pair(start_addr, start_addr + length);
|
||||
if (start_addr % length)
|
||||
return false;
|
||||
// check range
|
||||
auto it = devices.upper_bound(addr_range);
|
||||
if (it != devices.end())
|
||||
{
|
||||
uint64_t l_max = std::max(it->first.first, addr_range.first);
|
||||
uint64_t r_min = std::min(it->first.second, addr_range.second);
|
||||
if (l_max < r_min)
|
||||
return false; // overleap
|
||||
}
|
||||
if (it != devices.begin())
|
||||
{
|
||||
it = std::prev(it);
|
||||
uint64_t l_max = std::max(it->first.first, addr_range.first);
|
||||
uint64_t r_min = std::min(it->first.second, addr_range.second);
|
||||
if (l_max < r_min)
|
||||
return false; // overleap
|
||||
}
|
||||
// overleap check pass
|
||||
devices[addr_range] = std::make_pair(dev, raw_addr);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
uint64_t lr_pa;
|
||||
uint64_t lr_size;
|
||||
uint64_t lr_hart;
|
||||
bool lr_valid = false;
|
||||
std::map<std::pair<uint64_t, uint64_t>, std::pair<mmio_dev *, bool>> devices;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,466 @@
|
||||
#include "verilated.h"
|
||||
// #include "verilated_fst_c.h"
|
||||
#include "verilated_fst_c.h"
|
||||
#include "Vtop.h"
|
||||
#include "rv_systembus.hpp"
|
||||
#include "rv_core.hpp"
|
||||
#include "rv_clint.hpp"
|
||||
#include "rv_plic.hpp"
|
||||
#include <stdio.h>
|
||||
|
||||
bool running = true;
|
||||
bool run_riscv_test = false;
|
||||
bool dump_pc_history = false;
|
||||
bool print_pc = false;
|
||||
bool should_delay = false;
|
||||
bool dual_issue = false;
|
||||
bool perf_counter = false;
|
||||
bool init_gprs = false;
|
||||
bool write_append = false;
|
||||
bool has_delayslot = false;
|
||||
bool only_modeM = false;
|
||||
const uint64_t commit_timeout = 3000;
|
||||
const uint64_t print_pc_cycle = 5e5;
|
||||
long trace_start_time = 0; // -starttrace [time]
|
||||
std::atomic_bool trace_on = false;
|
||||
long sim_time = 1e8;
|
||||
|
||||
long long total_cycle = 0;
|
||||
long long total_instr = 0;
|
||||
|
||||
VerilatedFstC fst;
|
||||
|
||||
void open_trace()
|
||||
{
|
||||
fst.open("trace.fst");
|
||||
trace_on.store(true, std::memory_order_seq_cst);
|
||||
}
|
||||
|
||||
#undef assert
|
||||
void assert(bool expr, const char *msg = "")
|
||||
{
|
||||
if (!expr)
|
||||
{
|
||||
running = false;
|
||||
printf("%s\n", msg);
|
||||
printf("soc_simulator assert failed!\n");
|
||||
}
|
||||
}
|
||||
|
||||
#include "nscscc_sram.hpp"
|
||||
#include "nscscc_sram_slave.hpp"
|
||||
#include "nscscc_sram_xbar.hpp"
|
||||
#include "mmio_mem.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
#include <thread>
|
||||
#include <csignal>
|
||||
#include <sstream>
|
||||
|
||||
void connect_wire(nscscc_sram_ptr &sram_ptr, Vtop *top)
|
||||
{
|
||||
sram_ptr.inst_sram_en = &(top->inst_sram_en);
|
||||
sram_ptr.inst_sram_addr = &(top->inst_sram_addr);
|
||||
sram_ptr.inst_sram_wen = &(top->inst_sram_wen);
|
||||
sram_ptr.inst_sram_rdata = &(top->inst_sram_rdata);
|
||||
sram_ptr.inst_sram_wdata = &(top->inst_sram_wdata);
|
||||
sram_ptr.data_sram_en = &(top->data_sram_en);
|
||||
sram_ptr.data_sram_addr = &(top->data_sram_addr);
|
||||
sram_ptr.data_sram_wen = &(top->data_sram_wen);
|
||||
sram_ptr.data_sram_rdata = &(top->data_sram_rdata);
|
||||
sram_ptr.data_sram_wdata = &(top->data_sram_wdata);
|
||||
}
|
||||
|
||||
void riscv_test_run(Vtop *top, nscscc_sram_ref &mmio_ref, const char *riscv_test_path)
|
||||
{
|
||||
|
||||
// setup cemu {
|
||||
rv_systembus cemu_system_bus;
|
||||
mmio_mem cemu_mem(128 * 1024 * 1024, riscv_test_path);
|
||||
|
||||
assert(cemu_system_bus.add_dev(0x80000000, 0x80000000, &cemu_mem));
|
||||
|
||||
rv_core cemu_rvcore(cemu_system_bus);
|
||||
cemu_rvcore.jump(0x80000000);
|
||||
if (init_gprs)
|
||||
{
|
||||
for (int i = 0; i < 32; i++)
|
||||
{
|
||||
cemu_rvcore.set_GPR(i, i);
|
||||
}
|
||||
}
|
||||
// cemu_rvcore.set_difftest_mode(true);
|
||||
// setup cemu }
|
||||
|
||||
// setup rtl {
|
||||
nscscc_sram mmio_sigs;
|
||||
nscscc_sram_ref mmio_sigs_ref(mmio_sigs);
|
||||
nscscc_sram_xbar mmio;
|
||||
|
||||
mmio_mem rtl_mem(128 * 1024 * 1024, riscv_test_path);
|
||||
assert(mmio.add_dev(0x80000000, 0x80000000, &rtl_mem));
|
||||
// setup rtl }
|
||||
|
||||
// connect Vcd for trace
|
||||
if (trace_on)
|
||||
{
|
||||
top->trace(&fst, 0);
|
||||
fst.open("trace.fst");
|
||||
}
|
||||
uint64_t rst_ticks = 10;
|
||||
uint64_t ticks = 0;
|
||||
uint64_t last_commit = ticks;
|
||||
uint64_t pc_cnt = print_pc_cycle;
|
||||
int delayslot_cnt = 0;
|
||||
bool delayslot_flag = true;
|
||||
int delay = 1500;
|
||||
while (!Verilated::gotFinish() && sim_time > 0 && running)
|
||||
{
|
||||
if (rst_ticks > 0)
|
||||
{
|
||||
top->reset = 1;
|
||||
rst_ticks--;
|
||||
}
|
||||
else
|
||||
top->reset = 0;
|
||||
top->clock = !top->clock;
|
||||
if (top->clock && !top->reset)
|
||||
mmio_sigs.update_input(mmio_ref);
|
||||
top->eval();
|
||||
if (top->clock && !top->reset)
|
||||
{
|
||||
mmio.beat(mmio_sigs_ref);
|
||||
mmio_sigs.update_output(mmio_ref);
|
||||
top->eval();
|
||||
}
|
||||
//===性能计数器=====
|
||||
if (!top->reset && top->clock)
|
||||
total_cycle++;
|
||||
if (((top->clock && !dual_issue) || dual_issue) && top->debug_commit)
|
||||
total_instr++;
|
||||
//==================
|
||||
if (((top->clock && !dual_issue) || dual_issue) && top->debug_commit)
|
||||
{ // instr retire
|
||||
// cemu_rvcore.import_diff_test_info(top->debug_csr_mcycle, top->debug_csr_minstret, top->debug_csr_mip, top->debug_csr_interrupt);
|
||||
if (has_delayslot)
|
||||
{
|
||||
if (!delayslot_cnt)
|
||||
{
|
||||
cemu_rvcore.step(0, 0, 0, 0);
|
||||
delayslot_flag = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cemu_rvcore.step(0, 0, 0, 0);
|
||||
}
|
||||
last_commit = ticks;
|
||||
if (pc_cnt++ >= print_pc_cycle && print_pc)
|
||||
{
|
||||
printf("PC = 0x%016lx\n", cemu_rvcore.debug_pc);
|
||||
pc_cnt = 0;
|
||||
}
|
||||
if ((top->debug_pc != cemu_rvcore.debug_pc ||
|
||||
cemu_rvcore.debug_reg_num != 0 &&
|
||||
(top->debug_rf_wnum != cemu_rvcore.debug_reg_num ||
|
||||
top->debug_rf_wdata != cemu_rvcore.debug_reg_wdata)) &&
|
||||
!delayslot_cnt)
|
||||
{
|
||||
printf("\033[1;31mError!\033[0m\n");
|
||||
printf("reference: PC = 0x%016lx, wb_rf_wnum = 0x%02lx, wb_rf_wdata = 0x%016lx\n", cemu_rvcore.debug_pc, cemu_rvcore.debug_reg_num, cemu_rvcore.debug_reg_wdata);
|
||||
printf("mycpu : PC = 0x%016lx, wb_rf_wnum = 0x%02x, wb_rf_wdata = 0x%016lx\n", top->debug_pc, top->debug_rf_wnum, top->debug_rf_wdata);
|
||||
if (!should_delay)
|
||||
{
|
||||
running = false;
|
||||
if (dump_pc_history)
|
||||
cemu_rvcore.dump_pc_history();
|
||||
}
|
||||
else if (dump_pc_history && delay-- == 10)
|
||||
cemu_rvcore.dump_pc_history();
|
||||
else if (delay-- == 0)
|
||||
running = false;
|
||||
}
|
||||
// ==========================
|
||||
if (has_delayslot)
|
||||
{
|
||||
if (delayslot_cnt > 0)
|
||||
delayslot_cnt--;
|
||||
if (cemu_rvcore.debug_is_branch && delayslot_flag)
|
||||
{
|
||||
delayslot_cnt = 2;
|
||||
delayslot_flag = false;
|
||||
}
|
||||
}
|
||||
// ==========================
|
||||
}
|
||||
if (trace_on)
|
||||
{
|
||||
fst.dump(ticks);
|
||||
sim_time--;
|
||||
}
|
||||
ticks++;
|
||||
if (ticks - last_commit >= commit_timeout)
|
||||
{
|
||||
printf("\033[1;31mError!\033[0m\n");
|
||||
printf("CPU stuck for %ld cycles!\n", commit_timeout / 2);
|
||||
running = false;
|
||||
if (dump_pc_history)
|
||||
cemu_rvcore.dump_pc_history();
|
||||
}
|
||||
}
|
||||
|
||||
printf("total_ticks: %lu\n", ticks);
|
||||
}
|
||||
|
||||
void make_cpu_trace(Vtop *top, nscscc_sram_ref &mmio_ref, const char *riscv_test_path)
|
||||
{
|
||||
|
||||
// setup cemu {
|
||||
rv_systembus cemu_system_bus;
|
||||
mmio_mem cemu_mem(128 * 1024 * 1024, riscv_test_path);
|
||||
|
||||
assert(cemu_system_bus.add_dev(0x80000000, 0x80000000, &cemu_mem));
|
||||
|
||||
rv_core cemu_rvcore(cemu_system_bus);
|
||||
cemu_rvcore.jump(0x80000000);
|
||||
if (init_gprs)
|
||||
{
|
||||
for (int i = 0; i < 32; i++)
|
||||
{
|
||||
cemu_rvcore.set_GPR(i, i);
|
||||
}
|
||||
}
|
||||
// setup cemu }
|
||||
|
||||
// setup rtl {
|
||||
nscscc_sram mmio_sigs;
|
||||
nscscc_sram_ref mmio_sigs_ref(mmio_sigs);
|
||||
nscscc_sram_xbar mmio;
|
||||
|
||||
mmio_mem rtl_mem(128 * 1024 * 1024, riscv_test_path);
|
||||
|
||||
assert(mmio.add_dev(0x80000000, 0x80000000, &rtl_mem));
|
||||
// setup rtl }
|
||||
|
||||
// connect Vcd for trace
|
||||
if (trace_on)
|
||||
{
|
||||
top->trace(&fst, 0);
|
||||
fst.open("trace.fst");
|
||||
}
|
||||
|
||||
FILE *trace_file;
|
||||
if (write_append)
|
||||
{
|
||||
trace_file = fopen("trace.txt", "a");
|
||||
}
|
||||
else
|
||||
{
|
||||
trace_file = fopen("trace.txt", "w");
|
||||
}
|
||||
if (trace_file == NULL)
|
||||
{
|
||||
printf("Error opening file!\n");
|
||||
}
|
||||
|
||||
uint64_t rst_ticks = 10;
|
||||
uint64_t ticks = 0;
|
||||
uint64_t last_commit = ticks;
|
||||
int delay = 10;
|
||||
int delayslot_cnt = 0;
|
||||
bool delayslot_flag = true;
|
||||
while (!Verilated::gotFinish() && sim_time > 0 && running)
|
||||
{
|
||||
if (rst_ticks > 0)
|
||||
{
|
||||
top->reset = 1;
|
||||
rst_ticks--;
|
||||
}
|
||||
else
|
||||
top->reset = 0;
|
||||
top->clock = !top->clock;
|
||||
if (top->clock && !top->reset)
|
||||
mmio_sigs.update_input(mmio_ref);
|
||||
top->eval();
|
||||
if (top->clock && !top->reset)
|
||||
{
|
||||
mmio.beat(mmio_sigs_ref);
|
||||
mmio_sigs.update_output(mmio_ref);
|
||||
top->eval();
|
||||
}
|
||||
if (((top->clock && !dual_issue) || dual_issue) && top->debug_commit)
|
||||
{ // instr retire
|
||||
if (has_delayslot)
|
||||
{
|
||||
if (!delayslot_cnt)
|
||||
{
|
||||
cemu_rvcore.step(0, 0, 0, 0);
|
||||
delayslot_flag = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cemu_rvcore.step(0, 0, 0, 0);
|
||||
}
|
||||
last_commit = ticks;
|
||||
if ((top->debug_pc != cemu_rvcore.debug_pc ||
|
||||
cemu_rvcore.debug_reg_num != 0 &&
|
||||
(top->debug_rf_wnum != cemu_rvcore.debug_reg_num ||
|
||||
top->debug_rf_wdata != cemu_rvcore.debug_reg_wdata)) &&
|
||||
!delayslot_cnt)
|
||||
{
|
||||
printf("\033[1;31mError!\033[0m\n");
|
||||
printf("reference: PC = 0x%016lx, wb_rf_wnum = 0x%02lx, wb_rf_wdata = 0x%016lx\n", cemu_rvcore.debug_pc, cemu_rvcore.debug_reg_num, cemu_rvcore.debug_reg_wdata);
|
||||
printf("mycpu : PC = 0x%016lx, wb_rf_wnum = 0x%02x, wb_rf_wdata = 0x%016lx\n", top->debug_pc, top->debug_rf_wnum, top->debug_rf_wdata);
|
||||
if (!should_delay)
|
||||
{
|
||||
running = false;
|
||||
if (dump_pc_history)
|
||||
cemu_rvcore.dump_pc_history();
|
||||
}
|
||||
else if (dump_pc_history && delay-- == 10)
|
||||
cemu_rvcore.dump_pc_history();
|
||||
else if (delay-- == 0)
|
||||
running = false;
|
||||
}
|
||||
// ==========================
|
||||
if (has_delayslot)
|
||||
{
|
||||
if (delayslot_cnt > 0)
|
||||
delayslot_cnt--;
|
||||
if (cemu_rvcore.debug_is_branch && delayslot_flag)
|
||||
{
|
||||
delayslot_cnt = 2;
|
||||
delayslot_flag = false;
|
||||
}
|
||||
}
|
||||
// ==========================
|
||||
fprintf(trace_file, "1 %016lx %02lx %016lx\n", cemu_rvcore.debug_pc, cemu_rvcore.debug_reg_num, cemu_rvcore.debug_reg_wdata);
|
||||
}
|
||||
if (trace_on)
|
||||
{
|
||||
fst.dump(ticks);
|
||||
sim_time--;
|
||||
}
|
||||
ticks++;
|
||||
if (ticks - last_commit >= commit_timeout)
|
||||
{
|
||||
printf("\033[1;31mError!\033[0m\n");
|
||||
printf("CPU stuck for %ld cycles!\n", commit_timeout / 2);
|
||||
running = false;
|
||||
if (dump_pc_history)
|
||||
cemu_rvcore.dump_pc_history();
|
||||
}
|
||||
}
|
||||
printf("total_ticks: %lu\n", ticks);
|
||||
fclose(trace_file);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv, char **env)
|
||||
{
|
||||
Verilated::commandArgs(argc, argv);
|
||||
|
||||
std::signal(SIGINT, [](int)
|
||||
{ running = false; });
|
||||
|
||||
char *file_load_path;
|
||||
enum
|
||||
{
|
||||
NOP,
|
||||
RISCV_TEST,
|
||||
CPU_TRACE,
|
||||
} run_mode = RISCV_TEST;
|
||||
|
||||
for (int i = 1; i < argc; i++)
|
||||
{
|
||||
if (strcmp(argv[i], "-trace") == 0)
|
||||
{
|
||||
trace_on = true;
|
||||
if (i + 1 < argc)
|
||||
{
|
||||
sscanf(argv[++i], "%lu", &sim_time);
|
||||
}
|
||||
}
|
||||
else if (strcmp(argv[i], "-starttrace") == 0)
|
||||
{
|
||||
if (i + 1 < argc)
|
||||
{
|
||||
sscanf(argv[++i], "%lu", &trace_start_time);
|
||||
}
|
||||
printf("trace start time: %lu\n", trace_start_time);
|
||||
}
|
||||
else if (strcmp(argv[i], "-rvtest") == 0)
|
||||
{
|
||||
run_riscv_test = true;
|
||||
run_mode = RISCV_TEST;
|
||||
}
|
||||
else if (strcmp(argv[i], "-perf") == 0)
|
||||
{
|
||||
perf_counter = true;
|
||||
}
|
||||
else if (strcmp(argv[i], "-pc") == 0) // 打印历史PC
|
||||
{
|
||||
dump_pc_history = true;
|
||||
}
|
||||
else if (strcmp(argv[i], "-printpc") == 0) // 间隔一定时间输出一次PC
|
||||
{
|
||||
print_pc = true;
|
||||
}
|
||||
else if (strcmp(argv[i], "-delay") == 0) // 出错后延迟一段时间再停止
|
||||
{
|
||||
should_delay = true;
|
||||
}
|
||||
else if (strcmp(argv[i], "-cpu_trace") == 0) // 生成cpu trace
|
||||
{
|
||||
run_mode = CPU_TRACE;
|
||||
}
|
||||
else if (strcmp(argv[i], "-initgprs") == 0) // 初始化寄存器
|
||||
{
|
||||
init_gprs = true;
|
||||
}
|
||||
else if (strcmp(argv[i], "-writeappend") == 0) // 追加写入
|
||||
{
|
||||
write_append = true;
|
||||
}
|
||||
else if (strcmp(argv[i], "-hasdelayslot") == 0) // 是否有延迟槽
|
||||
{
|
||||
has_delayslot = true;
|
||||
}
|
||||
else if (strcmp(argv[i], "-onlymodem") == 0) // 只有modeM
|
||||
{
|
||||
only_modeM = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
file_load_path = argv[i];
|
||||
}
|
||||
}
|
||||
|
||||
Verilated::traceEverOn(true);
|
||||
|
||||
// setup soc
|
||||
Vtop *top = new Vtop;
|
||||
nscscc_sram_ptr mmio_ptr;
|
||||
|
||||
connect_wire(mmio_ptr, top);
|
||||
assert(mmio_ptr.check());
|
||||
|
||||
nscscc_sram_ref mmio_ref(mmio_ptr);
|
||||
|
||||
switch (run_mode)
|
||||
{
|
||||
case RISCV_TEST:
|
||||
riscv_test_run(top, mmio_ref, file_load_path);
|
||||
break;
|
||||
case CPU_TRACE:
|
||||
make_cpu_trace(top, mmio_ref, file_load_path);
|
||||
break;
|
||||
default:
|
||||
printf("Unknown running mode.\n");
|
||||
exit(-ENOENT);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
|
||||
elf/am-tests/add: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 0fc000ef jal x1,80000108 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 0d8000ef jal x1,800000fc <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fb010113 addi x2,x2,-80
|
||||
8000002c: 01713423 sd x23,8(x2)
|
||||
80000030: 00000b97 auipc x23,0x0
|
||||
80000034: 200b8b93 addi x23,x23,512 # 80000230 <test_data>
|
||||
80000038: 03313423 sd x19,40(x2)
|
||||
8000003c: 03413023 sd x20,32(x2)
|
||||
80000040: 01513c23 sd x21,24(x2)
|
||||
80000044: 01613823 sd x22,16(x2)
|
||||
80000048: 01813023 sd x24,0(x2)
|
||||
8000004c: 04113423 sd x1,72(x2)
|
||||
80000050: 04813023 sd x8,64(x2)
|
||||
80000054: 02913c23 sd x9,56(x2)
|
||||
80000058: 03213823 sd x18,48(x2)
|
||||
8000005c: 00000b17 auipc x22,0x0
|
||||
80000060: 0d4b0b13 addi x22,x22,212 # 80000130 <ans>
|
||||
80000064: 000b8a93 addi x21,x23,0
|
||||
80000068: 00000a13 addi x20,x0,0
|
||||
8000006c: 00000997 auipc x19,0x0
|
||||
80000070: 1e498993 addi x19,x19,484 # 80000250 <_bss_start>
|
||||
80000074: 04000c13 addi x24,x0,64
|
||||
80000078: 000aa903 lw x18,0(x21)
|
||||
8000007c: 000b0493 addi x9,x22,0
|
||||
80000080: 000b8413 addi x8,x23,0
|
||||
80000084: 00042503 lw x10,0(x8)
|
||||
80000088: 0004a783 lw x15,0(x9)
|
||||
8000008c: 00440413 addi x8,x8,4
|
||||
80000090: 0125053b addw x10,x10,x18
|
||||
80000094: 40f50533 sub x10,x10,x15
|
||||
80000098: 00153513 sltiu x10,x10,1
|
||||
8000009c: f75ff0ef jal x1,80000010 <check>
|
||||
800000a0: 00448493 addi x9,x9,4
|
||||
800000a4: fe8990e3 bne x19,x8,80000084 <main+0x5c>
|
||||
800000a8: 00100513 addi x10,x0,1
|
||||
800000ac: 008a0a1b addiw x20,x20,8
|
||||
800000b0: f61ff0ef jal x1,80000010 <check>
|
||||
800000b4: 004a8a93 addi x21,x21,4
|
||||
800000b8: 020b0b13 addi x22,x22,32
|
||||
800000bc: fb8a1ee3 bne x20,x24,80000078 <main+0x50>
|
||||
800000c0: 00100513 addi x10,x0,1
|
||||
800000c4: f4dff0ef jal x1,80000010 <check>
|
||||
800000c8: 04813083 ld x1,72(x2)
|
||||
800000cc: 04013403 ld x8,64(x2)
|
||||
800000d0: 03813483 ld x9,56(x2)
|
||||
800000d4: 03013903 ld x18,48(x2)
|
||||
800000d8: 02813983 ld x19,40(x2)
|
||||
800000dc: 02013a03 ld x20,32(x2)
|
||||
800000e0: 01813a83 ld x21,24(x2)
|
||||
800000e4: 01013b03 ld x22,16(x2)
|
||||
800000e8: 00813b83 ld x23,8(x2)
|
||||
800000ec: 00013c03 ld x24,0(x2)
|
||||
800000f0: 00000513 addi x10,x0,0
|
||||
800000f4: 05010113 addi x2,x2,80
|
||||
800000f8: 00008067 jalr x0,0(x1)
|
||||
|
||||
00000000800000fc <halt>:
|
||||
800000fc: 00050513 addi x10,x10,0
|
||||
80000100: 00100073 ebreak
|
||||
80000104: 0000006f jal x0,80000104 <halt+0x8>
|
||||
|
||||
0000000080000108 <_trm_init>:
|
||||
80000108: ff010113 addi x2,x2,-16
|
||||
8000010c: 00000517 auipc x10,0x0
|
||||
80000110: 01c50513 addi x10,x10,28 # 80000128 <_etext>
|
||||
80000114: 00113423 sd x1,8(x2)
|
||||
80000118: f11ff0ef jal x1,80000028 <main>
|
||||
8000011c: 00050513 addi x10,x10,0
|
||||
80000120: 00100073 ebreak
|
||||
80000124: 0000006f jal x0,80000124 <_trm_init+0x1c>
|
||||
@ -0,0 +1,85 @@
|
||||
|
||||
elf/am-tests/add-longlong: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 0ec000ef jal x1,800000f8 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 0c8000ef jal x1,800000ec <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fb010113 addi x2,x2,-80
|
||||
8000002c: 01713423 sd x23,8(x2)
|
||||
80000030: 00000b97 auipc x23,0x0
|
||||
80000034: 2f0b8b93 addi x23,x23,752 # 80000320 <test_data>
|
||||
80000038: 03313423 sd x19,40(x2)
|
||||
8000003c: 03413023 sd x20,32(x2)
|
||||
80000040: 01513c23 sd x21,24(x2)
|
||||
80000044: 01613823 sd x22,16(x2)
|
||||
80000048: 01813023 sd x24,0(x2)
|
||||
8000004c: 04113423 sd x1,72(x2)
|
||||
80000050: 04813023 sd x8,64(x2)
|
||||
80000054: 02913c23 sd x9,56(x2)
|
||||
80000058: 03213823 sd x18,48(x2)
|
||||
8000005c: 00000b17 auipc x22,0x0
|
||||
80000060: 0c4b0b13 addi x22,x22,196 # 80000120 <ans>
|
||||
80000064: 000b8a93 addi x21,x23,0
|
||||
80000068: 00000a13 addi x20,x0,0
|
||||
8000006c: 00000997 auipc x19,0x0
|
||||
80000070: 2f498993 addi x19,x19,756 # 80000360 <_bss_start>
|
||||
80000074: 04000c13 addi x24,x0,64
|
||||
80000078: 000ab903 ld x18,0(x21)
|
||||
8000007c: 000b0493 addi x9,x22,0
|
||||
80000080: 000b8413 addi x8,x23,0
|
||||
80000084: 00043503 ld x10,0(x8)
|
||||
80000088: 0004b783 ld x15,0(x9)
|
||||
8000008c: 00840413 addi x8,x8,8
|
||||
80000090: 00a90533 add x10,x18,x10
|
||||
80000094: 40f50533 sub x10,x10,x15
|
||||
80000098: 00153513 sltiu x10,x10,1
|
||||
8000009c: f75ff0ef jal x1,80000010 <check>
|
||||
800000a0: 00848493 addi x9,x9,8
|
||||
800000a4: fe8990e3 bne x19,x8,80000084 <main+0x5c>
|
||||
800000a8: 008a0a1b addiw x20,x20,8
|
||||
800000ac: 008a8a93 addi x21,x21,8
|
||||
800000b0: 040b0b13 addi x22,x22,64
|
||||
800000b4: fd8a12e3 bne x20,x24,80000078 <main+0x50>
|
||||
800000b8: 04813083 ld x1,72(x2)
|
||||
800000bc: 04013403 ld x8,64(x2)
|
||||
800000c0: 03813483 ld x9,56(x2)
|
||||
800000c4: 03013903 ld x18,48(x2)
|
||||
800000c8: 02813983 ld x19,40(x2)
|
||||
800000cc: 02013a03 ld x20,32(x2)
|
||||
800000d0: 01813a83 ld x21,24(x2)
|
||||
800000d4: 01013b03 ld x22,16(x2)
|
||||
800000d8: 00813b83 ld x23,8(x2)
|
||||
800000dc: 00013c03 ld x24,0(x2)
|
||||
800000e0: 00000513 addi x10,x0,0
|
||||
800000e4: 05010113 addi x2,x2,80
|
||||
800000e8: 00008067 jalr x0,0(x1)
|
||||
|
||||
00000000800000ec <halt>:
|
||||
800000ec: 00050513 addi x10,x10,0
|
||||
800000f0: 00100073 ebreak
|
||||
800000f4: 0000006f jal x0,800000f4 <halt+0x8>
|
||||
|
||||
00000000800000f8 <_trm_init>:
|
||||
800000f8: ff010113 addi x2,x2,-16
|
||||
800000fc: 00000517 auipc x10,0x0
|
||||
80000100: 01c50513 addi x10,x10,28 # 80000118 <_etext>
|
||||
80000104: 00113423 sd x1,8(x2)
|
||||
80000108: f21ff0ef jal x1,80000028 <main>
|
||||
8000010c: 00050513 addi x10,x10,0
|
||||
80000110: 00100073 ebreak
|
||||
80000114: 0000006f jal x0,80000114 <_trm_init+0x1c>
|
||||
@ -0,0 +1,156 @@
|
||||
|
||||
elf/am-tests/bit: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 1f8000ef jal x1,80000204 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 1d4000ef jal x1,800001f8 <halt>
|
||||
|
||||
0000000080000028 <getbit>:
|
||||
80000028: 4035d793 srai x15,x11,0x3
|
||||
8000002c: 00f50533 add x10,x10,x15
|
||||
80000030: 00054503 lbu x10,0(x10)
|
||||
80000034: 0075f593 andi x11,x11,7
|
||||
80000038: 00100793 addi x15,x0,1
|
||||
8000003c: 00b797bb sllw x15,x15,x11
|
||||
80000040: 00f57533 and x10,x10,x15
|
||||
80000044: 00a03533 sltu x10,x0,x10
|
||||
80000048: 00008067 jalr x0,0(x1)
|
||||
|
||||
000000008000004c <setbit>:
|
||||
8000004c: 4035d793 srai x15,x11,0x3
|
||||
80000050: ff010113 addi x2,x2,-16
|
||||
80000054: 00f50533 add x10,x10,x15
|
||||
80000058: 00a13423 sd x10,8(x2)
|
||||
8000005c: 00813783 ld x15,8(x2)
|
||||
80000060: 0075f593 andi x11,x11,7
|
||||
80000064: 00100713 addi x14,x0,1
|
||||
80000068: 00b7173b sllw x14,x14,x11
|
||||
8000006c: 02061063 bne x12,x0,8000008c <setbit+0x40>
|
||||
80000070: 0007c783 lbu x15,0(x15)
|
||||
80000074: fff74713 xori x14,x14,-1
|
||||
80000078: 00e7f7b3 and x15,x15,x14
|
||||
8000007c: 00813703 ld x14,8(x2)
|
||||
80000080: 00f70023 sb x15,0(x14)
|
||||
80000084: 01010113 addi x2,x2,16
|
||||
80000088: 00008067 jalr x0,0(x1)
|
||||
8000008c: 0007c783 lbu x15,0(x15)
|
||||
80000090: 00e7e7b3 or x15,x15,x14
|
||||
80000094: 00813703 ld x14,8(x2)
|
||||
80000098: 0ff7f793 andi x15,x15,255
|
||||
8000009c: 00f70023 sb x15,0(x14)
|
||||
800000a0: 01010113 addi x2,x2,16
|
||||
800000a4: 00008067 jalr x0,0(x1)
|
||||
|
||||
00000000800000a8 <main>:
|
||||
800000a8: fe010113 addi x2,x2,-32
|
||||
800000ac: 0aa00793 addi x15,x0,170
|
||||
800000b0: 00000593 addi x11,x0,0
|
||||
800000b4: 00810513 addi x10,x2,8
|
||||
800000b8: 00113c23 sd x1,24(x2)
|
||||
800000bc: 00f11423 sh x15,8(x2)
|
||||
800000c0: f69ff0ef jal x1,80000028 <getbit>
|
||||
800000c4: 00154513 xori x10,x10,1
|
||||
800000c8: 0ff57513 andi x10,x10,255
|
||||
800000cc: f45ff0ef jal x1,80000010 <check>
|
||||
800000d0: 00100593 addi x11,x0,1
|
||||
800000d4: 00810513 addi x10,x2,8
|
||||
800000d8: f51ff0ef jal x1,80000028 <getbit>
|
||||
800000dc: f35ff0ef jal x1,80000010 <check>
|
||||
800000e0: 00200593 addi x11,x0,2
|
||||
800000e4: 00810513 addi x10,x2,8
|
||||
800000e8: f41ff0ef jal x1,80000028 <getbit>
|
||||
800000ec: 00154513 xori x10,x10,1
|
||||
800000f0: 0ff57513 andi x10,x10,255
|
||||
800000f4: f1dff0ef jal x1,80000010 <check>
|
||||
800000f8: 00300593 addi x11,x0,3
|
||||
800000fc: 00810513 addi x10,x2,8
|
||||
80000100: f29ff0ef jal x1,80000028 <getbit>
|
||||
80000104: f0dff0ef jal x1,80000010 <check>
|
||||
80000108: 00400593 addi x11,x0,4
|
||||
8000010c: 00810513 addi x10,x2,8
|
||||
80000110: f19ff0ef jal x1,80000028 <getbit>
|
||||
80000114: 00154513 xori x10,x10,1
|
||||
80000118: 0ff57513 andi x10,x10,255
|
||||
8000011c: ef5ff0ef jal x1,80000010 <check>
|
||||
80000120: 00500593 addi x11,x0,5
|
||||
80000124: 00810513 addi x10,x2,8
|
||||
80000128: f01ff0ef jal x1,80000028 <getbit>
|
||||
8000012c: ee5ff0ef jal x1,80000010 <check>
|
||||
80000130: 00600593 addi x11,x0,6
|
||||
80000134: 00810513 addi x10,x2,8
|
||||
80000138: ef1ff0ef jal x1,80000028 <getbit>
|
||||
8000013c: 00154513 xori x10,x10,1
|
||||
80000140: 0ff57513 andi x10,x10,255
|
||||
80000144: ecdff0ef jal x1,80000010 <check>
|
||||
80000148: 00700593 addi x11,x0,7
|
||||
8000014c: 00810513 addi x10,x2,8
|
||||
80000150: ed9ff0ef jal x1,80000028 <getbit>
|
||||
80000154: ebdff0ef jal x1,80000010 <check>
|
||||
80000158: 00810513 addi x10,x2,8
|
||||
8000015c: 00100613 addi x12,x0,1
|
||||
80000160: 00800593 addi x11,x0,8
|
||||
80000164: ee9ff0ef jal x1,8000004c <setbit>
|
||||
80000168: 00810513 addi x10,x2,8
|
||||
8000016c: 00000613 addi x12,x0,0
|
||||
80000170: 00900593 addi x11,x0,9
|
||||
80000174: ed9ff0ef jal x1,8000004c <setbit>
|
||||
80000178: 00810513 addi x10,x2,8
|
||||
8000017c: 00100613 addi x12,x0,1
|
||||
80000180: 00a00593 addi x11,x0,10
|
||||
80000184: ec9ff0ef jal x1,8000004c <setbit>
|
||||
80000188: 00810513 addi x10,x2,8
|
||||
8000018c: 00000613 addi x12,x0,0
|
||||
80000190: 00b00593 addi x11,x0,11
|
||||
80000194: eb9ff0ef jal x1,8000004c <setbit>
|
||||
80000198: 00810513 addi x10,x2,8
|
||||
8000019c: 00100613 addi x12,x0,1
|
||||
800001a0: 00c00593 addi x11,x0,12
|
||||
800001a4: ea9ff0ef jal x1,8000004c <setbit>
|
||||
800001a8: 00810513 addi x10,x2,8
|
||||
800001ac: 00000613 addi x12,x0,0
|
||||
800001b0: 00d00593 addi x11,x0,13
|
||||
800001b4: e99ff0ef jal x1,8000004c <setbit>
|
||||
800001b8: 00810513 addi x10,x2,8
|
||||
800001bc: 00100613 addi x12,x0,1
|
||||
800001c0: 00e00593 addi x11,x0,14
|
||||
800001c4: e89ff0ef jal x1,8000004c <setbit>
|
||||
800001c8: 00810513 addi x10,x2,8
|
||||
800001cc: 00000613 addi x12,x0,0
|
||||
800001d0: 00f00593 addi x11,x0,15
|
||||
800001d4: e79ff0ef jal x1,8000004c <setbit>
|
||||
800001d8: 00914503 lbu x10,9(x2)
|
||||
800001dc: fab50513 addi x10,x10,-85
|
||||
800001e0: 00153513 sltiu x10,x10,1
|
||||
800001e4: e2dff0ef jal x1,80000010 <check>
|
||||
800001e8: 01813083 ld x1,24(x2)
|
||||
800001ec: 00000513 addi x10,x0,0
|
||||
800001f0: 02010113 addi x2,x2,32
|
||||
800001f4: 00008067 jalr x0,0(x1)
|
||||
|
||||
00000000800001f8 <halt>:
|
||||
800001f8: 00050513 addi x10,x10,0
|
||||
800001fc: 00100073 ebreak
|
||||
80000200: 0000006f jal x0,80000200 <halt+0x8>
|
||||
|
||||
0000000080000204 <_trm_init>:
|
||||
80000204: ff010113 addi x2,x2,-16
|
||||
80000208: 00000517 auipc x10,0x0
|
||||
8000020c: 02050513 addi x10,x10,32 # 80000228 <mainargs>
|
||||
80000210: 00113423 sd x1,8(x2)
|
||||
80000214: e95ff0ef jal x1,800000a8 <main>
|
||||
80000218: 00050513 addi x10,x10,0
|
||||
8000021c: 00100073 ebreak
|
||||
80000220: 0000006f jal x0,80000220 <_trm_init+0x1c>
|
||||
@ -0,0 +1,99 @@
|
||||
|
||||
elf/am-tests/bubble-sort: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 11c000ef jal x1,80000128 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 0f8000ef jal x1,8000011c <halt>
|
||||
|
||||
0000000080000028 <bubble_sort>:
|
||||
80000028: 01300793 addi x15,x0,19
|
||||
8000002c: 00000517 auipc x10,0x0
|
||||
80000030: 12850513 addi x10,x10,296 # 80000154 <a+0x4>
|
||||
80000034: 04078063 beq x15,x0,80000074 <bubble_sort+0x4c>
|
||||
80000038: fff7859b addiw x11,x15,-1
|
||||
8000003c: 02059793 slli x15,x11,0x20
|
||||
80000040: 01e7d613 srli x12,x15,0x1e
|
||||
80000044: 00a60633 add x12,x12,x10
|
||||
80000048: 00000797 auipc x15,0x0
|
||||
8000004c: 10878793 addi x15,x15,264 # 80000150 <a>
|
||||
80000050: 0007a703 lw x14,0(x15)
|
||||
80000054: 0047a683 lw x13,4(x15)
|
||||
80000058: 00e6d663 bge x13,x14,80000064 <bubble_sort+0x3c>
|
||||
8000005c: 00d7a023 sw x13,0(x15)
|
||||
80000060: 00e7a223 sw x14,4(x15)
|
||||
80000064: 00478793 addi x15,x15,4
|
||||
80000068: fec794e3 bne x15,x12,80000050 <bubble_sort+0x28>
|
||||
8000006c: 0005879b addiw x15,x11,0
|
||||
80000070: fc0794e3 bne x15,x0,80000038 <bubble_sort+0x10>
|
||||
80000074: 00008067 jalr x0,0(x1)
|
||||
|
||||
0000000080000078 <main>:
|
||||
80000078: fd010113 addi x2,x2,-48
|
||||
8000007c: 00913c23 sd x9,24(x2)
|
||||
80000080: 00000497 auipc x9,0x0
|
||||
80000084: 0d048493 addi x9,x9,208 # 80000150 <a>
|
||||
80000088: 02813023 sd x8,32(x2)
|
||||
8000008c: 01213823 sd x18,16(x2)
|
||||
80000090: 01313423 sd x19,8(x2)
|
||||
80000094: 02113423 sd x1,40(x2)
|
||||
80000098: 00048913 addi x18,x9,0
|
||||
8000009c: f8dff0ef jal x1,80000028 <bubble_sort>
|
||||
800000a0: 00000413 addi x8,x0,0
|
||||
800000a4: 01400993 addi x19,x0,20
|
||||
800000a8: 00092503 lw x10,0(x18)
|
||||
800000ac: 00490913 addi x18,x18,4
|
||||
800000b0: 40850533 sub x10,x10,x8
|
||||
800000b4: 00153513 sltiu x10,x10,1
|
||||
800000b8: 0014041b addiw x8,x8,1
|
||||
800000bc: f55ff0ef jal x1,80000010 <check>
|
||||
800000c0: ff3414e3 bne x8,x19,800000a8 <main+0x30>
|
||||
800000c4: 00100513 addi x10,x0,1
|
||||
800000c8: f49ff0ef jal x1,80000010 <check>
|
||||
800000cc: 00000413 addi x8,x0,0
|
||||
800000d0: f59ff0ef jal x1,80000028 <bubble_sort>
|
||||
800000d4: 01400913 addi x18,x0,20
|
||||
800000d8: 0004a503 lw x10,0(x9)
|
||||
800000dc: 00448493 addi x9,x9,4
|
||||
800000e0: 40850533 sub x10,x10,x8
|
||||
800000e4: 00153513 sltiu x10,x10,1
|
||||
800000e8: 0014041b addiw x8,x8,1
|
||||
800000ec: f25ff0ef jal x1,80000010 <check>
|
||||
800000f0: ff2414e3 bne x8,x18,800000d8 <main+0x60>
|
||||
800000f4: 00100513 addi x10,x0,1
|
||||
800000f8: f19ff0ef jal x1,80000010 <check>
|
||||
800000fc: 02813083 ld x1,40(x2)
|
||||
80000100: 02013403 ld x8,32(x2)
|
||||
80000104: 01813483 ld x9,24(x2)
|
||||
80000108: 01013903 ld x18,16(x2)
|
||||
8000010c: 00813983 ld x19,8(x2)
|
||||
80000110: 00000513 addi x10,x0,0
|
||||
80000114: 03010113 addi x2,x2,48
|
||||
80000118: 00008067 jalr x0,0(x1)
|
||||
|
||||
000000008000011c <halt>:
|
||||
8000011c: 00050513 addi x10,x10,0
|
||||
80000120: 00100073 ebreak
|
||||
80000124: 0000006f jal x0,80000124 <halt+0x8>
|
||||
|
||||
0000000080000128 <_trm_init>:
|
||||
80000128: ff010113 addi x2,x2,-16
|
||||
8000012c: 00000517 auipc x10,0x0
|
||||
80000130: 01c50513 addi x10,x10,28 # 80000148 <_etext>
|
||||
80000134: 00113423 sd x1,8(x2)
|
||||
80000138: f41ff0ef jal x1,80000078 <main>
|
||||
8000013c: 00050513 addi x10,x10,0
|
||||
80000140: 00100073 ebreak
|
||||
80000144: 0000006f jal x0,80000144 <_trm_init+0x1c>
|
||||
@ -0,0 +1,90 @@
|
||||
|
||||
elf/am-tests/div: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 100000ef jal x1,8000010c <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 0dc000ef jal x1,80000100 <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fe010113 addi x2,x2,-32
|
||||
8000002c: 00913423 sd x9,8(x2)
|
||||
80000030: 00000497 auipc x9,0x0
|
||||
80000034: 10848493 addi x9,x9,264 # 80000138 <a>
|
||||
80000038: 00113c23 sd x1,24(x2)
|
||||
8000003c: 00813823 sd x8,16(x2)
|
||||
80000040: 01213023 sd x18,0(x2)
|
||||
80000044: 00048713 addi x14,x9,0
|
||||
80000048: 00000793 addi x15,x0,0
|
||||
8000004c: 00a00693 addi x13,x0,10
|
||||
80000050: 00f72023 sw x15,0(x14)
|
||||
80000054: 0017879b addiw x15,x15,1
|
||||
80000058: 00470713 addi x14,x14,4
|
||||
8000005c: fed79ae3 bne x15,x13,80000050 <main+0x28>
|
||||
80000060: 00000597 auipc x11,0x0
|
||||
80000064: 10058593 addi x11,x11,256 # 80000160 <a+0x28>
|
||||
80000068: 00000617 auipc x12,0x0
|
||||
8000006c: 0d060613 addi x12,x12,208 # 80000138 <a>
|
||||
80000070: 00b00693 addi x13,x0,11
|
||||
80000074: 00062703 lw x14,0(x12)
|
||||
80000078: 00100793 addi x15,x0,1
|
||||
8000007c: 02f7073b mulw x14,x14,x15
|
||||
80000080: 0017879b addiw x15,x15,1
|
||||
80000084: fed79ce3 bne x15,x13,8000007c <main+0x54>
|
||||
80000088: 00e62023 sw x14,0(x12)
|
||||
8000008c: 00460613 addi x12,x12,4
|
||||
80000090: feb612e3 bne x12,x11,80000074 <main+0x4c>
|
||||
80000094: 00000617 auipc x12,0x0
|
||||
80000098: 0a460613 addi x12,x12,164 # 80000138 <a>
|
||||
8000009c: 00b00693 addi x13,x0,11
|
||||
800000a0: 00062703 lw x14,0(x12)
|
||||
800000a4: 00100793 addi x15,x0,1
|
||||
800000a8: 02f7473b divw x14,x14,x15
|
||||
800000ac: 0017879b addiw x15,x15,1
|
||||
800000b0: fed79ce3 bne x15,x13,800000a8 <main+0x80>
|
||||
800000b4: 00e62023 sw x14,0(x12)
|
||||
800000b8: 00460613 addi x12,x12,4
|
||||
800000bc: feb612e3 bne x12,x11,800000a0 <main+0x78>
|
||||
800000c0: 00000413 addi x8,x0,0
|
||||
800000c4: 00a00913 addi x18,x0,10
|
||||
800000c8: 0004a503 lw x10,0(x9)
|
||||
800000cc: 00448493 addi x9,x9,4
|
||||
800000d0: 40850533 sub x10,x10,x8
|
||||
800000d4: 00153513 sltiu x10,x10,1
|
||||
800000d8: 0014041b addiw x8,x8,1
|
||||
800000dc: f35ff0ef jal x1,80000010 <check>
|
||||
800000e0: ff2414e3 bne x8,x18,800000c8 <main+0xa0>
|
||||
800000e4: 01813083 ld x1,24(x2)
|
||||
800000e8: 01013403 ld x8,16(x2)
|
||||
800000ec: 00813483 ld x9,8(x2)
|
||||
800000f0: 00013903 ld x18,0(x2)
|
||||
800000f4: 00000513 addi x10,x0,0
|
||||
800000f8: 02010113 addi x2,x2,32
|
||||
800000fc: 00008067 jalr x0,0(x1)
|
||||
|
||||
0000000080000100 <halt>:
|
||||
80000100: 00050513 addi x10,x10,0
|
||||
80000104: 00100073 ebreak
|
||||
80000108: 0000006f jal x0,80000108 <halt+0x8>
|
||||
|
||||
000000008000010c <_trm_init>:
|
||||
8000010c: ff010113 addi x2,x2,-16
|
||||
80000110: 00000517 auipc x10,0x0
|
||||
80000114: 02050513 addi x10,x10,32 # 80000130 <mainargs>
|
||||
80000118: 00113423 sd x1,8(x2)
|
||||
8000011c: f0dff0ef jal x1,80000028 <main>
|
||||
80000120: 00050513 addi x10,x10,0
|
||||
80000124: 00100073 ebreak
|
||||
80000128: 0000006f jal x0,80000128 <_trm_init+0x1c>
|
||||
@ -0,0 +1,25 @@
|
||||
|
||||
elf/am-tests/dummy: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 00c000ef jal x1,80000018 <_trm_init>
|
||||
|
||||
0000000080000010 <main>:
|
||||
80000010: 00000513 addi x10,x0,0
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
|
||||
0000000080000018 <_trm_init>:
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00000517 auipc x10,0x0
|
||||
80000020: 01c50513 addi x10,x10,28 # 80000038 <_etext>
|
||||
80000024: 00113423 sd x1,8(x2)
|
||||
80000028: fe9ff0ef jal x1,80000010 <main>
|
||||
8000002c: 00050513 addi x10,x10,0
|
||||
80000030: 00100073 ebreak
|
||||
80000034: 0000006f jal x0,80000034 <_trm_init+0x1c>
|
||||
@ -0,0 +1,85 @@
|
||||
|
||||
elf/am-tests/fact: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 0ec000ef jal x1,800000f8 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 0c8000ef jal x1,800000ec <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fd010113 addi x2,x2,-48
|
||||
8000002c: 01213823 sd x18,16(x2)
|
||||
80000030: 00000917 auipc x18,0x0
|
||||
80000034: 0f090913 addi x18,x18,240 # 80000120 <ans>
|
||||
80000038: 00092503 lw x10,0(x18)
|
||||
8000003c: 00100713 addi x14,x0,1
|
||||
80000040: 00913c23 sd x9,24(x2)
|
||||
80000044: 40e50533 sub x10,x10,x14
|
||||
80000048: 00000493 addi x9,x0,0
|
||||
8000004c: 01313423 sd x19,8(x2)
|
||||
80000050: 01413023 sd x20,0(x2)
|
||||
80000054: 00000997 auipc x19,0x0
|
||||
80000058: 10498993 addi x19,x19,260 # 80000158 <f>
|
||||
8000005c: 00d00a13 addi x20,x0,13
|
||||
80000060: 0014849b addiw x9,x9,1
|
||||
80000064: 00153513 sltiu x10,x10,1
|
||||
80000068: 02813023 sd x8,32(x2)
|
||||
8000006c: 02113423 sd x1,40(x2)
|
||||
80000070: 00100413 addi x8,x0,1
|
||||
80000074: 00e9a023 sw x14,0(x19)
|
||||
80000078: f99ff0ef jal x1,80000010 <check>
|
||||
8000007c: 05448263 beq x9,x20,800000c0 <main+0x98>
|
||||
80000080: 06848263 beq x9,x8,800000e4 <main+0xbc>
|
||||
80000084: 00048793 addi x15,x9,0
|
||||
80000088: 00100713 addi x14,x0,1
|
||||
8000008c: 00078693 addi x13,x15,0
|
||||
80000090: fff7879b addiw x15,x15,-1
|
||||
80000094: 02e6873b mulw x14,x13,x14
|
||||
80000098: fe879ae3 bne x15,x8,8000008c <main+0x64>
|
||||
8000009c: 00492503 lw x10,4(x18)
|
||||
800000a0: 0014849b addiw x9,x9,1
|
||||
800000a4: 00498993 addi x19,x19,4
|
||||
800000a8: 40e50533 sub x10,x10,x14
|
||||
800000ac: 00153513 sltiu x10,x10,1
|
||||
800000b0: 00490913 addi x18,x18,4
|
||||
800000b4: 00e9a023 sw x14,0(x19)
|
||||
800000b8: f59ff0ef jal x1,80000010 <check>
|
||||
800000bc: fd4492e3 bne x9,x20,80000080 <main+0x58>
|
||||
800000c0: 02813083 ld x1,40(x2)
|
||||
800000c4: 02013403 ld x8,32(x2)
|
||||
800000c8: 01813483 ld x9,24(x2)
|
||||
800000cc: 01013903 ld x18,16(x2)
|
||||
800000d0: 00813983 ld x19,8(x2)
|
||||
800000d4: 00013a03 ld x20,0(x2)
|
||||
800000d8: 00000513 addi x10,x0,0
|
||||
800000dc: 03010113 addi x2,x2,48
|
||||
800000e0: 00008067 jalr x0,0(x1)
|
||||
800000e4: 00100713 addi x14,x0,1
|
||||
800000e8: fb5ff06f jal x0,8000009c <main+0x74>
|
||||
|
||||
00000000800000ec <halt>:
|
||||
800000ec: 00050513 addi x10,x10,0
|
||||
800000f0: 00100073 ebreak
|
||||
800000f4: 0000006f jal x0,800000f4 <halt+0x8>
|
||||
|
||||
00000000800000f8 <_trm_init>:
|
||||
800000f8: ff010113 addi x2,x2,-16
|
||||
800000fc: 00000517 auipc x10,0x0
|
||||
80000100: 01c50513 addi x10,x10,28 # 80000118 <_etext>
|
||||
80000104: 00113423 sd x1,8(x2)
|
||||
80000108: f21ff0ef jal x1,80000028 <main>
|
||||
8000010c: 00050513 addi x10,x10,0
|
||||
80000110: 00100073 ebreak
|
||||
80000114: 0000006f jal x0,80000114 <_trm_init+0x1c>
|
||||
@ -0,0 +1,67 @@
|
||||
|
||||
elf/am-tests/fib: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 0a4000ef jal x1,800000b0 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 080000ef jal x1,800000a4 <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fe010113 addi x2,x2,-32
|
||||
8000002c: 00813823 sd x8,16(x2)
|
||||
80000030: 00913423 sd x9,8(x2)
|
||||
80000034: 01213023 sd x18,0(x2)
|
||||
80000038: 00113c23 sd x1,24(x2)
|
||||
8000003c: 00000417 auipc x8,0x0
|
||||
80000040: 13c40413 addi x8,x8,316 # 80000178 <fib>
|
||||
80000044: 00000497 auipc x9,0x0
|
||||
80000048: 09c48493 addi x9,x9,156 # 800000e0 <ans+0x8>
|
||||
8000004c: 00000917 auipc x18,0x0
|
||||
80000050: 1c490913 addi x18,x18,452 # 80000210 <fib+0x98>
|
||||
80000054: 00442703 lw x14,4(x8)
|
||||
80000058: 00042783 lw x15,0(x8)
|
||||
8000005c: 0004a503 lw x10,0(x9)
|
||||
80000060: 00440413 addi x8,x8,4
|
||||
80000064: 00e7873b addw x14,x15,x14
|
||||
80000068: 40e50533 sub x10,x10,x14
|
||||
8000006c: 00153513 sltiu x10,x10,1
|
||||
80000070: 00e42223 sw x14,4(x8)
|
||||
80000074: 00448493 addi x9,x9,4
|
||||
80000078: f99ff0ef jal x1,80000010 <check>
|
||||
8000007c: fd241ce3 bne x8,x18,80000054 <main+0x2c>
|
||||
80000080: 00100513 addi x10,x0,1
|
||||
80000084: f8dff0ef jal x1,80000010 <check>
|
||||
80000088: 01813083 ld x1,24(x2)
|
||||
8000008c: 01013403 ld x8,16(x2)
|
||||
80000090: 00813483 ld x9,8(x2)
|
||||
80000094: 00013903 ld x18,0(x2)
|
||||
80000098: 00000513 addi x10,x0,0
|
||||
8000009c: 02010113 addi x2,x2,32
|
||||
800000a0: 00008067 jalr x0,0(x1)
|
||||
|
||||
00000000800000a4 <halt>:
|
||||
800000a4: 00050513 addi x10,x10,0
|
||||
800000a8: 00100073 ebreak
|
||||
800000ac: 0000006f jal x0,800000ac <halt+0x8>
|
||||
|
||||
00000000800000b0 <_trm_init>:
|
||||
800000b0: ff010113 addi x2,x2,-16
|
||||
800000b4: 00000517 auipc x10,0x0
|
||||
800000b8: 01c50513 addi x10,x10,28 # 800000d0 <_etext>
|
||||
800000bc: 00113423 sd x1,8(x2)
|
||||
800000c0: f69ff0ef jal x1,80000028 <main>
|
||||
800000c4: 00050513 addi x10,x10,0
|
||||
800000c8: 00100073 ebreak
|
||||
800000cc: 0000006f jal x0,800000cc <_trm_init+0x1c>
|
||||
@ -0,0 +1,92 @@
|
||||
|
||||
elf/am-tests/goldbach: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 100000ef jal x1,8000010c <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 0dc000ef jal x1,80000100 <halt>
|
||||
|
||||
0000000080000028 <goldbach>:
|
||||
80000028: 00200793 addi x15,x0,2
|
||||
8000002c: 08a7d063 bge x15,x10,800000ac <goldbach+0x84>
|
||||
80000030: ffe5059b addiw x11,x10,-2
|
||||
80000034: 00200693 addi x13,x0,2
|
||||
80000038: 00200813 addi x16,x0,2
|
||||
8000003c: 00100893 addi x17,x0,1
|
||||
80000040: 03068463 beq x13,x16,80000068 <goldbach+0x40>
|
||||
80000044: 0016f793 andi x15,x13,1
|
||||
80000048: 04078c63 beq x15,x0,800000a0 <goldbach+0x78>
|
||||
8000004c: 00200713 addi x14,x0,2
|
||||
80000050: 00c0006f jal x0,8000005c <goldbach+0x34>
|
||||
80000054: 02f6e7bb remw x15,x13,x15
|
||||
80000058: 04078463 beq x15,x0,800000a0 <goldbach+0x78>
|
||||
8000005c: 0017071b addiw x14,x14,1
|
||||
80000060: 00070793 addi x15,x14,0
|
||||
80000064: fed718e3 bne x14,x13,80000054 <goldbach+0x2c>
|
||||
80000068: 0005861b addiw x12,x11,0
|
||||
8000006c: 03158a63 beq x11,x17,800000a0 <goldbach+0x78>
|
||||
80000070: 03060463 beq x12,x16,80000098 <goldbach+0x70>
|
||||
80000074: 0015f793 andi x15,x11,1
|
||||
80000078: 02078463 beq x15,x0,800000a0 <goldbach+0x78>
|
||||
8000007c: 00200713 addi x14,x0,2
|
||||
80000080: 00c0006f jal x0,8000008c <goldbach+0x64>
|
||||
80000084: 02f667bb remw x15,x12,x15
|
||||
80000088: 00078c63 beq x15,x0,800000a0 <goldbach+0x78>
|
||||
8000008c: 0017071b addiw x14,x14,1
|
||||
80000090: 00070793 addi x15,x14,0
|
||||
80000094: fee618e3 bne x12,x14,80000084 <goldbach+0x5c>
|
||||
80000098: 00100513 addi x10,x0,1
|
||||
8000009c: 00008067 jalr x0,0(x1)
|
||||
800000a0: 0016869b addiw x13,x13,1
|
||||
800000a4: fff5859b addiw x11,x11,-1
|
||||
800000a8: f8d51ce3 bne x10,x13,80000040 <goldbach+0x18>
|
||||
800000ac: 00000513 addi x10,x0,0
|
||||
800000b0: 00008067 jalr x0,0(x1)
|
||||
|
||||
00000000800000b4 <main>:
|
||||
800000b4: fe010113 addi x2,x2,-32
|
||||
800000b8: 00813823 sd x8,16(x2)
|
||||
800000bc: 00913423 sd x9,8(x2)
|
||||
800000c0: 00113c23 sd x1,24(x2)
|
||||
800000c4: 00400413 addi x8,x0,4
|
||||
800000c8: 02000493 addi x9,x0,32
|
||||
800000cc: 00040513 addi x10,x8,0
|
||||
800000d0: f59ff0ef jal x1,80000028 <goldbach>
|
||||
800000d4: fff50513 addi x10,x10,-1
|
||||
800000d8: 0024041b addiw x8,x8,2
|
||||
800000dc: 00153513 sltiu x10,x10,1
|
||||
800000e0: f31ff0ef jal x1,80000010 <check>
|
||||
800000e4: fe9414e3 bne x8,x9,800000cc <main+0x18>
|
||||
800000e8: 01813083 ld x1,24(x2)
|
||||
800000ec: 01013403 ld x8,16(x2)
|
||||
800000f0: 00813483 ld x9,8(x2)
|
||||
800000f4: 00000513 addi x10,x0,0
|
||||
800000f8: 02010113 addi x2,x2,32
|
||||
800000fc: 00008067 jalr x0,0(x1)
|
||||
|
||||
0000000080000100 <halt>:
|
||||
80000100: 00050513 addi x10,x10,0
|
||||
80000104: 00100073 ebreak
|
||||
80000108: 0000006f jal x0,80000108 <halt+0x8>
|
||||
|
||||
000000008000010c <_trm_init>:
|
||||
8000010c: ff010113 addi x2,x2,-16
|
||||
80000110: 00000517 auipc x10,0x0
|
||||
80000114: 02050513 addi x10,x10,32 # 80000130 <mainargs>
|
||||
80000118: 00113423 sd x1,8(x2)
|
||||
8000011c: f99ff0ef jal x1,800000b4 <main>
|
||||
80000120: 00050513 addi x10,x10,0
|
||||
80000124: 00100073 ebreak
|
||||
80000128: 0000006f jal x0,80000128 <_trm_init+0x1c>
|
||||
@ -0,0 +1,85 @@
|
||||
|
||||
elf/am-tests/if-else: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 0ec000ef jal x1,800000f8 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 0c8000ef jal x1,800000ec <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fc010113 addi x2,x2,-64
|
||||
8000002c: 02813823 sd x8,48(x2)
|
||||
80000030: 02913423 sd x9,40(x2)
|
||||
80000034: 03213023 sd x18,32(x2)
|
||||
80000038: 01313c23 sd x19,24(x2)
|
||||
8000003c: 01413823 sd x20,16(x2)
|
||||
80000040: 01513423 sd x21,8(x2)
|
||||
80000044: 01613023 sd x22,0(x2)
|
||||
80000048: 02113c23 sd x1,56(x2)
|
||||
8000004c: 00000417 auipc x8,0x0
|
||||
80000050: 10c40413 addi x8,x8,268 # 80000158 <test_data>
|
||||
80000054: 00000497 auipc x9,0x0
|
||||
80000058: 0cc48493 addi x9,x9,204 # 80000120 <ans>
|
||||
8000005c: 00000997 auipc x19,0x0
|
||||
80000060: 13498993 addi x19,x19,308 # 80000190 <_bss_start>
|
||||
80000064: 1f400913 addi x18,x0,500
|
||||
80000068: 12c00a93 addi x21,x0,300
|
||||
8000006c: 06400b13 addi x22,x0,100
|
||||
80000070: 03200a13 addi x20,x0,50
|
||||
80000074: 00042783 lw x15,0(x8)
|
||||
80000078: 09600713 addi x14,x0,150
|
||||
8000007c: 00440413 addi x8,x8,4
|
||||
80000080: 02f94063 blt x18,x15,800000a0 <main+0x78>
|
||||
80000084: 00fa2733 slt x14,x20,x15
|
||||
80000088: 40e006b3 sub x13,x0,x14
|
||||
8000008c: 06400713 addi x14,x0,100
|
||||
80000090: 00fac863 blt x21,x15,800000a0 <main+0x78>
|
||||
80000094: 04b00713 addi x14,x0,75
|
||||
80000098: 00fb4463 blt x22,x15,800000a0 <main+0x78>
|
||||
8000009c: 0326f713 andi x14,x13,50
|
||||
800000a0: 0004a503 lw x10,0(x9)
|
||||
800000a4: 00448493 addi x9,x9,4
|
||||
800000a8: 40e50533 sub x10,x10,x14
|
||||
800000ac: 00153513 sltiu x10,x10,1
|
||||
800000b0: f61ff0ef jal x1,80000010 <check>
|
||||
800000b4: fd3410e3 bne x8,x19,80000074 <main+0x4c>
|
||||
800000b8: 00100513 addi x10,x0,1
|
||||
800000bc: f55ff0ef jal x1,80000010 <check>
|
||||
800000c0: 03813083 ld x1,56(x2)
|
||||
800000c4: 03013403 ld x8,48(x2)
|
||||
800000c8: 02813483 ld x9,40(x2)
|
||||
800000cc: 02013903 ld x18,32(x2)
|
||||
800000d0: 01813983 ld x19,24(x2)
|
||||
800000d4: 01013a03 ld x20,16(x2)
|
||||
800000d8: 00813a83 ld x21,8(x2)
|
||||
800000dc: 00013b03 ld x22,0(x2)
|
||||
800000e0: 00000513 addi x10,x0,0
|
||||
800000e4: 04010113 addi x2,x2,64
|
||||
800000e8: 00008067 jalr x0,0(x1)
|
||||
|
||||
00000000800000ec <halt>:
|
||||
800000ec: 00050513 addi x10,x10,0
|
||||
800000f0: 00100073 ebreak
|
||||
800000f4: 0000006f jal x0,800000f4 <halt+0x8>
|
||||
|
||||
00000000800000f8 <_trm_init>:
|
||||
800000f8: ff010113 addi x2,x2,-16
|
||||
800000fc: 00000517 auipc x10,0x0
|
||||
80000100: 01c50513 addi x10,x10,28 # 80000118 <_etext>
|
||||
80000104: 00113423 sd x1,8(x2)
|
||||
80000108: f21ff0ef jal x1,80000028 <main>
|
||||
8000010c: 00050513 addi x10,x10,0
|
||||
80000110: 00100073 ebreak
|
||||
80000114: 0000006f jal x0,80000114 <_trm_init+0x1c>
|
||||
@ -0,0 +1,74 @@
|
||||
|
||||
elf/am-tests/leap-year: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 0c0000ef jal x1,800000cc <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 09c000ef jal x1,800000c0 <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fd010113 addi x2,x2,-48
|
||||
8000002c: 02813023 sd x8,32(x2)
|
||||
80000030: 00913c23 sd x9,24(x2)
|
||||
80000034: 01213823 sd x18,16(x2)
|
||||
80000038: 01313423 sd x19,8(x2)
|
||||
8000003c: 01413023 sd x20,0(x2)
|
||||
80000040: 02113423 sd x1,40(x2)
|
||||
80000044: 00000497 auipc x9,0x0
|
||||
80000048: 0b448493 addi x9,x9,180 # 800000f8 <ans>
|
||||
8000004c: 00000917 auipc x18,0x0
|
||||
80000050: 2a090913 addi x18,x18,672 # 800002ec <_bss_start>
|
||||
80000054: 76200413 addi x8,x0,1890
|
||||
80000058: 19000993 addi x19,x0,400
|
||||
8000005c: 06400a13 addi x20,x0,100
|
||||
80000060: 00347793 andi x15,x8,3
|
||||
80000064: 0004071b addiw x14,x8,0
|
||||
80000068: 00079863 bne x15,x0,80000078 <main+0x50>
|
||||
8000006c: 034766bb remw x13,x14,x20
|
||||
80000070: 00100793 addi x15,x0,1
|
||||
80000074: 00069663 bne x13,x0,80000080 <main+0x58>
|
||||
80000078: 0337673b remw x14,x14,x19
|
||||
8000007c: 00173793 sltiu x15,x14,1
|
||||
80000080: 0004a503 lw x10,0(x9)
|
||||
80000084: 00448493 addi x9,x9,4
|
||||
80000088: 0014041b addiw x8,x8,1
|
||||
8000008c: 40f50533 sub x10,x10,x15
|
||||
80000090: 00153513 sltiu x10,x10,1
|
||||
80000094: f7dff0ef jal x1,80000010 <check>
|
||||
80000098: fd2494e3 bne x9,x18,80000060 <main+0x38>
|
||||
8000009c: 02813083 ld x1,40(x2)
|
||||
800000a0: 02013403 ld x8,32(x2)
|
||||
800000a4: 01813483 ld x9,24(x2)
|
||||
800000a8: 01013903 ld x18,16(x2)
|
||||
800000ac: 00813983 ld x19,8(x2)
|
||||
800000b0: 00013a03 ld x20,0(x2)
|
||||
800000b4: 00000513 addi x10,x0,0
|
||||
800000b8: 03010113 addi x2,x2,48
|
||||
800000bc: 00008067 jalr x0,0(x1)
|
||||
|
||||
00000000800000c0 <halt>:
|
||||
800000c0: 00050513 addi x10,x10,0
|
||||
800000c4: 00100073 ebreak
|
||||
800000c8: 0000006f jal x0,800000c8 <halt+0x8>
|
||||
|
||||
00000000800000cc <_trm_init>:
|
||||
800000cc: ff010113 addi x2,x2,-16
|
||||
800000d0: 00000517 auipc x10,0x0
|
||||
800000d4: 02050513 addi x10,x10,32 # 800000f0 <mainargs>
|
||||
800000d8: 00113423 sd x1,8(x2)
|
||||
800000dc: f4dff0ef jal x1,80000028 <main>
|
||||
800000e0: 00050513 addi x10,x10,0
|
||||
800000e4: 00100073 ebreak
|
||||
800000e8: 0000006f jal x0,800000e8 <_trm_init+0x1c>
|
||||
@ -0,0 +1,145 @@
|
||||
|
||||
elf/am-tests/load-store: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 1dc000ef jal x1,800001e8 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 1b8000ef jal x1,800001dc <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fd010113 addi x2,x2,-48
|
||||
8000002c: 01313423 sd x19,8(x2)
|
||||
80000030: 00000997 auipc x19,0x0
|
||||
80000034: 23098993 addi x19,x19,560 # 80000260 <mem>
|
||||
80000038: 02813023 sd x8,32(x2)
|
||||
8000003c: 00913c23 sd x9,24(x2)
|
||||
80000040: 01213823 sd x18,16(x2)
|
||||
80000044: 02113423 sd x1,40(x2)
|
||||
80000048: 01413023 sd x20,0(x2)
|
||||
8000004c: 00000917 auipc x18,0x0
|
||||
80000050: 1c490913 addi x18,x18,452 # 80000210 <lh_ans>
|
||||
80000054: 00000497 auipc x9,0x0
|
||||
80000058: 21c48493 addi x9,x9,540 # 80000270 <sh_ans>
|
||||
8000005c: 00098413 addi x8,x19,0
|
||||
80000060: 00041503 lh x10,0(x8)
|
||||
80000064: 00092783 lw x15,0(x18)
|
||||
80000068: 00240413 addi x8,x8,2
|
||||
8000006c: 00490913 addi x18,x18,4
|
||||
80000070: 40f50533 sub x10,x10,x15
|
||||
80000074: 00153513 sltiu x10,x10,1
|
||||
80000078: f99ff0ef jal x1,80000010 <check>
|
||||
8000007c: fe9412e3 bne x8,x9,80000060 <main+0x38>
|
||||
80000080: 00000917 auipc x18,0x0
|
||||
80000084: 1b090913 addi x18,x18,432 # 80000230 <lhu_ans>
|
||||
80000088: 00000417 auipc x8,0x0
|
||||
8000008c: 1d840413 addi x8,x8,472 # 80000260 <mem>
|
||||
80000090: 00045503 lhu x10,0(x8)
|
||||
80000094: 00092783 lw x15,0(x18)
|
||||
80000098: 00240413 addi x8,x8,2
|
||||
8000009c: 00490913 addi x18,x18,4
|
||||
800000a0: 40f50533 sub x10,x10,x15
|
||||
800000a4: 00153513 sltiu x10,x10,1
|
||||
800000a8: f69ff0ef jal x1,80000010 <check>
|
||||
800000ac: fe9412e3 bne x8,x9,80000090 <main+0x68>
|
||||
800000b0: 0029c683 lbu x13,2(x19)
|
||||
800000b4: 0019c603 lbu x12,1(x19)
|
||||
800000b8: 0039c703 lbu x14,3(x19)
|
||||
800000bc: 0049c783 lbu x15,4(x19)
|
||||
800000c0: 00869693 slli x13,x13,0x8
|
||||
800000c4: 00000417 auipc x8,0x0
|
||||
800000c8: 18c40413 addi x8,x8,396 # 80000250 <lwlr_ans>
|
||||
800000cc: 00c6e6b3 or x13,x13,x12
|
||||
800000d0: 01071713 slli x14,x14,0x10
|
||||
800000d4: 00d76733 or x14,x14,x13
|
||||
800000d8: 00042503 lw x10,0(x8)
|
||||
800000dc: 01879793 slli x15,x15,0x18
|
||||
800000e0: 00e7e7b3 or x15,x15,x14
|
||||
800000e4: 0007879b addiw x15,x15,0
|
||||
800000e8: 40f50533 sub x10,x10,x15
|
||||
800000ec: 00153513 sltiu x10,x10,1
|
||||
800000f0: f21ff0ef jal x1,80000010 <check>
|
||||
800000f4: 0069c683 lbu x13,6(x19)
|
||||
800000f8: 0059c603 lbu x12,5(x19)
|
||||
800000fc: 0079c703 lbu x14,7(x19)
|
||||
80000100: 0089c783 lbu x15,8(x19)
|
||||
80000104: 00869693 slli x13,x13,0x8
|
||||
80000108: 00c6e6b3 or x13,x13,x12
|
||||
8000010c: 01071713 slli x14,x14,0x10
|
||||
80000110: 00d76733 or x14,x14,x13
|
||||
80000114: 00442503 lw x10,4(x8)
|
||||
80000118: 01879793 slli x15,x15,0x18
|
||||
8000011c: 00e7e7b3 or x15,x15,x14
|
||||
80000120: 0007879b addiw x15,x15,0
|
||||
80000124: 40f50533 sub x10,x10,x15
|
||||
80000128: 00153513 sltiu x10,x10,1
|
||||
8000012c: ee5ff0ef jal x1,80000010 <check>
|
||||
80000130: 00a9c683 lbu x13,10(x19)
|
||||
80000134: 0099c603 lbu x12,9(x19)
|
||||
80000138: 00b9c703 lbu x14,11(x19)
|
||||
8000013c: 00c9c783 lbu x15,12(x19)
|
||||
80000140: 00869693 slli x13,x13,0x8
|
||||
80000144: 00c6e6b3 or x13,x13,x12
|
||||
80000148: 01071713 slli x14,x14,0x10
|
||||
8000014c: 00842503 lw x10,8(x8)
|
||||
80000150: 00d76733 or x14,x14,x13
|
||||
80000154: 01879793 slli x15,x15,0x18
|
||||
80000158: 00e7e7b3 or x15,x15,x14
|
||||
8000015c: 0007879b addiw x15,x15,0
|
||||
80000160: 40f50533 sub x10,x10,x15
|
||||
80000164: 00153513 sltiu x10,x10,1
|
||||
80000168: 00100a13 addi x20,x0,1
|
||||
8000016c: ea5ff0ef jal x1,80000010 <check>
|
||||
80000170: 00000917 auipc x18,0x0
|
||||
80000174: 10090913 addi x18,x18,256 # 80000270 <sh_ans>
|
||||
80000178: 00000417 auipc x8,0x0
|
||||
8000017c: 0e840413 addi x8,x8,232 # 80000260 <mem>
|
||||
80000180: 413a09bb subw x19,x20,x19
|
||||
80000184: 008987bb addw x15,x19,x8
|
||||
80000188: 00fa17bb sllw x15,x20,x15
|
||||
8000018c: 00092503 lw x10,0(x18)
|
||||
80000190: fff7c793 xori x15,x15,-1
|
||||
80000194: 03079793 slli x15,x15,0x30
|
||||
80000198: 0307d793 srli x15,x15,0x30
|
||||
8000019c: 40f50533 sub x10,x10,x15
|
||||
800001a0: 00f41023 sh x15,0(x8)
|
||||
800001a4: 00153513 sltiu x10,x10,1
|
||||
800001a8: 00240413 addi x8,x8,2
|
||||
800001ac: e65ff0ef jal x1,80000010 <check>
|
||||
800001b0: 00490913 addi x18,x18,4
|
||||
800001b4: fc9418e3 bne x8,x9,80000184 <main+0x15c>
|
||||
800001b8: 02813083 ld x1,40(x2)
|
||||
800001bc: 02013403 ld x8,32(x2)
|
||||
800001c0: 01813483 ld x9,24(x2)
|
||||
800001c4: 01013903 ld x18,16(x2)
|
||||
800001c8: 00813983 ld x19,8(x2)
|
||||
800001cc: 00013a03 ld x20,0(x2)
|
||||
800001d0: 00000513 addi x10,x0,0
|
||||
800001d4: 03010113 addi x2,x2,48
|
||||
800001d8: 00008067 jalr x0,0(x1)
|
||||
|
||||
00000000800001dc <halt>:
|
||||
800001dc: 00050513 addi x10,x10,0
|
||||
800001e0: 00100073 ebreak
|
||||
800001e4: 0000006f jal x0,800001e4 <halt+0x8>
|
||||
|
||||
00000000800001e8 <_trm_init>:
|
||||
800001e8: ff010113 addi x2,x2,-16
|
||||
800001ec: 00000517 auipc x10,0x0
|
||||
800001f0: 01c50513 addi x10,x10,28 # 80000208 <_etext>
|
||||
800001f4: 00113423 sd x1,8(x2)
|
||||
800001f8: e31ff0ef jal x1,80000028 <main>
|
||||
800001fc: 00050513 addi x10,x10,0
|
||||
80000200: 00100073 ebreak
|
||||
80000204: 0000006f jal x0,80000204 <_trm_init+0x1c>
|
||||
@ -0,0 +1,104 @@
|
||||
|
||||
elf/am-tests/matrix-mul: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 138000ef jal x1,80000144 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 114000ef jal x1,80000138 <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fb010113 addi x2,x2,-80
|
||||
8000002c: 02913c23 sd x9,56(x2)
|
||||
80000030: 03213823 sd x18,48(x2)
|
||||
80000034: 03313423 sd x19,40(x2)
|
||||
80000038: 03413023 sd x20,32(x2)
|
||||
8000003c: 01513c23 sd x21,24(x2)
|
||||
80000040: 01613823 sd x22,16(x2)
|
||||
80000044: 04113423 sd x1,72(x2)
|
||||
80000048: 04813023 sd x8,64(x2)
|
||||
8000004c: 01713423 sd x23,8(x2)
|
||||
80000050: 01813023 sd x24,0(x2)
|
||||
80000054: 00000497 auipc x9,0x0
|
||||
80000058: 11c48493 addi x9,x9,284 # 80000170 <a>
|
||||
8000005c: 00000a17 auipc x20,0x0
|
||||
80000060: 5c4a0a13 addi x20,x20,1476 # 80000620 <c>
|
||||
80000064: 00000997 auipc x19,0x0
|
||||
80000068: 29c98993 addi x19,x19,668 # 80000300 <ans>
|
||||
8000006c: 00000b17 auipc x22,0x0
|
||||
80000070: 294b0b13 addi x22,x22,660 # 80000300 <ans>
|
||||
80000074: 00000917 auipc x18,0x0
|
||||
80000078: 5d490913 addi x18,x18,1492 # 80000648 <c+0x28>
|
||||
8000007c: 00000a97 auipc x21,0x0
|
||||
80000080: 5a4a8a93 addi x21,x21,1444 # 80000620 <c>
|
||||
80000084: 000a8593 addi x11,x21,0
|
||||
80000088: 00098c13 addi x24,x19,0
|
||||
8000008c: 000a0b93 addi x23,x20,0
|
||||
80000090: e7058413 addi x8,x11,-400
|
||||
80000094: 00048713 addi x14,x9,0
|
||||
80000098: 00000693 addi x13,x0,0
|
||||
8000009c: 00072603 lw x12,0(x14)
|
||||
800000a0: 00042783 lw x15,0(x8)
|
||||
800000a4: 02840413 addi x8,x8,40
|
||||
800000a8: 00470713 addi x14,x14,4
|
||||
800000ac: 02c787bb mulw x15,x15,x12
|
||||
800000b0: 00d786bb addw x13,x15,x13
|
||||
800000b4: feb414e3 bne x8,x11,8000009c <main+0x74>
|
||||
800000b8: 000c2503 lw x10,0(x24)
|
||||
800000bc: 00dba023 sw x13,0(x23)
|
||||
800000c0: 004c0c13 addi x24,x24,4
|
||||
800000c4: 40d50533 sub x10,x10,x13
|
||||
800000c8: 00153513 sltiu x10,x10,1
|
||||
800000cc: f45ff0ef jal x1,80000010 <check>
|
||||
800000d0: 00100513 addi x10,x0,1
|
||||
800000d4: f3dff0ef jal x1,80000010 <check>
|
||||
800000d8: 00440593 addi x11,x8,4
|
||||
800000dc: 004b8b93 addi x23,x23,4
|
||||
800000e0: fab918e3 bne x18,x11,80000090 <main+0x68>
|
||||
800000e4: 00100513 addi x10,x0,1
|
||||
800000e8: 02848493 addi x9,x9,40
|
||||
800000ec: f25ff0ef jal x1,80000010 <check>
|
||||
800000f0: 028a0a13 addi x20,x20,40
|
||||
800000f4: 02898993 addi x19,x19,40
|
||||
800000f8: f96496e3 bne x9,x22,80000084 <main+0x5c>
|
||||
800000fc: 00100513 addi x10,x0,1
|
||||
80000100: f11ff0ef jal x1,80000010 <check>
|
||||
80000104: 04813083 ld x1,72(x2)
|
||||
80000108: 04013403 ld x8,64(x2)
|
||||
8000010c: 03813483 ld x9,56(x2)
|
||||
80000110: 03013903 ld x18,48(x2)
|
||||
80000114: 02813983 ld x19,40(x2)
|
||||
80000118: 02013a03 ld x20,32(x2)
|
||||
8000011c: 01813a83 ld x21,24(x2)
|
||||
80000120: 01013b03 ld x22,16(x2)
|
||||
80000124: 00813b83 ld x23,8(x2)
|
||||
80000128: 00013c03 ld x24,0(x2)
|
||||
8000012c: 00000513 addi x10,x0,0
|
||||
80000130: 05010113 addi x2,x2,80
|
||||
80000134: 00008067 jalr x0,0(x1)
|
||||
|
||||
0000000080000138 <halt>:
|
||||
80000138: 00050513 addi x10,x10,0
|
||||
8000013c: 00100073 ebreak
|
||||
80000140: 0000006f jal x0,80000140 <halt+0x8>
|
||||
|
||||
0000000080000144 <_trm_init>:
|
||||
80000144: ff010113 addi x2,x2,-16
|
||||
80000148: 00000517 auipc x10,0x0
|
||||
8000014c: 02050513 addi x10,x10,32 # 80000168 <mainargs>
|
||||
80000150: 00113423 sd x1,8(x2)
|
||||
80000154: ed5ff0ef jal x1,80000028 <main>
|
||||
80000158: 00050513 addi x10,x10,0
|
||||
8000015c: 00100073 ebreak
|
||||
80000160: 0000006f jal x0,80000160 <_trm_init+0x1c>
|
||||
@ -0,0 +1,94 @@
|
||||
|
||||
elf/am-tests/max: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 110000ef jal x1,8000011c <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 0ec000ef jal x1,80000110 <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fa010113 addi x2,x2,-96
|
||||
8000002c: 01713c23 sd x23,24(x2)
|
||||
80000030: 00000b97 auipc x23,0x0
|
||||
80000034: 218b8b93 addi x23,x23,536 # 80000248 <test_data>
|
||||
80000038: 05213023 sd x18,64(x2)
|
||||
8000003c: 03413823 sd x20,48(x2)
|
||||
80000040: 03513423 sd x21,40(x2)
|
||||
80000044: 03613023 sd x22,32(x2)
|
||||
80000048: 01813823 sd x24,16(x2)
|
||||
8000004c: 04113c23 sd x1,88(x2)
|
||||
80000050: 04813823 sd x8,80(x2)
|
||||
80000054: 04913423 sd x9,72(x2)
|
||||
80000058: 03313c23 sd x19,56(x2)
|
||||
8000005c: 01913423 sd x25,8(x2)
|
||||
80000060: 00000b17 auipc x22,0x0
|
||||
80000064: 0e8b0b13 addi x22,x22,232 # 80000148 <ans>
|
||||
80000068: 000b8a93 addi x21,x23,0
|
||||
8000006c: 00000a13 addi x20,x0,0
|
||||
80000070: 00000917 auipc x18,0x0
|
||||
80000074: 1f890913 addi x18,x18,504 # 80000268 <_bss_start>
|
||||
80000078: 04000c13 addi x24,x0,64
|
||||
8000007c: 000aa483 lw x9,0(x21)
|
||||
80000080: 000b0c93 addi x25,x22,0
|
||||
80000084: 000b8413 addi x8,x23,0
|
||||
80000088: 00048993 addi x19,x9,0
|
||||
8000008c: 00042783 lw x15,0(x8)
|
||||
80000090: 00440413 addi x8,x8,4
|
||||
80000094: 0007851b addiw x10,x15,0
|
||||
80000098: 0097d463 bge x15,x9,800000a0 <main+0x78>
|
||||
8000009c: 0009851b addiw x10,x19,0
|
||||
800000a0: 000ca783 lw x15,0(x25)
|
||||
800000a4: 004c8c93 addi x25,x25,4
|
||||
800000a8: 40f50533 sub x10,x10,x15
|
||||
800000ac: 00153513 sltiu x10,x10,1
|
||||
800000b0: f61ff0ef jal x1,80000010 <check>
|
||||
800000b4: fc891ce3 bne x18,x8,8000008c <main+0x64>
|
||||
800000b8: 00100513 addi x10,x0,1
|
||||
800000bc: 008a0a1b addiw x20,x20,8
|
||||
800000c0: f51ff0ef jal x1,80000010 <check>
|
||||
800000c4: 004a8a93 addi x21,x21,4
|
||||
800000c8: 020b0b13 addi x22,x22,32
|
||||
800000cc: fb8a18e3 bne x20,x24,8000007c <main+0x54>
|
||||
800000d0: 00100513 addi x10,x0,1
|
||||
800000d4: f3dff0ef jal x1,80000010 <check>
|
||||
800000d8: 05813083 ld x1,88(x2)
|
||||
800000dc: 05013403 ld x8,80(x2)
|
||||
800000e0: 04813483 ld x9,72(x2)
|
||||
800000e4: 04013903 ld x18,64(x2)
|
||||
800000e8: 03813983 ld x19,56(x2)
|
||||
800000ec: 03013a03 ld x20,48(x2)
|
||||
800000f0: 02813a83 ld x21,40(x2)
|
||||
800000f4: 02013b03 ld x22,32(x2)
|
||||
800000f8: 01813b83 ld x23,24(x2)
|
||||
800000fc: 01013c03 ld x24,16(x2)
|
||||
80000100: 00813c83 ld x25,8(x2)
|
||||
80000104: 00000513 addi x10,x0,0
|
||||
80000108: 06010113 addi x2,x2,96
|
||||
8000010c: 00008067 jalr x0,0(x1)
|
||||
|
||||
0000000080000110 <halt>:
|
||||
80000110: 00050513 addi x10,x10,0
|
||||
80000114: 00100073 ebreak
|
||||
80000118: 0000006f jal x0,80000118 <halt+0x8>
|
||||
|
||||
000000008000011c <_trm_init>:
|
||||
8000011c: ff010113 addi x2,x2,-16
|
||||
80000120: 00000517 auipc x10,0x0
|
||||
80000124: 02050513 addi x10,x10,32 # 80000140 <mainargs>
|
||||
80000128: 00113423 sd x1,8(x2)
|
||||
8000012c: efdff0ef jal x1,80000028 <main>
|
||||
80000130: 00050513 addi x10,x10,0
|
||||
80000134: 00100073 ebreak
|
||||
80000138: 0000006f jal x0,80000138 <_trm_init+0x1c>
|
||||
@ -0,0 +1,107 @@
|
||||
|
||||
elf/am-tests/min3: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 144000ef jal x1,80000150 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 120000ef jal x1,80000144 <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: f9010113 addi x2,x2,-112
|
||||
8000002c: 03613823 sd x22,48(x2)
|
||||
80000030: 00000b17 auipc x22,0x0
|
||||
80000034: 248b0b13 addi x22,x22,584 # 80000278 <test_data>
|
||||
80000038: 05213823 sd x18,80(x2)
|
||||
8000003c: 03713423 sd x23,40(x2)
|
||||
80000040: 03813023 sd x24,32(x2)
|
||||
80000044: 06113423 sd x1,104(x2)
|
||||
80000048: 06813023 sd x8,96(x2)
|
||||
8000004c: 04913c23 sd x9,88(x2)
|
||||
80000050: 05313423 sd x19,72(x2)
|
||||
80000054: 05413023 sd x20,64(x2)
|
||||
80000058: 03513c23 sd x21,56(x2)
|
||||
8000005c: 01913c23 sd x25,24(x2)
|
||||
80000060: 01a13823 sd x26,16(x2)
|
||||
80000064: 01b13423 sd x27,8(x2)
|
||||
80000068: 00000c17 auipc x24,0x0
|
||||
8000006c: 110c0c13 addi x24,x24,272 # 80000178 <ans>
|
||||
80000070: 00000917 auipc x18,0x0
|
||||
80000074: 21890913 addi x18,x18,536 # 80000288 <_bss_start>
|
||||
80000078: 000b0b93 addi x23,x22,0
|
||||
8000007c: 000baa83 lw x21,0(x23)
|
||||
80000080: 000c0993 addi x19,x24,0
|
||||
80000084: 000b0493 addi x9,x22,0
|
||||
80000088: 000a8c93 addi x25,x21,0
|
||||
8000008c: 0004a783 lw x15,0(x9)
|
||||
80000090: 0007841b addiw x8,x15,0
|
||||
80000094: 00fad463 bge x21,x15,8000009c <main+0x74>
|
||||
80000098: 000c841b addiw x8,x25,0
|
||||
8000009c: 00098d93 addi x27,x19,0
|
||||
800000a0: 000b0d13 addi x26,x22,0
|
||||
800000a4: 00040a13 addi x20,x8,0
|
||||
800000a8: 000d2783 lw x15,0(x26)
|
||||
800000ac: 004d0d13 addi x26,x26,4
|
||||
800000b0: 0007851b addiw x10,x15,0
|
||||
800000b4: 00f45463 bge x8,x15,800000bc <main+0x94>
|
||||
800000b8: 000a051b addiw x10,x20,0
|
||||
800000bc: 000da783 lw x15,0(x27)
|
||||
800000c0: 004d8d93 addi x27,x27,4
|
||||
800000c4: 40f50533 sub x10,x10,x15
|
||||
800000c8: 00153513 sltiu x10,x10,1
|
||||
800000cc: f45ff0ef jal x1,80000010 <check>
|
||||
800000d0: fd2d1ce3 bne x26,x18,800000a8 <main+0x80>
|
||||
800000d4: 00100513 addi x10,x0,1
|
||||
800000d8: 00448493 addi x9,x9,4
|
||||
800000dc: f35ff0ef jal x1,80000010 <check>
|
||||
800000e0: 01098993 addi x19,x19,16
|
||||
800000e4: fba494e3 bne x9,x26,8000008c <main+0x64>
|
||||
800000e8: 00100513 addi x10,x0,1
|
||||
800000ec: 004b8b93 addi x23,x23,4
|
||||
800000f0: f21ff0ef jal x1,80000010 <check>
|
||||
800000f4: 040c0c13 addi x24,x24,64
|
||||
800000f8: f89b92e3 bne x23,x9,8000007c <main+0x54>
|
||||
800000fc: 00100513 addi x10,x0,1
|
||||
80000100: f11ff0ef jal x1,80000010 <check>
|
||||
80000104: 06813083 ld x1,104(x2)
|
||||
80000108: 06013403 ld x8,96(x2)
|
||||
8000010c: 05813483 ld x9,88(x2)
|
||||
80000110: 05013903 ld x18,80(x2)
|
||||
80000114: 04813983 ld x19,72(x2)
|
||||
80000118: 04013a03 ld x20,64(x2)
|
||||
8000011c: 03813a83 ld x21,56(x2)
|
||||
80000120: 03013b03 ld x22,48(x2)
|
||||
80000124: 02813b83 ld x23,40(x2)
|
||||
80000128: 02013c03 ld x24,32(x2)
|
||||
8000012c: 01813c83 ld x25,24(x2)
|
||||
80000130: 01013d03 ld x26,16(x2)
|
||||
80000134: 00813d83 ld x27,8(x2)
|
||||
80000138: 00000513 addi x10,x0,0
|
||||
8000013c: 07010113 addi x2,x2,112
|
||||
80000140: 00008067 jalr x0,0(x1)
|
||||
|
||||
0000000080000144 <halt>:
|
||||
80000144: 00050513 addi x10,x10,0
|
||||
80000148: 00100073 ebreak
|
||||
8000014c: 0000006f jal x0,8000014c <halt+0x8>
|
||||
|
||||
0000000080000150 <_trm_init>:
|
||||
80000150: ff010113 addi x2,x2,-16
|
||||
80000154: 00000517 auipc x10,0x0
|
||||
80000158: 01c50513 addi x10,x10,28 # 80000170 <_etext>
|
||||
8000015c: 00113423 sd x1,8(x2)
|
||||
80000160: ec9ff0ef jal x1,80000028 <main>
|
||||
80000164: 00050513 addi x10,x10,0
|
||||
80000168: 00100073 ebreak
|
||||
8000016c: 0000006f jal x0,8000016c <_trm_init+0x1c>
|
||||
@ -0,0 +1,89 @@
|
||||
|
||||
elf/am-tests/mov-c: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 0fc000ef jal x1,80000108 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 0d8000ef jal x1,800000fc <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: ff010113 addi x2,x2,-16
|
||||
8000002c: 00813023 sd x8,0(x2)
|
||||
80000030: 00000417 auipc x8,0x0
|
||||
80000034: 10040413 addi x8,x8,256 # 80000130 <A>
|
||||
80000038: 00042023 sw x0,0(x8)
|
||||
8000003c: 00100793 addi x15,x0,1
|
||||
80000040: 00f42223 sw x15,4(x8)
|
||||
80000044: 00200793 addi x15,x0,2
|
||||
80000048: 00f42423 sw x15,8(x8)
|
||||
8000004c: 00300793 addi x15,x0,3
|
||||
80000050: 00f42623 sw x15,12(x8)
|
||||
80000054: 00400793 addi x15,x0,4
|
||||
80000058: 00f42823 sw x15,16(x8)
|
||||
8000005c: 00c42783 lw x15,12(x8)
|
||||
80000060: 00113423 sd x1,8(x2)
|
||||
80000064: 00000717 auipc x14,0x0
|
||||
80000068: 0ef72a23 sw x15,244(x14) # 80000158 <b>
|
||||
8000006c: 00000797 auipc x15,0x0
|
||||
80000070: 0ec7a783 lw x15,236(x15) # 80000158 <b>
|
||||
80000074: 00f42a23 sw x15,20(x8)
|
||||
80000078: 00042503 lw x10,0(x8)
|
||||
8000007c: 00153513 sltiu x10,x10,1
|
||||
80000080: f91ff0ef jal x1,80000010 <check>
|
||||
80000084: 00442503 lw x10,4(x8)
|
||||
80000088: fff50513 addi x10,x10,-1
|
||||
8000008c: 00153513 sltiu x10,x10,1
|
||||
80000090: f81ff0ef jal x1,80000010 <check>
|
||||
80000094: 00842503 lw x10,8(x8)
|
||||
80000098: ffe50513 addi x10,x10,-2
|
||||
8000009c: 00153513 sltiu x10,x10,1
|
||||
800000a0: f71ff0ef jal x1,80000010 <check>
|
||||
800000a4: 00c42503 lw x10,12(x8)
|
||||
800000a8: ffd50513 addi x10,x10,-3
|
||||
800000ac: 00153513 sltiu x10,x10,1
|
||||
800000b0: f61ff0ef jal x1,80000010 <check>
|
||||
800000b4: 01042503 lw x10,16(x8)
|
||||
800000b8: ffc50513 addi x10,x10,-4
|
||||
800000bc: 00153513 sltiu x10,x10,1
|
||||
800000c0: f51ff0ef jal x1,80000010 <check>
|
||||
800000c4: 00000517 auipc x10,0x0
|
||||
800000c8: 09452503 lw x10,148(x10) # 80000158 <b>
|
||||
800000cc: ffd50513 addi x10,x10,-3
|
||||
800000d0: 00153513 sltiu x10,x10,1
|
||||
800000d4: f3dff0ef jal x1,80000010 <check>
|
||||
800000d8: 01442503 lw x10,20(x8)
|
||||
800000dc: ffd50513 addi x10,x10,-3
|
||||
800000e0: 00153513 sltiu x10,x10,1
|
||||
800000e4: f2dff0ef jal x1,80000010 <check>
|
||||
800000e8: 00813083 ld x1,8(x2)
|
||||
800000ec: 00013403 ld x8,0(x2)
|
||||
800000f0: 00000513 addi x10,x0,0
|
||||
800000f4: 01010113 addi x2,x2,16
|
||||
800000f8: 00008067 jalr x0,0(x1)
|
||||
|
||||
00000000800000fc <halt>:
|
||||
800000fc: 00050513 addi x10,x10,0
|
||||
80000100: 00100073 ebreak
|
||||
80000104: 0000006f jal x0,80000104 <halt+0x8>
|
||||
|
||||
0000000080000108 <_trm_init>:
|
||||
80000108: ff010113 addi x2,x2,-16
|
||||
8000010c: 00000517 auipc x10,0x0
|
||||
80000110: 01c50513 addi x10,x10,28 # 80000128 <_etext>
|
||||
80000114: 00113423 sd x1,8(x2)
|
||||
80000118: f11ff0ef jal x1,80000028 <main>
|
||||
8000011c: 00050513 addi x10,x10,0
|
||||
80000120: 00100073 ebreak
|
||||
80000124: 0000006f jal x0,80000124 <_trm_init+0x1c>
|
||||
@ -0,0 +1,132 @@
|
||||
|
||||
elf/am-tests/movsx: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 1a8000ef jal x1,800001b4 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 184000ef jal x1,800001a8 <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fe010113 addi x2,x2,-32
|
||||
8000002c: 00813823 sd x8,16(x2)
|
||||
80000030: 00000417 auipc x8,0x0
|
||||
80000034: 1b040413 addi x8,x8,432 # 800001e0 <A>
|
||||
80000038: 00042023 sw x0,0(x8)
|
||||
8000003c: 00100793 addi x15,x0,1
|
||||
80000040: 00f42223 sw x15,4(x8)
|
||||
80000044: 00200793 addi x15,x0,2
|
||||
80000048: 00f42423 sw x15,8(x8)
|
||||
8000004c: 00300793 addi x15,x0,3
|
||||
80000050: 00f42623 sw x15,12(x8)
|
||||
80000054: 00400793 addi x15,x0,4
|
||||
80000058: 00f42823 sw x15,16(x8)
|
||||
8000005c: 00c42783 lw x15,12(x8)
|
||||
80000060: 00913423 sd x9,8(x2)
|
||||
80000064: 00000497 auipc x9,0x0
|
||||
80000068: 1a448493 addi x9,x9,420 # 80000208 <C>
|
||||
8000006c: 00000717 auipc x14,0x0
|
||||
80000070: 1af72423 sw x15,424(x14) # 80000214 <b>
|
||||
80000074: 00000797 auipc x15,0x0
|
||||
80000078: 1a07a783 lw x15,416(x15) # 80000214 <b>
|
||||
8000007c: 00f42a23 sw x15,20(x8)
|
||||
80000080: 06100793 addi x15,x0,97
|
||||
80000084: 00f48023 sb x15,0(x9)
|
||||
80000088: 0004c503 lbu x10,0(x9)
|
||||
8000008c: 00113c23 sd x1,24(x2)
|
||||
80000090: 0185151b slliw x10,x10,0x18
|
||||
80000094: 4185551b sraiw x10,x10,0x18
|
||||
80000098: f9f50513 addi x10,x10,-97
|
||||
8000009c: 00153513 sltiu x10,x10,1
|
||||
800000a0: f71ff0ef jal x1,80000010 <check>
|
||||
800000a4: 0004c783 lbu x15,0(x9)
|
||||
800000a8: 0187979b slliw x15,x15,0x18
|
||||
800000ac: 4187d79b sraiw x15,x15,0x18
|
||||
800000b0: 00f480a3 sb x15,1(x9)
|
||||
800000b4: 0014c503 lbu x10,1(x9)
|
||||
800000b8: 0185151b slliw x10,x10,0x18
|
||||
800000bc: 4185551b sraiw x10,x10,0x18
|
||||
800000c0: f9f50513 addi x10,x10,-97
|
||||
800000c4: 00153513 sltiu x10,x10,1
|
||||
800000c8: f49ff0ef jal x1,80000010 <check>
|
||||
800000cc: 0004c783 lbu x15,0(x9)
|
||||
800000d0: 0187979b slliw x15,x15,0x18
|
||||
800000d4: 4187d79b sraiw x15,x15,0x18
|
||||
800000d8: 00f42023 sw x15,0(x8)
|
||||
800000dc: 00042503 lw x10,0(x8)
|
||||
800000e0: f9f50513 addi x10,x10,-97
|
||||
800000e4: 00153513 sltiu x10,x10,1
|
||||
800000e8: f29ff0ef jal x1,80000010 <check>
|
||||
800000ec: f8000793 addi x15,x0,-128
|
||||
800000f0: 00f480a3 sb x15,1(x9)
|
||||
800000f4: 0014c783 lbu x15,1(x9)
|
||||
800000f8: 0187979b slliw x15,x15,0x18
|
||||
800000fc: 4187d79b sraiw x15,x15,0x18
|
||||
80000100: 00f42023 sw x15,0(x8)
|
||||
80000104: 00442503 lw x10,4(x8)
|
||||
80000108: fff50513 addi x10,x10,-1
|
||||
8000010c: 00153513 sltiu x10,x10,1
|
||||
80000110: f01ff0ef jal x1,80000010 <check>
|
||||
80000114: 00842503 lw x10,8(x8)
|
||||
80000118: ffe50513 addi x10,x10,-2
|
||||
8000011c: 00153513 sltiu x10,x10,1
|
||||
80000120: ef1ff0ef jal x1,80000010 <check>
|
||||
80000124: 00c42503 lw x10,12(x8)
|
||||
80000128: ffd50513 addi x10,x10,-3
|
||||
8000012c: 00153513 sltiu x10,x10,1
|
||||
80000130: ee1ff0ef jal x1,80000010 <check>
|
||||
80000134: 01042503 lw x10,16(x8)
|
||||
80000138: ffc50513 addi x10,x10,-4
|
||||
8000013c: 00153513 sltiu x10,x10,1
|
||||
80000140: ed1ff0ef jal x1,80000010 <check>
|
||||
80000144: 00000517 auipc x10,0x0
|
||||
80000148: 0d052503 lw x10,208(x10) # 80000214 <b>
|
||||
8000014c: ffd50513 addi x10,x10,-3
|
||||
80000150: 00153513 sltiu x10,x10,1
|
||||
80000154: ebdff0ef jal x1,80000010 <check>
|
||||
80000158: 01442503 lw x10,20(x8)
|
||||
8000015c: ffd50513 addi x10,x10,-3
|
||||
80000160: 00153513 sltiu x10,x10,1
|
||||
80000164: eadff0ef jal x1,80000010 <check>
|
||||
80000168: 0014c503 lbu x10,1(x9)
|
||||
8000016c: 0185151b slliw x10,x10,0x18
|
||||
80000170: 4185551b sraiw x10,x10,0x18
|
||||
80000174: 08050513 addi x10,x10,128
|
||||
80000178: 00153513 sltiu x10,x10,1
|
||||
8000017c: e95ff0ef jal x1,80000010 <check>
|
||||
80000180: 00042503 lw x10,0(x8)
|
||||
80000184: 08050513 addi x10,x10,128
|
||||
80000188: 00153513 sltiu x10,x10,1
|
||||
8000018c: e85ff0ef jal x1,80000010 <check>
|
||||
80000190: 01813083 ld x1,24(x2)
|
||||
80000194: 01013403 ld x8,16(x2)
|
||||
80000198: 00813483 ld x9,8(x2)
|
||||
8000019c: 00000513 addi x10,x0,0
|
||||
800001a0: 02010113 addi x2,x2,32
|
||||
800001a4: 00008067 jalr x0,0(x1)
|
||||
|
||||
00000000800001a8 <halt>:
|
||||
800001a8: 00050513 addi x10,x10,0
|
||||
800001ac: 00100073 ebreak
|
||||
800001b0: 0000006f jal x0,800001b0 <halt+0x8>
|
||||
|
||||
00000000800001b4 <_trm_init>:
|
||||
800001b4: ff010113 addi x2,x2,-16
|
||||
800001b8: 00000517 auipc x10,0x0
|
||||
800001bc: 02050513 addi x10,x10,32 # 800001d8 <mainargs>
|
||||
800001c0: 00113423 sd x1,8(x2)
|
||||
800001c4: e65ff0ef jal x1,80000028 <main>
|
||||
800001c8: 00050513 addi x10,x10,0
|
||||
800001cc: 00100073 ebreak
|
||||
800001d0: 0000006f jal x0,800001d0 <_trm_init+0x1c>
|
||||
@ -0,0 +1,102 @@
|
||||
|
||||
elf/am-tests/mul-longlong: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 130000ef jal x1,8000013c <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 10c000ef jal x1,80000130 <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fa010113 addi x2,x2,-96
|
||||
8000002c: 04913423 sd x9,72(x2)
|
||||
80000030: 05213023 sd x18,64(x2)
|
||||
80000034: 03313c23 sd x19,56(x2)
|
||||
80000038: 03413823 sd x20,48(x2)
|
||||
8000003c: 03513423 sd x21,40(x2)
|
||||
80000040: 03613023 sd x22,32(x2)
|
||||
80000044: 01813823 sd x24,16(x2)
|
||||
80000048: 00000493 addi x9,x0,0
|
||||
8000004c: 04113c23 sd x1,88(x2)
|
||||
80000050: 04813823 sd x8,80(x2)
|
||||
80000054: 01713c23 sd x23,24(x2)
|
||||
80000058: 01913423 sd x25,8(x2)
|
||||
8000005c: 00400913 addi x18,x0,4
|
||||
80000060: 00000a17 auipc x20,0x0
|
||||
80000064: 158a0a13 addi x20,x20,344 # 800001b8 <test_data>
|
||||
80000068: 00000993 addi x19,x0,0
|
||||
8000006c: 00000b17 auipc x22,0x0
|
||||
80000070: 0fcb0b13 addi x22,x22,252 # 80000168 <ans>
|
||||
80000074: 00300a93 addi x21,x0,3
|
||||
80000078: 00048c1b addiw x24,x9,0
|
||||
8000007c: 07248463 beq x9,x18,800000e4 <main+0xbc>
|
||||
80000080: 000a2783 lw x15,0(x20)
|
||||
80000084: 00399413 slli x8,x19,0x3
|
||||
80000088: 008b0433 add x8,x22,x8
|
||||
8000008c: 00078b93 addi x23,x15,0
|
||||
80000090: 000a0c93 addi x25,x20,0
|
||||
80000094: 037787b3 mul x15,x15,x23
|
||||
80000098: 00043503 ld x10,0(x8)
|
||||
8000009c: 001c0c1b addiw x24,x24,1
|
||||
800000a0: 004c8c93 addi x25,x25,4
|
||||
800000a4: 00840413 addi x8,x8,8
|
||||
800000a8: 40f50533 sub x10,x10,x15
|
||||
800000ac: 00153513 sltiu x10,x10,1
|
||||
800000b0: f61ff0ef jal x1,80000010 <check>
|
||||
800000b4: 012c0663 beq x24,x18,800000c0 <main+0x98>
|
||||
800000b8: 000ca783 lw x15,0(x25)
|
||||
800000bc: fd9ff06f jal x0,80000094 <main+0x6c>
|
||||
800000c0: 0049899b addiw x19,x19,4
|
||||
800000c4: 00100513 addi x10,x0,1
|
||||
800000c8: 409989bb subw x19,x19,x9
|
||||
800000cc: f45ff0ef jal x1,80000010 <check>
|
||||
800000d0: 03548063 beq x9,x21,800000f0 <main+0xc8>
|
||||
800000d4: 0014849b addiw x9,x9,1
|
||||
800000d8: 004a0a13 addi x20,x20,4
|
||||
800000dc: 00048c1b addiw x24,x9,0
|
||||
800000e0: fb2490e3 bne x9,x18,80000080 <main+0x58>
|
||||
800000e4: 00100513 addi x10,x0,1
|
||||
800000e8: f29ff0ef jal x1,80000010 <check>
|
||||
800000ec: fe9ff06f jal x0,800000d4 <main+0xac>
|
||||
800000f0: 00100513 addi x10,x0,1
|
||||
800000f4: f1dff0ef jal x1,80000010 <check>
|
||||
800000f8: 05813083 ld x1,88(x2)
|
||||
800000fc: 05013403 ld x8,80(x2)
|
||||
80000100: 04813483 ld x9,72(x2)
|
||||
80000104: 04013903 ld x18,64(x2)
|
||||
80000108: 03813983 ld x19,56(x2)
|
||||
8000010c: 03013a03 ld x20,48(x2)
|
||||
80000110: 02813a83 ld x21,40(x2)
|
||||
80000114: 02013b03 ld x22,32(x2)
|
||||
80000118: 01813b83 ld x23,24(x2)
|
||||
8000011c: 01013c03 ld x24,16(x2)
|
||||
80000120: 00813c83 ld x25,8(x2)
|
||||
80000124: 00000513 addi x10,x0,0
|
||||
80000128: 06010113 addi x2,x2,96
|
||||
8000012c: 00008067 jalr x0,0(x1)
|
||||
|
||||
0000000080000130 <halt>:
|
||||
80000130: 00050513 addi x10,x10,0
|
||||
80000134: 00100073 ebreak
|
||||
80000138: 0000006f jal x0,80000138 <halt+0x8>
|
||||
|
||||
000000008000013c <_trm_init>:
|
||||
8000013c: ff010113 addi x2,x2,-16
|
||||
80000140: 00000517 auipc x10,0x0
|
||||
80000144: 02050513 addi x10,x10,32 # 80000160 <mainargs>
|
||||
80000148: 00113423 sd x1,8(x2)
|
||||
8000014c: eddff0ef jal x1,80000028 <main>
|
||||
80000150: 00050513 addi x10,x10,0
|
||||
80000154: 00100073 ebreak
|
||||
80000158: 0000006f jal x0,80000158 <_trm_init+0x1c>
|
||||
@ -0,0 +1,92 @@
|
||||
|
||||
elf/am-tests/pascal: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 108000ef jal x1,80000114 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 0e4000ef jal x1,80000108 <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: 00100793 addi x15,x0,1
|
||||
8000002c: fe010113 addi x2,x2,-32
|
||||
80000030: 02079793 slli x15,x15,0x20
|
||||
80000034: 00113c23 sd x1,24(x2)
|
||||
80000038: 00813823 sd x8,16(x2)
|
||||
8000003c: 00913423 sd x9,8(x2)
|
||||
80000040: 01213023 sd x18,0(x2)
|
||||
80000044: 00000897 auipc x17,0x0
|
||||
80000048: 17c88893 addi x17,x17,380 # 800001c0 <a>
|
||||
8000004c: 00178793 addi x15,x15,1
|
||||
80000050: 00f8b023 sd x15,0(x17)
|
||||
80000054: 00000597 auipc x11,0x0
|
||||
80000058: 17458593 addi x11,x11,372 # 800001c8 <a+0x8>
|
||||
8000005c: 00000817 auipc x16,0x0
|
||||
80000060: 1e080813 addi x16,x16,480 # 8000023c <a+0x7c>
|
||||
80000064: 00100713 addi x14,x0,1
|
||||
80000068: 00100513 addi x10,x0,1
|
||||
8000006c: 00000417 auipc x8,0x0
|
||||
80000070: 15840413 addi x8,x8,344 # 800001c4 <a+0x4>
|
||||
80000074: 00040793 addi x15,x8,0
|
||||
80000078: 00100693 addi x13,x0,1
|
||||
8000007c: 0080006f jal x0,80000084 <main+0x5c>
|
||||
80000080: 0007a703 lw x14,0(x15)
|
||||
80000084: 00d7063b addw x12,x14,x13
|
||||
80000088: 00c7a023 sw x12,0(x15)
|
||||
8000008c: 00478793 addi x15,x15,4
|
||||
80000090: 00070693 addi x13,x14,0
|
||||
80000094: feb796e3 bne x15,x11,80000080 <main+0x58>
|
||||
80000098: 00a7a023 sw x10,0(x15)
|
||||
8000009c: 00478593 addi x11,x15,4
|
||||
800000a0: 01058663 beq x11,x16,800000ac <main+0x84>
|
||||
800000a4: 0048a703 lw x14,4(x17)
|
||||
800000a8: fc5ff06f jal x0,8000006c <main+0x44>
|
||||
800000ac: 00000497 auipc x9,0x0
|
||||
800000b0: 09448493 addi x9,x9,148 # 80000140 <ans>
|
||||
800000b4: 00000917 auipc x18,0x0
|
||||
800000b8: 10890913 addi x18,x18,264 # 800001bc <ans+0x7c>
|
||||
800000bc: 00100793 addi x15,x0,1
|
||||
800000c0: 00c0006f jal x0,800000cc <main+0xa4>
|
||||
800000c4: 00042783 lw x15,0(x8)
|
||||
800000c8: 00440413 addi x8,x8,4
|
||||
800000cc: 0004a503 lw x10,0(x9)
|
||||
800000d0: 00448493 addi x9,x9,4
|
||||
800000d4: 40f50533 sub x10,x10,x15
|
||||
800000d8: 00153513 sltiu x10,x10,1
|
||||
800000dc: f35ff0ef jal x1,80000010 <check>
|
||||
800000e0: fe9912e3 bne x18,x9,800000c4 <main+0x9c>
|
||||
800000e4: 00100513 addi x10,x0,1
|
||||
800000e8: f29ff0ef jal x1,80000010 <check>
|
||||
800000ec: 01813083 ld x1,24(x2)
|
||||
800000f0: 01013403 ld x8,16(x2)
|
||||
800000f4: 00813483 ld x9,8(x2)
|
||||
800000f8: 00013903 ld x18,0(x2)
|
||||
800000fc: 00000513 addi x10,x0,0
|
||||
80000100: 02010113 addi x2,x2,32
|
||||
80000104: 00008067 jalr x0,0(x1)
|
||||
|
||||
0000000080000108 <halt>:
|
||||
80000108: 00050513 addi x10,x10,0
|
||||
8000010c: 00100073 ebreak
|
||||
80000110: 0000006f jal x0,80000110 <halt+0x8>
|
||||
|
||||
0000000080000114 <_trm_init>:
|
||||
80000114: ff010113 addi x2,x2,-16
|
||||
80000118: 00000517 auipc x10,0x0
|
||||
8000011c: 02050513 addi x10,x10,32 # 80000138 <mainargs>
|
||||
80000120: 00113423 sd x1,8(x2)
|
||||
80000124: f05ff0ef jal x1,80000028 <main>
|
||||
80000128: 00050513 addi x10,x10,0
|
||||
8000012c: 00100073 ebreak
|
||||
80000130: 0000006f jal x0,80000130 <_trm_init+0x1c>
|
||||
@ -0,0 +1,72 @@
|
||||
|
||||
elf/am-tests/prime: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 0b8000ef jal x1,800000c4 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 094000ef jal x1,800000b8 <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fd010113 addi x2,x2,-48
|
||||
8000002c: 02813023 sd x8,32(x2)
|
||||
80000030: 00913c23 sd x9,24(x2)
|
||||
80000034: 01213823 sd x18,16(x2)
|
||||
80000038: 01313423 sd x19,8(x2)
|
||||
8000003c: 02113423 sd x1,40(x2)
|
||||
80000040: 00000493 addi x9,x0,0
|
||||
80000044: 06500413 addi x8,x0,101
|
||||
80000048: 00000997 auipc x19,0x0
|
||||
8000004c: 0a898993 addi x19,x19,168 # 800000f0 <ans>
|
||||
80000050: 09700913 addi x18,x0,151
|
||||
80000054: 00200793 addi x15,x0,2
|
||||
80000058: 02f4673b remw x14,x8,x15
|
||||
8000005c: 0017879b addiw x15,x15,1
|
||||
80000060: 02070263 beq x14,x0,80000084 <main+0x5c>
|
||||
80000064: fe879ae3 bne x15,x8,80000058 <main+0x30>
|
||||
80000068: 00249793 slli x15,x9,0x2
|
||||
8000006c: 00f987b3 add x15,x19,x15
|
||||
80000070: 0007a503 lw x10,0(x15)
|
||||
80000074: 0014849b addiw x9,x9,1
|
||||
80000078: 40850533 sub x10,x10,x8
|
||||
8000007c: 00153513 sltiu x10,x10,1
|
||||
80000080: f91ff0ef jal x1,80000010 <check>
|
||||
80000084: 0024041b addiw x8,x8,2
|
||||
80000088: fd2416e3 bne x8,x18,80000054 <main+0x2c>
|
||||
8000008c: ff648513 addi x10,x9,-10
|
||||
80000090: 00153513 sltiu x10,x10,1
|
||||
80000094: f7dff0ef jal x1,80000010 <check>
|
||||
80000098: 02813083 ld x1,40(x2)
|
||||
8000009c: 02013403 ld x8,32(x2)
|
||||
800000a0: 01813483 ld x9,24(x2)
|
||||
800000a4: 01013903 ld x18,16(x2)
|
||||
800000a8: 00813983 ld x19,8(x2)
|
||||
800000ac: 00000513 addi x10,x0,0
|
||||
800000b0: 03010113 addi x2,x2,48
|
||||
800000b4: 00008067 jalr x0,0(x1)
|
||||
|
||||
00000000800000b8 <halt>:
|
||||
800000b8: 00050513 addi x10,x10,0
|
||||
800000bc: 00100073 ebreak
|
||||
800000c0: 0000006f jal x0,800000c0 <halt+0x8>
|
||||
|
||||
00000000800000c4 <_trm_init>:
|
||||
800000c4: ff010113 addi x2,x2,-16
|
||||
800000c8: 00000517 auipc x10,0x0
|
||||
800000cc: 02050513 addi x10,x10,32 # 800000e8 <mainargs>
|
||||
800000d0: 00113423 sd x1,8(x2)
|
||||
800000d4: f55ff0ef jal x1,80000028 <main>
|
||||
800000d8: 00050513 addi x10,x10,0
|
||||
800000dc: 00100073 ebreak
|
||||
800000e0: 0000006f jal x0,800000e0 <_trm_init+0x1c>
|
||||
@ -0,0 +1,264 @@
|
||||
|
||||
elf/am-tests/quick-sort: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 3a8000ef jal x1,800003b4 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 384000ef jal x1,800003a8 <halt>
|
||||
|
||||
0000000080000028 <partition>:
|
||||
80000028: 00259813 slli x16,x11,0x2
|
||||
8000002c: 010506b3 add x13,x10,x16
|
||||
80000030: 00050313 addi x6,x10,0
|
||||
80000034: 0006a883 lw x17,0(x13)
|
||||
80000038: 00060513 addi x10,x12,0
|
||||
8000003c: 08c5d863 bge x11,x12,800000cc <partition+0xa4>
|
||||
80000040: 00261793 slli x15,x12,0x2
|
||||
80000044: 00f307b3 add x15,x6,x15
|
||||
80000048: 0007a783 lw x15,0(x15)
|
||||
8000004c: fff50693 addi x13,x10,-1
|
||||
80000050: 00269693 slli x13,x13,0x2
|
||||
80000054: 00d306b3 add x13,x6,x13
|
||||
80000058: 00068713 addi x14,x13,0
|
||||
8000005c: 02f8d663 bge x17,x15,80000088 <partition+0x60>
|
||||
80000060: fff5051b addiw x10,x10,-1
|
||||
80000064: 00072783 lw x15,0(x14)
|
||||
80000068: ffc70693 addi x13,x14,-4
|
||||
8000006c: fea5c6e3 blt x11,x10,80000058 <partition+0x30>
|
||||
80000070: 010306b3 add x13,x6,x16
|
||||
80000074: 00f6a023 sw x15,0(x13)
|
||||
80000078: 00058513 addi x10,x11,0
|
||||
8000007c: 00f72023 sw x15,0(x14)
|
||||
80000080: 0116a023 sw x17,0(x13)
|
||||
80000084: 00008067 jalr x0,0(x1)
|
||||
80000088: 010306b3 add x13,x6,x16
|
||||
8000008c: 00251713 slli x14,x10,0x2
|
||||
80000090: 00f6a023 sw x15,0(x13)
|
||||
80000094: 00e30733 add x14,x6,x14
|
||||
80000098: 04a5d063 bge x11,x10,800000d8 <partition+0xb0>
|
||||
8000009c: 00480613 addi x12,x16,4
|
||||
800000a0: 00c30633 add x12,x6,x12
|
||||
800000a4: 0015859b addiw x11,x11,1
|
||||
800000a8: 00062783 lw x15,0(x12)
|
||||
800000ac: 00060693 addi x13,x12,0
|
||||
800000b0: 00460613 addi x12,x12,4
|
||||
800000b4: fca584e3 beq x11,x10,8000007c <partition+0x54>
|
||||
800000b8: fef8d6e3 bge x17,x15,800000a4 <partition+0x7c>
|
||||
800000bc: 00f72023 sw x15,0(x14)
|
||||
800000c0: 02a5d063 bge x11,x10,800000e0 <partition+0xb8>
|
||||
800000c4: 00259813 slli x16,x11,0x2
|
||||
800000c8: f85ff06f jal x0,8000004c <partition+0x24>
|
||||
800000cc: 00058513 addi x10,x11,0
|
||||
800000d0: 0116a023 sw x17,0(x13)
|
||||
800000d4: 00008067 jalr x0,0(x1)
|
||||
800000d8: 00058513 addi x10,x11,0
|
||||
800000dc: fa1ff06f jal x0,8000007c <partition+0x54>
|
||||
800000e0: 00259693 slli x13,x11,0x2
|
||||
800000e4: 00d306b3 add x13,x6,x13
|
||||
800000e8: 00058513 addi x10,x11,0
|
||||
800000ec: f95ff06f jal x0,80000080 <partition+0x58>
|
||||
|
||||
00000000800000f0 <quick_sort>:
|
||||
800000f0: 1ec5da63 bge x11,x12,800002e4 <quick_sort+0x1f4>
|
||||
800000f4: f5010113 addi x2,x2,-176
|
||||
800000f8: 0a813023 sd x8,160(x2)
|
||||
800000fc: 07513c23 sd x21,120(x2)
|
||||
80000100: 07713423 sd x23,104(x2)
|
||||
80000104: 0a113423 sd x1,168(x2)
|
||||
80000108: 08913c23 sd x9,152(x2)
|
||||
8000010c: 09213823 sd x18,144(x2)
|
||||
80000110: 09313423 sd x19,136(x2)
|
||||
80000114: 09413023 sd x20,128(x2)
|
||||
80000118: 07613823 sd x22,112(x2)
|
||||
8000011c: 07813023 sd x24,96(x2)
|
||||
80000120: 05913c23 sd x25,88(x2)
|
||||
80000124: 05a13823 sd x26,80(x2)
|
||||
80000128: 05b13423 sd x27,72(x2)
|
||||
8000012c: 00058b93 addi x23,x11,0
|
||||
80000130: 00060a93 addi x21,x12,0
|
||||
80000134: 00050413 addi x8,x10,0
|
||||
80000138: 000a8613 addi x12,x21,0
|
||||
8000013c: 000b8593 addi x11,x23,0
|
||||
80000140: 00040513 addi x10,x8,0
|
||||
80000144: ee5ff0ef jal x1,80000028 <partition>
|
||||
80000148: 00a13423 sd x10,8(x2)
|
||||
8000014c: fff50c9b addiw x25,x10,-1
|
||||
80000150: 159bd663 bge x23,x25,8000029c <quick_sort+0x1ac>
|
||||
80000154: 000c8613 addi x12,x25,0
|
||||
80000158: 000b8593 addi x11,x23,0
|
||||
8000015c: 00040513 addi x10,x8,0
|
||||
80000160: ec9ff0ef jal x1,80000028 <partition>
|
||||
80000164: 00a13823 sd x10,16(x2)
|
||||
80000168: fff50d1b addiw x26,x10,-1
|
||||
8000016c: 13abd263 bge x23,x26,80000290 <quick_sort+0x1a0>
|
||||
80000170: 000d0613 addi x12,x26,0
|
||||
80000174: 000b8593 addi x11,x23,0
|
||||
80000178: 00040513 addi x10,x8,0
|
||||
8000017c: eadff0ef jal x1,80000028 <partition>
|
||||
80000180: 00a13c23 sd x10,24(x2)
|
||||
80000184: fff50d9b addiw x27,x10,-1
|
||||
80000188: 0fbbde63 bge x23,x27,80000284 <quick_sort+0x194>
|
||||
8000018c: 000d8613 addi x12,x27,0
|
||||
80000190: 000b8593 addi x11,x23,0
|
||||
80000194: 00040513 addi x10,x8,0
|
||||
80000198: e91ff0ef jal x1,80000028 <partition>
|
||||
8000019c: 02a13023 sd x10,32(x2)
|
||||
800001a0: fff5099b addiw x19,x10,-1
|
||||
800001a4: 0d3bda63 bge x23,x19,80000278 <quick_sort+0x188>
|
||||
800001a8: 00098613 addi x12,x19,0
|
||||
800001ac: 000b8593 addi x11,x23,0
|
||||
800001b0: 00040513 addi x10,x8,0
|
||||
800001b4: e75ff0ef jal x1,80000028 <partition>
|
||||
800001b8: fff5091b addiw x18,x10,-1
|
||||
800001bc: 00050493 addi x9,x10,0
|
||||
800001c0: 0b2bd863 bge x23,x18,80000270 <quick_sort+0x180>
|
||||
800001c4: 00090613 addi x12,x18,0
|
||||
800001c8: 000b8593 addi x11,x23,0
|
||||
800001cc: 00040513 addi x10,x8,0
|
||||
800001d0: e59ff0ef jal x1,80000028 <partition>
|
||||
800001d4: fff50b1b addiw x22,x10,-1
|
||||
800001d8: 00050a13 addi x20,x10,0
|
||||
800001dc: 096bd663 bge x23,x22,80000268 <quick_sort+0x178>
|
||||
800001e0: 000b0613 addi x12,x22,0
|
||||
800001e4: 000b8593 addi x11,x23,0
|
||||
800001e8: 00040513 addi x10,x8,0
|
||||
800001ec: e3dff0ef jal x1,80000028 <partition>
|
||||
800001f0: 02a13423 sd x10,40(x2)
|
||||
800001f4: fff50c1b addiw x24,x10,-1
|
||||
800001f8: 078bd263 bge x23,x24,8000025c <quick_sort+0x16c>
|
||||
800001fc: 000c0613 addi x12,x24,0
|
||||
80000200: 000b8593 addi x11,x23,0
|
||||
80000204: 00040513 addi x10,x8,0
|
||||
80000208: e21ff0ef jal x1,80000028 <partition>
|
||||
8000020c: fff5081b addiw x16,x10,-1
|
||||
80000210: 00050713 addi x14,x10,0
|
||||
80000214: 050bd063 bge x23,x16,80000254 <quick_sort+0x164>
|
||||
80000218: 00080613 addi x12,x16,0
|
||||
8000021c: 000b8593 addi x11,x23,0
|
||||
80000220: 00040513 addi x10,x8,0
|
||||
80000224: 02e13c23 sd x14,56(x2)
|
||||
80000228: 03013823 sd x16,48(x2)
|
||||
8000022c: dfdff0ef jal x1,80000028 <partition>
|
||||
80000230: 00050893 addi x17,x10,0
|
||||
80000234: 000b8593 addi x11,x23,0
|
||||
80000238: fff5061b addiw x12,x10,-1
|
||||
8000023c: 00040513 addi x10,x8,0
|
||||
80000240: 00188b9b addiw x23,x17,1
|
||||
80000244: eadff0ef jal x1,800000f0 <quick_sort>
|
||||
80000248: 03013803 ld x16,48(x2)
|
||||
8000024c: 03813703 ld x14,56(x2)
|
||||
80000250: fd0bc4e3 blt x23,x16,80000218 <quick_sort+0x128>
|
||||
80000254: 00170b9b addiw x23,x14,1
|
||||
80000258: fb8bc2e3 blt x23,x24,800001fc <quick_sort+0x10c>
|
||||
8000025c: 02813783 ld x15,40(x2)
|
||||
80000260: 00178b9b addiw x23,x15,1
|
||||
80000264: f76bcee3 blt x23,x22,800001e0 <quick_sort+0xf0>
|
||||
80000268: 001a0b9b addiw x23,x20,1
|
||||
8000026c: f52bcce3 blt x23,x18,800001c4 <quick_sort+0xd4>
|
||||
80000270: 00148b9b addiw x23,x9,1
|
||||
80000274: f33bcae3 blt x23,x19,800001a8 <quick_sort+0xb8>
|
||||
80000278: 02013783 ld x15,32(x2)
|
||||
8000027c: 00178b9b addiw x23,x15,1
|
||||
80000280: f1bbc6e3 blt x23,x27,8000018c <quick_sort+0x9c>
|
||||
80000284: 01813783 ld x15,24(x2)
|
||||
80000288: 00178b9b addiw x23,x15,1
|
||||
8000028c: efabc2e3 blt x23,x26,80000170 <quick_sort+0x80>
|
||||
80000290: 01013783 ld x15,16(x2)
|
||||
80000294: 00178b9b addiw x23,x15,1
|
||||
80000298: eb9bcee3 blt x23,x25,80000154 <quick_sort+0x64>
|
||||
8000029c: 00813783 ld x15,8(x2)
|
||||
800002a0: 00178b9b addiw x23,x15,1
|
||||
800002a4: e95bcae3 blt x23,x21,80000138 <quick_sort+0x48>
|
||||
800002a8: 0a813083 ld x1,168(x2)
|
||||
800002ac: 0a013403 ld x8,160(x2)
|
||||
800002b0: 09813483 ld x9,152(x2)
|
||||
800002b4: 09013903 ld x18,144(x2)
|
||||
800002b8: 08813983 ld x19,136(x2)
|
||||
800002bc: 08013a03 ld x20,128(x2)
|
||||
800002c0: 07813a83 ld x21,120(x2)
|
||||
800002c4: 07013b03 ld x22,112(x2)
|
||||
800002c8: 06813b83 ld x23,104(x2)
|
||||
800002cc: 06013c03 ld x24,96(x2)
|
||||
800002d0: 05813c83 ld x25,88(x2)
|
||||
800002d4: 05013d03 ld x26,80(x2)
|
||||
800002d8: 04813d83 ld x27,72(x2)
|
||||
800002dc: 0b010113 addi x2,x2,176
|
||||
800002e0: 00008067 jalr x0,0(x1)
|
||||
800002e4: 00008067 jalr x0,0(x1)
|
||||
|
||||
00000000800002e8 <main>:
|
||||
800002e8: fd010113 addi x2,x2,-48
|
||||
800002ec: 00000517 auipc x10,0x0
|
||||
800002f0: 0f450513 addi x10,x10,244 # 800003e0 <a>
|
||||
800002f4: 00913c23 sd x9,24(x2)
|
||||
800002f8: 01300613 addi x12,x0,19
|
||||
800002fc: 00050493 addi x9,x10,0
|
||||
80000300: 00000593 addi x11,x0,0
|
||||
80000304: 02813023 sd x8,32(x2)
|
||||
80000308: 01213823 sd x18,16(x2)
|
||||
8000030c: 01313423 sd x19,8(x2)
|
||||
80000310: 02113423 sd x1,40(x2)
|
||||
80000314: 00048913 addi x18,x9,0
|
||||
80000318: dd9ff0ef jal x1,800000f0 <quick_sort>
|
||||
8000031c: 00000413 addi x8,x0,0
|
||||
80000320: 01400993 addi x19,x0,20
|
||||
80000324: 00092503 lw x10,0(x18)
|
||||
80000328: 00490913 addi x18,x18,4
|
||||
8000032c: 40850533 sub x10,x10,x8
|
||||
80000330: 00153513 sltiu x10,x10,1
|
||||
80000334: 0014041b addiw x8,x8,1
|
||||
80000338: cd9ff0ef jal x1,80000010 <check>
|
||||
8000033c: ff3414e3 bne x8,x19,80000324 <main+0x3c>
|
||||
80000340: 00100513 addi x10,x0,1
|
||||
80000344: ccdff0ef jal x1,80000010 <check>
|
||||
80000348: 01300613 addi x12,x0,19
|
||||
8000034c: 00000593 addi x11,x0,0
|
||||
80000350: 00000517 auipc x10,0x0
|
||||
80000354: 09050513 addi x10,x10,144 # 800003e0 <a>
|
||||
80000358: d99ff0ef jal x1,800000f0 <quick_sort>
|
||||
8000035c: 00000413 addi x8,x0,0
|
||||
80000360: 01400913 addi x18,x0,20
|
||||
80000364: 0004a503 lw x10,0(x9)
|
||||
80000368: 00448493 addi x9,x9,4
|
||||
8000036c: 40850533 sub x10,x10,x8
|
||||
80000370: 00153513 sltiu x10,x10,1
|
||||
80000374: 0014041b addiw x8,x8,1
|
||||
80000378: c99ff0ef jal x1,80000010 <check>
|
||||
8000037c: ff2414e3 bne x8,x18,80000364 <main+0x7c>
|
||||
80000380: 00100513 addi x10,x0,1
|
||||
80000384: c8dff0ef jal x1,80000010 <check>
|
||||
80000388: 02813083 ld x1,40(x2)
|
||||
8000038c: 02013403 ld x8,32(x2)
|
||||
80000390: 01813483 ld x9,24(x2)
|
||||
80000394: 01013903 ld x18,16(x2)
|
||||
80000398: 00813983 ld x19,8(x2)
|
||||
8000039c: 00000513 addi x10,x0,0
|
||||
800003a0: 03010113 addi x2,x2,48
|
||||
800003a4: 00008067 jalr x0,0(x1)
|
||||
|
||||
00000000800003a8 <halt>:
|
||||
800003a8: 00050513 addi x10,x10,0
|
||||
800003ac: 00100073 ebreak
|
||||
800003b0: 0000006f jal x0,800003b0 <halt+0x8>
|
||||
|
||||
00000000800003b4 <_trm_init>:
|
||||
800003b4: ff010113 addi x2,x2,-16
|
||||
800003b8: 00000517 auipc x10,0x0
|
||||
800003bc: 02050513 addi x10,x10,32 # 800003d8 <mainargs>
|
||||
800003c0: 00113423 sd x1,8(x2)
|
||||
800003c4: f25ff0ef jal x1,800002e8 <main>
|
||||
800003c8: 00050513 addi x10,x10,0
|
||||
800003cc: 00100073 ebreak
|
||||
800003d0: 0000006f jal x0,800003d0 <_trm_init+0x1c>
|
||||
@ -0,0 +1,180 @@
|
||||
|
||||
elf/am-tests/recursion: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 248000ef jal x1,80000254 <_trm_init>
|
||||
|
||||
0000000080000010 <f0>:
|
||||
80000010: 00000797 auipc x15,0x0
|
||||
80000014: 2a078793 addi x15,x15,672 # 800002b0 <lvl>
|
||||
80000018: 0007a703 lw x14,0(x15)
|
||||
8000001c: 00b75463 bge x14,x11,80000024 <f0+0x14>
|
||||
80000020: 00b7a023 sw x11,0(x15)
|
||||
80000024: 00000717 auipc x14,0x0
|
||||
80000028: 29070713 addi x14,x14,656 # 800002b4 <rec>
|
||||
8000002c: 00072783 lw x15,0(x14)
|
||||
80000030: 0017879b addiw x15,x15,1
|
||||
80000034: 00f72023 sw x15,0(x14)
|
||||
80000038: 00a05e63 bge x0,x10,80000054 <f0+0x44>
|
||||
8000003c: 00300793 addi x15,x0,3
|
||||
80000040: 02f5453b divw x10,x10,x15
|
||||
80000044: 0015859b addiw x11,x11,1
|
||||
80000048: 00000797 auipc x15,0x0
|
||||
8000004c: 2607b783 ld x15,608(x15) # 800002a8 <func+0x18>
|
||||
80000050: 00078067 jalr x0,0(x15)
|
||||
80000054: 00100513 addi x10,x0,1
|
||||
80000058: 00008067 jalr x0,0(x1)
|
||||
|
||||
000000008000005c <f1>:
|
||||
8000005c: 00000797 auipc x15,0x0
|
||||
80000060: 25478793 addi x15,x15,596 # 800002b0 <lvl>
|
||||
80000064: 0007a703 lw x14,0(x15)
|
||||
80000068: 00b75463 bge x14,x11,80000070 <f1+0x14>
|
||||
8000006c: 00b7a023 sw x11,0(x15)
|
||||
80000070: 00000717 auipc x14,0x0
|
||||
80000074: 24470713 addi x14,x14,580 # 800002b4 <rec>
|
||||
80000078: 00072783 lw x15,0(x14)
|
||||
8000007c: 0017879b addiw x15,x15,1
|
||||
80000080: 00f72023 sw x15,0(x14)
|
||||
80000084: 00a05c63 bge x0,x10,8000009c <f1+0x40>
|
||||
80000088: 0015859b addiw x11,x11,1
|
||||
8000008c: fff5051b addiw x10,x10,-1
|
||||
80000090: 00000797 auipc x15,0x0
|
||||
80000094: 2007b783 ld x15,512(x15) # 80000290 <func>
|
||||
80000098: 00078067 jalr x0,0(x15)
|
||||
8000009c: 00100513 addi x10,x0,1
|
||||
800000a0: 00008067 jalr x0,0(x1)
|
||||
|
||||
00000000800000a4 <f2>:
|
||||
800000a4: 00000717 auipc x14,0x0
|
||||
800000a8: 20c70713 addi x14,x14,524 # 800002b0 <lvl>
|
||||
800000ac: 00072683 lw x13,0(x14)
|
||||
800000b0: 00050793 addi x15,x10,0
|
||||
800000b4: 00b6d463 bge x13,x11,800000bc <f2+0x18>
|
||||
800000b8: 00b72023 sw x11,0(x14)
|
||||
800000bc: 00000697 auipc x13,0x0
|
||||
800000c0: 1f868693 addi x13,x13,504 # 800002b4 <rec>
|
||||
800000c4: 0006a703 lw x14,0(x13)
|
||||
800000c8: 00100513 addi x10,x0,1
|
||||
800000cc: 0017071b addiw x14,x14,1
|
||||
800000d0: 00e6a023 sw x14,0(x13)
|
||||
800000d4: 02f05863 bge x0,x15,80000104 <f2+0x60>
|
||||
800000d8: ff010113 addi x2,x2,-16
|
||||
800000dc: 00113423 sd x1,8(x2)
|
||||
800000e0: 00078513 addi x10,x15,0
|
||||
800000e4: 0015859b addiw x11,x11,1
|
||||
800000e8: 00000797 auipc x15,0x0
|
||||
800000ec: 1b07b783 ld x15,432(x15) # 80000298 <func+0x8>
|
||||
800000f0: 000780e7 jalr x1,0(x15)
|
||||
800000f4: 00813083 ld x1,8(x2)
|
||||
800000f8: 0095051b addiw x10,x10,9
|
||||
800000fc: 01010113 addi x2,x2,16
|
||||
80000100: 00008067 jalr x0,0(x1)
|
||||
80000104: 00008067 jalr x0,0(x1)
|
||||
|
||||
0000000080000108 <f3>:
|
||||
80000108: 00000717 auipc x14,0x0
|
||||
8000010c: 1a870713 addi x14,x14,424 # 800002b0 <lvl>
|
||||
80000110: 00072683 lw x13,0(x14)
|
||||
80000114: 00050793 addi x15,x10,0
|
||||
80000118: 00b6d463 bge x13,x11,80000120 <f3+0x18>
|
||||
8000011c: 00b72023 sw x11,0(x14)
|
||||
80000120: 00000697 auipc x13,0x0
|
||||
80000124: 19468693 addi x13,x13,404 # 800002b4 <rec>
|
||||
80000128: 0006a703 lw x14,0(x13)
|
||||
8000012c: 00100513 addi x10,x0,1
|
||||
80000130: 0017071b addiw x14,x14,1
|
||||
80000134: 00e6a023 sw x14,0(x13)
|
||||
80000138: 06f05a63 bge x0,x15,800001ac <f3+0xa4>
|
||||
8000013c: fe010113 addi x2,x2,-32
|
||||
80000140: 01213023 sd x18,0(x2)
|
||||
80000144: 00000917 auipc x18,0x0
|
||||
80000148: 14c90913 addi x18,x18,332 # 80000290 <func>
|
||||
8000014c: 01093703 ld x14,16(x18)
|
||||
80000150: 00813823 sd x8,16(x2)
|
||||
80000154: 00913423 sd x9,8(x2)
|
||||
80000158: 0015841b addiw x8,x11,1
|
||||
8000015c: 4017d493 srai x9,x15,0x1
|
||||
80000160: 00113c23 sd x1,24(x2)
|
||||
80000164: 00040593 addi x11,x8,0
|
||||
80000168: 00048513 addi x10,x9,0
|
||||
8000016c: 000700e7 jalr x1,0(x14)
|
||||
80000170: 01093783 ld x15,16(x18)
|
||||
80000174: 00040593 addi x11,x8,0
|
||||
80000178: 00050913 addi x18,x10,0
|
||||
8000017c: 00048513 addi x10,x9,0
|
||||
80000180: 000780e7 jalr x1,0(x15)
|
||||
80000184: 01813083 ld x1,24(x2)
|
||||
80000188: 01013403 ld x8,16(x2)
|
||||
8000018c: 0019179b slliw x15,x18,0x1
|
||||
80000190: 012787bb addw x15,x15,x18
|
||||
80000194: 0015151b slliw x10,x10,0x1
|
||||
80000198: 00813483 ld x9,8(x2)
|
||||
8000019c: 00013903 ld x18,0(x2)
|
||||
800001a0: 00a7853b addw x10,x15,x10
|
||||
800001a4: 02010113 addi x2,x2,32
|
||||
800001a8: 00008067 jalr x0,0(x1)
|
||||
800001ac: 00008067 jalr x0,0(x1)
|
||||
|
||||
00000000800001b0 <check>:
|
||||
800001b0: 00050463 beq x10,x0,800001b8 <check+0x8>
|
||||
800001b4: 00008067 jalr x0,0(x1)
|
||||
800001b8: ff010113 addi x2,x2,-16
|
||||
800001bc: 00100513 addi x10,x0,1
|
||||
800001c0: 00113423 sd x1,8(x2)
|
||||
800001c4: 084000ef jal x1,80000248 <halt>
|
||||
|
||||
00000000800001c8 <main>:
|
||||
800001c8: ff010113 addi x2,x2,-16
|
||||
800001cc: 00004537 lui x10,0x4
|
||||
800001d0: 00113423 sd x1,8(x2)
|
||||
800001d4: 00813023 sd x8,0(x2)
|
||||
800001d8: 00000593 addi x11,x0,0
|
||||
800001dc: 00000797 auipc x15,0x0
|
||||
800001e0: 0b47b783 ld x15,180(x15) # 80000290 <func>
|
||||
800001e4: 82350513 addi x10,x10,-2013 # 3823 <_entry_offset+0x3823>
|
||||
800001e8: 000780e7 jalr x1,0(x15)
|
||||
800001ec: 00000417 auipc x8,0x0
|
||||
800001f0: 09440413 addi x8,x8,148 # 80000280 <ans>
|
||||
800001f4: 00042783 lw x15,0(x8)
|
||||
800001f8: 40a78533 sub x10,x15,x10
|
||||
800001fc: 00153513 sltiu x10,x10,1
|
||||
80000200: fb1ff0ef jal x1,800001b0 <check>
|
||||
80000204: 00442503 lw x10,4(x8)
|
||||
80000208: 00000797 auipc x15,0x0
|
||||
8000020c: 0ac7a783 lw x15,172(x15) # 800002b4 <rec>
|
||||
80000210: 40f50533 sub x10,x10,x15
|
||||
80000214: 00153513 sltiu x10,x10,1
|
||||
80000218: f99ff0ef jal x1,800001b0 <check>
|
||||
8000021c: 00842503 lw x10,8(x8)
|
||||
80000220: 00000797 auipc x15,0x0
|
||||
80000224: 0907a783 lw x15,144(x15) # 800002b0 <lvl>
|
||||
80000228: 40f50533 sub x10,x10,x15
|
||||
8000022c: 00153513 sltiu x10,x10,1
|
||||
80000230: f81ff0ef jal x1,800001b0 <check>
|
||||
80000234: 00813083 ld x1,8(x2)
|
||||
80000238: 00013403 ld x8,0(x2)
|
||||
8000023c: 00000513 addi x10,x0,0
|
||||
80000240: 01010113 addi x2,x2,16
|
||||
80000244: 00008067 jalr x0,0(x1)
|
||||
|
||||
0000000080000248 <halt>:
|
||||
80000248: 00050513 addi x10,x10,0
|
||||
8000024c: 00100073 ebreak
|
||||
80000250: 0000006f jal x0,80000250 <halt+0x8>
|
||||
|
||||
0000000080000254 <_trm_init>:
|
||||
80000254: ff010113 addi x2,x2,-16
|
||||
80000258: 00000517 auipc x10,0x0
|
||||
8000025c: 02050513 addi x10,x10,32 # 80000278 <mainargs>
|
||||
80000260: 00113423 sd x1,8(x2)
|
||||
80000264: f65ff0ef jal x1,800001c8 <main>
|
||||
80000268: 00050513 addi x10,x10,0
|
||||
8000026c: 00100073 ebreak
|
||||
80000270: 0000006f jal x0,80000270 <_trm_init+0x1c>
|
||||
@ -0,0 +1,106 @@
|
||||
|
||||
elf/am-tests/select-sort: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 138000ef jal x1,80000144 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 114000ef jal x1,80000138 <halt>
|
||||
|
||||
0000000080000028 <select_sort>:
|
||||
80000028: 00000897 auipc x17,0x0
|
||||
8000002c: 14c88893 addi x17,x17,332 # 80000174 <a+0x4>
|
||||
80000030: 00000813 addi x16,x0,0
|
||||
80000034: 00000e97 auipc x29,0x0
|
||||
80000038: 13ce8e93 addi x29,x29,316 # 80000170 <a>
|
||||
8000003c: 01400513 addi x10,x0,20
|
||||
80000040: 01300e13 addi x28,x0,19
|
||||
80000044: ffc8a303 lw x6,-4(x17)
|
||||
80000048: 00080593 addi x11,x16,0
|
||||
8000004c: 0018081b addiw x16,x16,1
|
||||
80000050: 00088713 addi x14,x17,0
|
||||
80000054: 00030613 addi x12,x6,0
|
||||
80000058: 00080793 addi x15,x16,0
|
||||
8000005c: 00072683 lw x13,0(x14)
|
||||
80000060: 00470713 addi x14,x14,4
|
||||
80000064: 00c6d663 bge x13,x12,80000070 <select_sort+0x48>
|
||||
80000068: 00078593 addi x11,x15,0
|
||||
8000006c: 00068613 addi x12,x13,0
|
||||
80000070: 0017879b addiw x15,x15,1
|
||||
80000074: fea794e3 bne x15,x10,8000005c <select_sort+0x34>
|
||||
80000078: 00259593 slli x11,x11,0x2
|
||||
8000007c: fec8ae23 sw x12,-4(x17)
|
||||
80000080: 00be85b3 add x11,x29,x11
|
||||
80000084: 0065a023 sw x6,0(x11)
|
||||
80000088: 00488893 addi x17,x17,4
|
||||
8000008c: fbc81ce3 bne x16,x28,80000044 <select_sort+0x1c>
|
||||
80000090: 00008067 jalr x0,0(x1)
|
||||
|
||||
0000000080000094 <main>:
|
||||
80000094: fd010113 addi x2,x2,-48
|
||||
80000098: 00913c23 sd x9,24(x2)
|
||||
8000009c: 00000497 auipc x9,0x0
|
||||
800000a0: 0d448493 addi x9,x9,212 # 80000170 <a>
|
||||
800000a4: 02813023 sd x8,32(x2)
|
||||
800000a8: 01213823 sd x18,16(x2)
|
||||
800000ac: 01313423 sd x19,8(x2)
|
||||
800000b0: 02113423 sd x1,40(x2)
|
||||
800000b4: 00048913 addi x18,x9,0
|
||||
800000b8: f71ff0ef jal x1,80000028 <select_sort>
|
||||
800000bc: 00000413 addi x8,x0,0
|
||||
800000c0: 01400993 addi x19,x0,20
|
||||
800000c4: 00092503 lw x10,0(x18)
|
||||
800000c8: 00490913 addi x18,x18,4
|
||||
800000cc: 40850533 sub x10,x10,x8
|
||||
800000d0: 00153513 sltiu x10,x10,1
|
||||
800000d4: 0014041b addiw x8,x8,1
|
||||
800000d8: f39ff0ef jal x1,80000010 <check>
|
||||
800000dc: ff3414e3 bne x8,x19,800000c4 <main+0x30>
|
||||
800000e0: 00100513 addi x10,x0,1
|
||||
800000e4: f2dff0ef jal x1,80000010 <check>
|
||||
800000e8: 00000413 addi x8,x0,0
|
||||
800000ec: f3dff0ef jal x1,80000028 <select_sort>
|
||||
800000f0: 01400913 addi x18,x0,20
|
||||
800000f4: 0004a503 lw x10,0(x9)
|
||||
800000f8: 00448493 addi x9,x9,4
|
||||
800000fc: 40850533 sub x10,x10,x8
|
||||
80000100: 00153513 sltiu x10,x10,1
|
||||
80000104: 0014041b addiw x8,x8,1
|
||||
80000108: f09ff0ef jal x1,80000010 <check>
|
||||
8000010c: ff2414e3 bne x8,x18,800000f4 <main+0x60>
|
||||
80000110: 00100513 addi x10,x0,1
|
||||
80000114: efdff0ef jal x1,80000010 <check>
|
||||
80000118: 02813083 ld x1,40(x2)
|
||||
8000011c: 02013403 ld x8,32(x2)
|
||||
80000120: 01813483 ld x9,24(x2)
|
||||
80000124: 01013903 ld x18,16(x2)
|
||||
80000128: 00813983 ld x19,8(x2)
|
||||
8000012c: 00000513 addi x10,x0,0
|
||||
80000130: 03010113 addi x2,x2,48
|
||||
80000134: 00008067 jalr x0,0(x1)
|
||||
|
||||
0000000080000138 <halt>:
|
||||
80000138: 00050513 addi x10,x10,0
|
||||
8000013c: 00100073 ebreak
|
||||
80000140: 0000006f jal x0,80000140 <halt+0x8>
|
||||
|
||||
0000000080000144 <_trm_init>:
|
||||
80000144: ff010113 addi x2,x2,-16
|
||||
80000148: 00000517 auipc x10,0x0
|
||||
8000014c: 02050513 addi x10,x10,32 # 80000168 <mainargs>
|
||||
80000150: 00113423 sd x1,8(x2)
|
||||
80000154: f41ff0ef jal x1,80000094 <main>
|
||||
80000158: 00050513 addi x10,x10,0
|
||||
8000015c: 00100073 ebreak
|
||||
80000160: 0000006f jal x0,80000160 <_trm_init+0x1c>
|
||||
@ -0,0 +1,98 @@
|
||||
|
||||
elf/am-tests/shift: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 120000ef jal x1,8000012c <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 0fc000ef jal x1,80000120 <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fd010113 addi x2,x2,-48
|
||||
8000002c: 00913c23 sd x9,24(x2)
|
||||
80000030: 00000497 auipc x9,0x0
|
||||
80000034: 18848493 addi x9,x9,392 # 800001b8 <test>
|
||||
80000038: 02813023 sd x8,32(x2)
|
||||
8000003c: 01213823 sd x18,16(x2)
|
||||
80000040: 01313423 sd x19,8(x2)
|
||||
80000044: 02113423 sd x1,40(x2)
|
||||
80000048: 01413023 sd x20,0(x2)
|
||||
8000004c: 00000917 auipc x18,0x0
|
||||
80000050: 12c90913 addi x18,x18,300 # 80000178 <srl_ans>
|
||||
80000054: 00000997 auipc x19,0x0
|
||||
80000058: 18498993 addi x19,x19,388 # 800001d8 <_bss_start>
|
||||
8000005c: 00048413 addi x8,x9,0
|
||||
80000060: 00042503 lw x10,0(x8)
|
||||
80000064: 00092783 lw x15,0(x18)
|
||||
80000068: 00440413 addi x8,x8,4
|
||||
8000006c: 0075551b srliw x10,x10,0x7
|
||||
80000070: 40f50533 sub x10,x10,x15
|
||||
80000074: 00153513 sltiu x10,x10,1
|
||||
80000078: f99ff0ef jal x1,80000010 <check>
|
||||
8000007c: 00490913 addi x18,x18,4
|
||||
80000080: ff3410e3 bne x8,x19,80000060 <main+0x38>
|
||||
80000084: 00000997 auipc x19,0x0
|
||||
80000088: 0d498993 addi x19,x19,212 # 80000158 <srav_ans>
|
||||
8000008c: 00000917 auipc x18,0x0
|
||||
80000090: 12c90913 addi x18,x18,300 # 800001b8 <test>
|
||||
80000094: 00400413 addi x8,x0,4
|
||||
80000098: 00c00a13 addi x20,x0,12
|
||||
8000009c: 00092503 lw x10,0(x18)
|
||||
800000a0: 0009a783 lw x15,0(x19)
|
||||
800000a4: 00490913 addi x18,x18,4
|
||||
800000a8: 4085553b sraw x10,x10,x8
|
||||
800000ac: 40f50533 sub x10,x10,x15
|
||||
800000b0: 00153513 sltiu x10,x10,1
|
||||
800000b4: 0014041b addiw x8,x8,1
|
||||
800000b8: f59ff0ef jal x1,80000010 <check>
|
||||
800000bc: 00498993 addi x19,x19,4
|
||||
800000c0: fd441ee3 bne x8,x20,8000009c <main+0x74>
|
||||
800000c4: 00000917 auipc x18,0x0
|
||||
800000c8: 0d490913 addi x18,x18,212 # 80000198 <srlv_ans>
|
||||
800000cc: 00400413 addi x8,x0,4
|
||||
800000d0: 00c00993 addi x19,x0,12
|
||||
800000d4: 0004a503 lw x10,0(x9)
|
||||
800000d8: 00092783 lw x15,0(x18)
|
||||
800000dc: 00448493 addi x9,x9,4
|
||||
800000e0: 0085553b srlw x10,x10,x8
|
||||
800000e4: 40f50533 sub x10,x10,x15
|
||||
800000e8: 00153513 sltiu x10,x10,1
|
||||
800000ec: 0014041b addiw x8,x8,1
|
||||
800000f0: f21ff0ef jal x1,80000010 <check>
|
||||
800000f4: 00490913 addi x18,x18,4
|
||||
800000f8: fd341ee3 bne x8,x19,800000d4 <main+0xac>
|
||||
800000fc: 02813083 ld x1,40(x2)
|
||||
80000100: 02013403 ld x8,32(x2)
|
||||
80000104: 01813483 ld x9,24(x2)
|
||||
80000108: 01013903 ld x18,16(x2)
|
||||
8000010c: 00813983 ld x19,8(x2)
|
||||
80000110: 00013a03 ld x20,0(x2)
|
||||
80000114: 00000513 addi x10,x0,0
|
||||
80000118: 03010113 addi x2,x2,48
|
||||
8000011c: 00008067 jalr x0,0(x1)
|
||||
|
||||
0000000080000120 <halt>:
|
||||
80000120: 00050513 addi x10,x10,0
|
||||
80000124: 00100073 ebreak
|
||||
80000128: 0000006f jal x0,80000128 <halt+0x8>
|
||||
|
||||
000000008000012c <_trm_init>:
|
||||
8000012c: ff010113 addi x2,x2,-16
|
||||
80000130: 00000517 auipc x10,0x0
|
||||
80000134: 02050513 addi x10,x10,32 # 80000150 <mainargs>
|
||||
80000138: 00113423 sd x1,8(x2)
|
||||
8000013c: eedff0ef jal x1,80000028 <main>
|
||||
80000140: 00050513 addi x10,x10,0
|
||||
80000144: 00100073 ebreak
|
||||
80000148: 0000006f jal x0,80000148 <_trm_init+0x1c>
|
||||
@ -0,0 +1,90 @@
|
||||
|
||||
elf/am-tests/shuixianhua: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 100000ef jal x1,8000010c <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 0dc000ef jal x1,80000100 <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fc010113 addi x2,x2,-64
|
||||
8000002c: 02813823 sd x8,48(x2)
|
||||
80000030: 02913423 sd x9,40(x2)
|
||||
80000034: 03213023 sd x18,32(x2)
|
||||
80000038: 01313c23 sd x19,24(x2)
|
||||
8000003c: 01413823 sd x20,16(x2)
|
||||
80000040: 01513423 sd x21,8(x2)
|
||||
80000044: 02113c23 sd x1,56(x2)
|
||||
80000048: 06400413 addi x8,x0,100
|
||||
8000004c: 00000a93 addi x21,x0,0
|
||||
80000050: 1f400993 addi x19,x0,500
|
||||
80000054: 06400a13 addi x20,x0,100
|
||||
80000058: 00a00913 addi x18,x0,10
|
||||
8000005c: 00000497 auipc x9,0x0
|
||||
80000060: 0dc48493 addi x9,x9,220 # 80000138 <ans>
|
||||
80000064: 0014041b addiw x8,x8,1
|
||||
80000068: 00040793 addi x15,x8,0
|
||||
8000006c: 07340063 beq x8,x19,800000cc <main+0xa4>
|
||||
80000070: 0327c6bb divw x13,x15,x18
|
||||
80000074: 0347c53b divw x10,x15,x20
|
||||
80000078: 0326e6bb remw x13,x13,x18
|
||||
8000007c: 0327e7bb remw x15,x15,x18
|
||||
80000080: 02d6873b mulw x14,x13,x13
|
||||
80000084: 02a505bb mulw x11,x10,x10
|
||||
80000088: 02f7863b mulw x12,x15,x15
|
||||
8000008c: 02d7073b mulw x14,x14,x13
|
||||
80000090: 02a585bb mulw x11,x11,x10
|
||||
80000094: 02f606bb mulw x13,x12,x15
|
||||
80000098: 00b707bb addw x15,x14,x11
|
||||
8000009c: 00d787bb addw x15,x15,x13
|
||||
800000a0: fc8792e3 bne x15,x8,80000064 <main+0x3c>
|
||||
800000a4: 002a9793 slli x15,x21,0x2
|
||||
800000a8: 00f487b3 add x15,x9,x15
|
||||
800000ac: 0007a503 lw x10,0(x15)
|
||||
800000b0: 001a8a9b addiw x21,x21,1
|
||||
800000b4: 40850533 sub x10,x10,x8
|
||||
800000b8: 00153513 sltiu x10,x10,1
|
||||
800000bc: f55ff0ef jal x1,80000010 <check>
|
||||
800000c0: 0014041b addiw x8,x8,1
|
||||
800000c4: 00040793 addi x15,x8,0
|
||||
800000c8: fb3414e3 bne x8,x19,80000070 <main+0x48>
|
||||
800000cc: ffca8513 addi x10,x21,-4
|
||||
800000d0: 00153513 sltiu x10,x10,1
|
||||
800000d4: f3dff0ef jal x1,80000010 <check>
|
||||
800000d8: 03813083 ld x1,56(x2)
|
||||
800000dc: 03013403 ld x8,48(x2)
|
||||
800000e0: 02813483 ld x9,40(x2)
|
||||
800000e4: 02013903 ld x18,32(x2)
|
||||
800000e8: 01813983 ld x19,24(x2)
|
||||
800000ec: 01013a03 ld x20,16(x2)
|
||||
800000f0: 00813a83 ld x21,8(x2)
|
||||
800000f4: 00000513 addi x10,x0,0
|
||||
800000f8: 04010113 addi x2,x2,64
|
||||
800000fc: 00008067 jalr x0,0(x1)
|
||||
|
||||
0000000080000100 <halt>:
|
||||
80000100: 00050513 addi x10,x10,0
|
||||
80000104: 00100073 ebreak
|
||||
80000108: 0000006f jal x0,80000108 <halt+0x8>
|
||||
|
||||
000000008000010c <_trm_init>:
|
||||
8000010c: ff010113 addi x2,x2,-16
|
||||
80000110: 00000517 auipc x10,0x0
|
||||
80000114: 02050513 addi x10,x10,32 # 80000130 <mainargs>
|
||||
80000118: 00113423 sd x1,8(x2)
|
||||
8000011c: f0dff0ef jal x1,80000028 <main>
|
||||
80000120: 00050513 addi x10,x10,0
|
||||
80000124: 00100073 ebreak
|
||||
80000128: 0000006f jal x0,80000128 <_trm_init+0x1c>
|
||||
@ -0,0 +1,85 @@
|
||||
|
||||
elf/am-tests/sub-longlong: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 0ec000ef jal x1,800000f8 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 0c8000ef jal x1,800000ec <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fb010113 addi x2,x2,-80
|
||||
8000002c: 01713423 sd x23,8(x2)
|
||||
80000030: 00000b97 auipc x23,0x0
|
||||
80000034: 2f0b8b93 addi x23,x23,752 # 80000320 <test_data>
|
||||
80000038: 03313423 sd x19,40(x2)
|
||||
8000003c: 03413023 sd x20,32(x2)
|
||||
80000040: 01513c23 sd x21,24(x2)
|
||||
80000044: 01613823 sd x22,16(x2)
|
||||
80000048: 01813023 sd x24,0(x2)
|
||||
8000004c: 04113423 sd x1,72(x2)
|
||||
80000050: 04813023 sd x8,64(x2)
|
||||
80000054: 02913c23 sd x9,56(x2)
|
||||
80000058: 03213823 sd x18,48(x2)
|
||||
8000005c: 00000b17 auipc x22,0x0
|
||||
80000060: 0c4b0b13 addi x22,x22,196 # 80000120 <ans>
|
||||
80000064: 000b8a93 addi x21,x23,0
|
||||
80000068: 00000a13 addi x20,x0,0
|
||||
8000006c: 00000997 auipc x19,0x0
|
||||
80000070: 2f498993 addi x19,x19,756 # 80000360 <_bss_start>
|
||||
80000074: 04000c13 addi x24,x0,64
|
||||
80000078: 000ab903 ld x18,0(x21)
|
||||
8000007c: 000b0493 addi x9,x22,0
|
||||
80000080: 000b8413 addi x8,x23,0
|
||||
80000084: 00043503 ld x10,0(x8)
|
||||
80000088: 0004b783 ld x15,0(x9)
|
||||
8000008c: 00840413 addi x8,x8,8
|
||||
80000090: 40a90533 sub x10,x18,x10
|
||||
80000094: 40f50533 sub x10,x10,x15
|
||||
80000098: 00153513 sltiu x10,x10,1
|
||||
8000009c: f75ff0ef jal x1,80000010 <check>
|
||||
800000a0: 00848493 addi x9,x9,8
|
||||
800000a4: fe8990e3 bne x19,x8,80000084 <main+0x5c>
|
||||
800000a8: 008a0a1b addiw x20,x20,8
|
||||
800000ac: 008a8a93 addi x21,x21,8
|
||||
800000b0: 040b0b13 addi x22,x22,64
|
||||
800000b4: fd8a12e3 bne x20,x24,80000078 <main+0x50>
|
||||
800000b8: 04813083 ld x1,72(x2)
|
||||
800000bc: 04013403 ld x8,64(x2)
|
||||
800000c0: 03813483 ld x9,56(x2)
|
||||
800000c4: 03013903 ld x18,48(x2)
|
||||
800000c8: 02813983 ld x19,40(x2)
|
||||
800000cc: 02013a03 ld x20,32(x2)
|
||||
800000d0: 01813a83 ld x21,24(x2)
|
||||
800000d4: 01013b03 ld x22,16(x2)
|
||||
800000d8: 00813b83 ld x23,8(x2)
|
||||
800000dc: 00013c03 ld x24,0(x2)
|
||||
800000e0: 00000513 addi x10,x0,0
|
||||
800000e4: 05010113 addi x2,x2,80
|
||||
800000e8: 00008067 jalr x0,0(x1)
|
||||
|
||||
00000000800000ec <halt>:
|
||||
800000ec: 00050513 addi x10,x10,0
|
||||
800000f0: 00100073 ebreak
|
||||
800000f4: 0000006f jal x0,800000f4 <halt+0x8>
|
||||
|
||||
00000000800000f8 <_trm_init>:
|
||||
800000f8: ff010113 addi x2,x2,-16
|
||||
800000fc: 00000517 auipc x10,0x0
|
||||
80000100: 01c50513 addi x10,x10,28 # 80000118 <_etext>
|
||||
80000104: 00113423 sd x1,8(x2)
|
||||
80000108: f21ff0ef jal x1,80000028 <main>
|
||||
8000010c: 00050513 addi x10,x10,0
|
||||
80000110: 00100073 ebreak
|
||||
80000114: 0000006f jal x0,80000114 <_trm_init+0x1c>
|
||||
@ -0,0 +1,56 @@
|
||||
|
||||
elf/am-tests/sum: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 078000ef jal x1,80000084 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 054000ef jal x1,80000078 <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fe010113 addi x2,x2,-32
|
||||
8000002c: 00113c23 sd x1,24(x2)
|
||||
80000030: 00012623 sw x0,12(x2)
|
||||
80000034: 00100793 addi x15,x0,1
|
||||
80000038: 06500693 addi x13,x0,101
|
||||
8000003c: 00c12703 lw x14,12(x2)
|
||||
80000040: 00f7073b addw x14,x14,x15
|
||||
80000044: 00e12623 sw x14,12(x2)
|
||||
80000048: 0017879b addiw x15,x15,1
|
||||
8000004c: fed798e3 bne x15,x13,8000003c <main+0x14>
|
||||
80000050: 00c12503 lw x10,12(x2)
|
||||
80000054: 000017b7 lui x15,0x1
|
||||
80000058: 3ba78793 addi x15,x15,954 # 13ba <_entry_offset+0x13ba>
|
||||
8000005c: 40f50533 sub x10,x10,x15
|
||||
80000060: 00153513 sltiu x10,x10,1
|
||||
80000064: fadff0ef jal x1,80000010 <check>
|
||||
80000068: 01813083 ld x1,24(x2)
|
||||
8000006c: 00000513 addi x10,x0,0
|
||||
80000070: 02010113 addi x2,x2,32
|
||||
80000074: 00008067 jalr x0,0(x1)
|
||||
|
||||
0000000080000078 <halt>:
|
||||
80000078: 00050513 addi x10,x10,0
|
||||
8000007c: 00100073 ebreak
|
||||
80000080: 0000006f jal x0,80000080 <halt+0x8>
|
||||
|
||||
0000000080000084 <_trm_init>:
|
||||
80000084: ff010113 addi x2,x2,-16
|
||||
80000088: 00000517 auipc x10,0x0
|
||||
8000008c: 02050513 addi x10,x10,32 # 800000a8 <mainargs>
|
||||
80000090: 00113423 sd x1,8(x2)
|
||||
80000094: f95ff0ef jal x1,80000028 <main>
|
||||
80000098: 00050513 addi x10,x10,0
|
||||
8000009c: 00100073 ebreak
|
||||
800000a0: 0000006f jal x0,800000a0 <_trm_init+0x1c>
|
||||
@ -0,0 +1,75 @@
|
||||
|
||||
elf/am-tests/switch: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 0c4000ef jal x1,800000d0 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 0a0000ef jal x1,800000c4 <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fd010113 addi x2,x2,-48
|
||||
8000002c: 02813023 sd x8,32(x2)
|
||||
80000030: 00913c23 sd x9,24(x2)
|
||||
80000034: 01213823 sd x18,16(x2)
|
||||
80000038: 01313423 sd x19,8(x2)
|
||||
8000003c: 01413023 sd x20,0(x2)
|
||||
80000040: 02113423 sd x1,40(x2)
|
||||
80000044: 00000417 auipc x8,0x0
|
||||
80000048: 0ec40413 addi x8,x8,236 # 80000130 <ans>
|
||||
8000004c: 00000917 auipc x18,0x0
|
||||
80000050: 0a490913 addi x18,x18,164 # 800000f0 <_etext>
|
||||
80000054: 00000997 auipc x19,0x0
|
||||
80000058: 11498993 addi x19,x19,276 # 80000168 <ans+0x38>
|
||||
8000005c: 00000493 addi x9,x0,0
|
||||
80000060: fff00793 addi x15,x0,-1
|
||||
80000064: 00c00a13 addi x20,x0,12
|
||||
80000068: 01c0006f jal x0,80000084 <main+0x5c>
|
||||
8000006c: fff00793 addi x15,x0,-1
|
||||
80000070: 009a6463 bltu x20,x9,80000078 <main+0x50>
|
||||
80000074: 00092783 lw x15,0(x18)
|
||||
80000078: 0014849b addiw x9,x9,1
|
||||
8000007c: 00440413 addi x8,x8,4
|
||||
80000080: 00490913 addi x18,x18,4
|
||||
80000084: 00042503 lw x10,0(x8)
|
||||
80000088: 40f50533 sub x10,x10,x15
|
||||
8000008c: 00153513 sltiu x10,x10,1
|
||||
80000090: f81ff0ef jal x1,80000010 <check>
|
||||
80000094: fd341ce3 bne x8,x19,8000006c <main+0x44>
|
||||
80000098: 00100513 addi x10,x0,1
|
||||
8000009c: f75ff0ef jal x1,80000010 <check>
|
||||
800000a0: 02813083 ld x1,40(x2)
|
||||
800000a4: 02013403 ld x8,32(x2)
|
||||
800000a8: 01813483 ld x9,24(x2)
|
||||
800000ac: 01013903 ld x18,16(x2)
|
||||
800000b0: 00813983 ld x19,8(x2)
|
||||
800000b4: 00013a03 ld x20,0(x2)
|
||||
800000b8: 00000513 addi x10,x0,0
|
||||
800000bc: 03010113 addi x2,x2,48
|
||||
800000c0: 00008067 jalr x0,0(x1)
|
||||
|
||||
00000000800000c4 <halt>:
|
||||
800000c4: 00050513 addi x10,x10,0
|
||||
800000c8: 00100073 ebreak
|
||||
800000cc: 0000006f jal x0,800000cc <halt+0x8>
|
||||
|
||||
00000000800000d0 <_trm_init>:
|
||||
800000d0: ff010113 addi x2,x2,-16
|
||||
800000d4: 00000517 auipc x10,0x0
|
||||
800000d8: 05450513 addi x10,x10,84 # 80000128 <mainargs>
|
||||
800000dc: 00113423 sd x1,8(x2)
|
||||
800000e0: f49ff0ef jal x1,80000028 <main>
|
||||
800000e4: 00050513 addi x10,x10,0
|
||||
800000e8: 00100073 ebreak
|
||||
800000ec: 0000006f jal x0,800000ec <_trm_init+0x1c>
|
||||
@ -0,0 +1,70 @@
|
||||
|
||||
elf/am-tests/to-lower-case: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 0b0000ef jal x1,800000bc <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 08c000ef jal x1,800000b0 <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fd010113 addi x2,x2,-48
|
||||
8000002c: 02813023 sd x8,32(x2)
|
||||
80000030: 00913c23 sd x9,24(x2)
|
||||
80000034: 01213823 sd x18,16(x2)
|
||||
80000038: 01313423 sd x19,8(x2)
|
||||
8000003c: 02113423 sd x1,40(x2)
|
||||
80000040: 00000413 addi x8,x0,0
|
||||
80000044: 00000793 addi x15,x0,0
|
||||
80000048: 00000917 auipc x18,0x0
|
||||
8000004c: 0a090913 addi x18,x18,160 # 800000e8 <ans>
|
||||
80000050: 08000493 addi x9,x0,128
|
||||
80000054: 01900993 addi x19,x0,25
|
||||
80000058: 00890733 add x14,x18,x8
|
||||
8000005c: 00074503 lbu x10,0(x14)
|
||||
80000060: 0014041b addiw x8,x8,1
|
||||
80000064: 40f50533 sub x10,x10,x15
|
||||
80000068: 00153513 sltiu x10,x10,1
|
||||
8000006c: fa5ff0ef jal x1,80000010 <check>
|
||||
80000070: 0ff47793 andi x15,x8,255
|
||||
80000074: fbf7871b addiw x14,x15,-65
|
||||
80000078: 0ff77713 andi x14,x14,255
|
||||
8000007c: 0207869b addiw x13,x15,32
|
||||
80000080: 00940863 beq x8,x9,80000090 <main+0x68>
|
||||
80000084: fce9eae3 bltu x19,x14,80000058 <main+0x30>
|
||||
80000088: 0ff6f793 andi x15,x13,255
|
||||
8000008c: fcdff06f jal x0,80000058 <main+0x30>
|
||||
80000090: 02813083 ld x1,40(x2)
|
||||
80000094: 02013403 ld x8,32(x2)
|
||||
80000098: 01813483 ld x9,24(x2)
|
||||
8000009c: 01013903 ld x18,16(x2)
|
||||
800000a0: 00813983 ld x19,8(x2)
|
||||
800000a4: 00000513 addi x10,x0,0
|
||||
800000a8: 03010113 addi x2,x2,48
|
||||
800000ac: 00008067 jalr x0,0(x1)
|
||||
|
||||
00000000800000b0 <halt>:
|
||||
800000b0: 00050513 addi x10,x10,0
|
||||
800000b4: 00100073 ebreak
|
||||
800000b8: 0000006f jal x0,800000b8 <halt+0x8>
|
||||
|
||||
00000000800000bc <_trm_init>:
|
||||
800000bc: ff010113 addi x2,x2,-16
|
||||
800000c0: 00000517 auipc x10,0x0
|
||||
800000c4: 02050513 addi x10,x10,32 # 800000e0 <mainargs>
|
||||
800000c8: 00113423 sd x1,8(x2)
|
||||
800000cc: f5dff0ef jal x1,80000028 <main>
|
||||
800000d0: 00050513 addi x10,x10,0
|
||||
800000d4: 00100073 ebreak
|
||||
800000d8: 0000006f jal x0,800000d8 <_trm_init+0x1c>
|
||||
@ -0,0 +1,99 @@
|
||||
|
||||
elf/am-tests/unalign: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 124000ef jal x1,80000130 <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 100000ef jal x1,80000124 <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fb010113 addi x2,x2,-80
|
||||
8000002c: 02913c23 sd x9,56(x2)
|
||||
80000030: aabbd4b7 lui x9,0xaabbd
|
||||
80000034: 04813023 sd x8,64(x2)
|
||||
80000038: 03213823 sd x18,48(x2)
|
||||
8000003c: 03313423 sd x19,40(x2)
|
||||
80000040: 03413023 sd x20,32(x2)
|
||||
80000044: 01513c23 sd x21,24(x2)
|
||||
80000048: 01613823 sd x22,16(x2)
|
||||
8000004c: 01713423 sd x23,8(x2)
|
||||
80000050: 04113423 sd x1,72(x2)
|
||||
80000054: 00400b13 addi x22,x0,4
|
||||
80000058: 00000417 auipc x8,0x0
|
||||
8000005c: 10040413 addi x8,x8,256 # 80000158 <buf>
|
||||
80000060: 00000b97 auipc x23,0x0
|
||||
80000064: 0f4b8b93 addi x23,x23,244 # 80000154 <x>
|
||||
80000068: fdd00a93 addi x21,x0,-35
|
||||
8000006c: fcc00a13 addi x20,x0,-52
|
||||
80000070: fbb00993 addi x19,x0,-69
|
||||
80000074: faa00913 addi x18,x0,-86
|
||||
80000078: cdd48493 addi x9,x9,-803 # ffffffffaabbccdd <_end+0xffffffff2abb3cdd>
|
||||
8000007c: 00344783 lbu x15,3(x8)
|
||||
80000080: 015401a3 sb x21,3(x8)
|
||||
80000084: 00444783 lbu x15,4(x8)
|
||||
80000088: 01440223 sb x20,4(x8)
|
||||
8000008c: 00544783 lbu x15,5(x8)
|
||||
80000090: 013402a3 sb x19,5(x8)
|
||||
80000094: 00644783 lbu x15,6(x8)
|
||||
80000098: 01240323 sb x18,6(x8)
|
||||
8000009c: 00344603 lbu x12,3(x8)
|
||||
800000a0: 00444683 lbu x13,4(x8)
|
||||
800000a4: 00544703 lbu x14,5(x8)
|
||||
800000a8: 00644783 lbu x15,6(x8)
|
||||
800000ac: 00869693 slli x13,x13,0x8
|
||||
800000b0: 00c6e6b3 or x13,x13,x12
|
||||
800000b4: 01071713 slli x14,x14,0x10
|
||||
800000b8: 00d76733 or x14,x14,x13
|
||||
800000bc: 01879793 slli x15,x15,0x18
|
||||
800000c0: 00e7e7b3 or x15,x15,x14
|
||||
800000c4: 0007879b addiw x15,x15,0
|
||||
800000c8: 00fba023 sw x15,0(x23)
|
||||
800000cc: 000ba503 lw x10,0(x23)
|
||||
800000d0: fffb0b1b addiw x22,x22,-1
|
||||
800000d4: 40950533 sub x10,x10,x9
|
||||
800000d8: 00153513 sltiu x10,x10,1
|
||||
800000dc: f35ff0ef jal x1,80000010 <check>
|
||||
800000e0: 00000797 auipc x15,0x0
|
||||
800000e4: 06078ca3 sb x0,121(x15) # 80000159 <buf+0x1>
|
||||
800000e8: 00000797 auipc x15,0x0
|
||||
800000ec: 06078823 sb x0,112(x15) # 80000158 <buf>
|
||||
800000f0: f80b16e3 bne x22,x0,8000007c <main+0x54>
|
||||
800000f4: 04813083 ld x1,72(x2)
|
||||
800000f8: 04013403 ld x8,64(x2)
|
||||
800000fc: 03813483 ld x9,56(x2)
|
||||
80000100: 03013903 ld x18,48(x2)
|
||||
80000104: 02813983 ld x19,40(x2)
|
||||
80000108: 02013a03 ld x20,32(x2)
|
||||
8000010c: 01813a83 ld x21,24(x2)
|
||||
80000110: 01013b03 ld x22,16(x2)
|
||||
80000114: 00813b83 ld x23,8(x2)
|
||||
80000118: 00000513 addi x10,x0,0
|
||||
8000011c: 05010113 addi x2,x2,80
|
||||
80000120: 00008067 jalr x0,0(x1)
|
||||
|
||||
0000000080000124 <halt>:
|
||||
80000124: 00050513 addi x10,x10,0
|
||||
80000128: 00100073 ebreak
|
||||
8000012c: 0000006f jal x0,8000012c <halt+0x8>
|
||||
|
||||
0000000080000130 <_trm_init>:
|
||||
80000130: ff010113 addi x2,x2,-16
|
||||
80000134: 00000517 auipc x10,0x0
|
||||
80000138: 01c50513 addi x10,x10,28 # 80000150 <_etext>
|
||||
8000013c: 00113423 sd x1,8(x2)
|
||||
80000140: ee9ff0ef jal x1,80000028 <main>
|
||||
80000144: 00050513 addi x10,x10,0
|
||||
80000148: 00100073 ebreak
|
||||
8000014c: 0000006f jal x0,8000014c <_trm_init+0x1c>
|
||||
@ -0,0 +1,82 @@
|
||||
|
||||
elf/am-tests/wanshu: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00000413 addi x8,x0,0
|
||||
80000004: 00009117 auipc x2,0x9
|
||||
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
|
||||
8000000c: 0e0000ef jal x1,800000ec <_trm_init>
|
||||
|
||||
0000000080000010 <check>:
|
||||
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
|
||||
80000014: 00008067 jalr x0,0(x1)
|
||||
80000018: ff010113 addi x2,x2,-16
|
||||
8000001c: 00100513 addi x10,x0,1
|
||||
80000020: 00113423 sd x1,8(x2)
|
||||
80000024: 0bc000ef jal x1,800000e0 <halt>
|
||||
|
||||
0000000080000028 <main>:
|
||||
80000028: fd010113 addi x2,x2,-48
|
||||
8000002c: 00100613 addi x12,x0,1
|
||||
80000030: 02813023 sd x8,32(x2)
|
||||
80000034: 00913c23 sd x9,24(x2)
|
||||
80000038: 01213823 sd x18,16(x2)
|
||||
8000003c: 01313423 sd x19,8(x2)
|
||||
80000040: 02113423 sd x1,40(x2)
|
||||
80000044: 01e00493 addi x9,x0,30
|
||||
80000048: 0016041b addiw x8,x12,1
|
||||
8000004c: 00000993 addi x19,x0,0
|
||||
80000050: 00000917 auipc x18,0x0
|
||||
80000054: 0c890913 addi x18,x18,200 # 80000118 <ans>
|
||||
80000058: 02940c63 beq x8,x9,80000090 <main+0x68>
|
||||
8000005c: 00100793 addi x15,x0,1
|
||||
80000060: 00000593 addi x11,x0,0
|
||||
80000064: 02f4673b remw x14,x8,x15
|
||||
80000068: 0017869b addiw x13,x15,1
|
||||
8000006c: 00071463 bne x14,x0,80000074 <main+0x4c>
|
||||
80000070: 00b785bb addw x11,x15,x11
|
||||
80000074: 00c78663 beq x15,x12,80000080 <main+0x58>
|
||||
80000078: 00068793 addi x15,x13,0
|
||||
8000007c: fe9ff06f jal x0,80000064 <main+0x3c>
|
||||
80000080: 02858e63 beq x11,x8,800000bc <main+0x94>
|
||||
80000084: 00040613 addi x12,x8,0
|
||||
80000088: 0016041b addiw x8,x12,1
|
||||
8000008c: fc9418e3 bne x8,x9,8000005c <main+0x34>
|
||||
80000090: ffe98513 addi x10,x19,-2
|
||||
80000094: 00153513 sltiu x10,x10,1
|
||||
80000098: f79ff0ef jal x1,80000010 <check>
|
||||
8000009c: 02813083 ld x1,40(x2)
|
||||
800000a0: 02013403 ld x8,32(x2)
|
||||
800000a4: 01813483 ld x9,24(x2)
|
||||
800000a8: 01013903 ld x18,16(x2)
|
||||
800000ac: 00813983 ld x19,8(x2)
|
||||
800000b0: 00000513 addi x10,x0,0
|
||||
800000b4: 03010113 addi x2,x2,48
|
||||
800000b8: 00008067 jalr x0,0(x1)
|
||||
800000bc: 00299793 slli x15,x19,0x2
|
||||
800000c0: 00f907b3 add x15,x18,x15
|
||||
800000c4: 0007a503 lw x10,0(x15)
|
||||
800000c8: 0019899b addiw x19,x19,1
|
||||
800000cc: 40850533 sub x10,x10,x8
|
||||
800000d0: 00153513 sltiu x10,x10,1
|
||||
800000d4: f3dff0ef jal x1,80000010 <check>
|
||||
800000d8: 00040613 addi x12,x8,0
|
||||
800000dc: fadff06f jal x0,80000088 <main+0x60>
|
||||
|
||||
00000000800000e0 <halt>:
|
||||
800000e0: 00050513 addi x10,x10,0
|
||||
800000e4: 00100073 ebreak
|
||||
800000e8: 0000006f jal x0,800000e8 <halt+0x8>
|
||||
|
||||
00000000800000ec <_trm_init>:
|
||||
800000ec: ff010113 addi x2,x2,-16
|
||||
800000f0: 00000517 auipc x10,0x0
|
||||
800000f4: 02050513 addi x10,x10,32 # 80000110 <mainargs>
|
||||
800000f8: 00113423 sd x1,8(x2)
|
||||
800000fc: f2dff0ef jal x1,80000028 <main>
|
||||
80000100: 00050513 addi x10,x10,0
|
||||
80000104: 00100073 ebreak
|
||||
80000108: 0000006f jal x0,80000108 <_trm_init+0x1c>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,225 @@
|
||||
|
||||
./build/test: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 00200193 addi x3,x0,2
|
||||
80000004: 30102573 csrrs x10,misa,x0
|
||||
80000008: 03e55513 srli x10,x10,0x3e
|
||||
8000000c: 00200393 addi x7,x0,2
|
||||
80000010: 26751463 bne x10,x7,80000278 <fail>
|
||||
|
||||
0000000080000014 <test_3>:
|
||||
80000014: 00300193 addi x3,x0,3
|
||||
80000018: f1402573 csrrs x10,mhartid,x0
|
||||
8000001c: 00000393 addi x7,x0,0
|
||||
80000020: 24751c63 bne x10,x7,80000278 <fail>
|
||||
80000024: f1302573 csrrs x10,mimpid,x0
|
||||
80000028: f1302573 csrrs x10,mimpid,x0
|
||||
8000002c: f1202573 csrrs x10,marchid,x0
|
||||
80000030: f1102573 csrrs x10,mvendorid,x0
|
||||
80000034: 00000293 addi x5,x0,0
|
||||
80000038: 3052a073 csrrs x0,mtvec,x5
|
||||
8000003c: 3412a073 csrrs x0,mepc,x5
|
||||
80000040: 000022b7 lui x5,0x2
|
||||
80000044: 8002829b addiw x5,x5,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000048: 3002b073 csrrc x0,mstatus,x5
|
||||
8000004c: 30002373 csrrs x6,mstatus,x0
|
||||
80000050: 0062f2b3 and x5,x5,x6
|
||||
80000054: 02029463 bne x5,x0,8000007c <test_5>
|
||||
|
||||
0000000080000058 <test_4>:
|
||||
80000058: 00400193 addi x3,x0,4
|
||||
8000005c: 30002573 csrrs x10,mstatus,x0
|
||||
80000060: 0030059b addiw x11,x0,3
|
||||
80000064: 02059593 slli x11,x11,0x20
|
||||
80000068: 00b57533 and x10,x10,x11
|
||||
8000006c: 0010039b addiw x7,x0,1
|
||||
80000070: 02139393 slli x7,x7,0x21
|
||||
80000074: 20751263 bne x10,x7,80000278 <fail>
|
||||
80000078: 0200006f jal x0,80000098 <test_6>
|
||||
|
||||
000000008000007c <test_5>:
|
||||
8000007c: 00500193 addi x3,x0,5
|
||||
80000080: 30002573 csrrs x10,mstatus,x0
|
||||
80000084: 0030059b addiw x11,x0,3
|
||||
80000088: 02059593 slli x11,x11,0x20
|
||||
8000008c: 00b57533 and x10,x10,x11
|
||||
80000090: 00000393 addi x7,x0,0
|
||||
80000094: 1e751263 bne x10,x7,80000278 <fail>
|
||||
|
||||
0000000080000098 <test_6>:
|
||||
80000098: 00600193 addi x3,x0,6
|
||||
8000009c: c0003073 csrrc x0,cycle,x0
|
||||
800000a0: 00000393 addi x7,x0,0
|
||||
800000a4: 1c701a63 bne x0,x7,80000278 <fail>
|
||||
|
||||
00000000800000a8 <test_7>:
|
||||
800000a8: 00700193 addi x3,x0,7
|
||||
800000ac: c0002073 csrrs x0,cycle,x0
|
||||
800000b0: 00000393 addi x7,x0,0
|
||||
800000b4: 1c701263 bne x0,x7,80000278 <fail>
|
||||
|
||||
00000000800000b8 <test_8>:
|
||||
800000b8: 00800193 addi x3,x0,8
|
||||
800000bc: c0007073 csrrci x0,cycle,0
|
||||
800000c0: 00000393 addi x7,x0,0
|
||||
800000c4: 1a701a63 bne x0,x7,80000278 <fail>
|
||||
|
||||
00000000800000c8 <test_9>:
|
||||
800000c8: 00900193 addi x3,x0,9
|
||||
800000cc: c0006073 csrrsi x0,cycle,0
|
||||
800000d0: 00000393 addi x7,x0,0
|
||||
800000d4: 1a701263 bne x0,x7,80000278 <fail>
|
||||
|
||||
00000000800000d8 <test_10>:
|
||||
800000d8: 00a00193 addi x3,x0,10
|
||||
800000dc: 34001073 csrrw x0,mscratch,x0
|
||||
800000e0: 34002573 csrrs x10,mscratch,x0
|
||||
800000e4: 00000393 addi x7,x0,0
|
||||
800000e8: 18751863 bne x10,x7,80000278 <fail>
|
||||
|
||||
00000000800000ec <test_11>:
|
||||
800000ec: 00b00193 addi x3,x0,11
|
||||
800000f0: 34005573 csrrwi x10,mscratch,0
|
||||
800000f4: 3407d573 csrrwi x10,mscratch,15
|
||||
800000f8: 00000393 addi x7,x0,0
|
||||
800000fc: 16751e63 bne x10,x7,80000278 <fail>
|
||||
|
||||
0000000080000100 <test_12>:
|
||||
80000100: 00c00193 addi x3,x0,12
|
||||
80000104: 34086073 csrrsi x0,mscratch,16
|
||||
80000108: 34002573 csrrs x10,mscratch,x0
|
||||
8000010c: 01f00393 addi x7,x0,31
|
||||
80000110: 16751463 bne x10,x7,80000278 <fail>
|
||||
80000114: 3401d073 csrrwi x0,mscratch,3
|
||||
|
||||
0000000080000118 <test_13>:
|
||||
80000118: 00d00193 addi x3,x0,13
|
||||
8000011c: 34002573 csrrs x10,mscratch,x0
|
||||
80000120: 00300393 addi x7,x0,3
|
||||
80000124: 14751a63 bne x10,x7,80000278 <fail>
|
||||
|
||||
0000000080000128 <test_14>:
|
||||
80000128: 00e00193 addi x3,x0,14
|
||||
8000012c: 3400f5f3 csrrci x11,mscratch,1
|
||||
80000130: 00300393 addi x7,x0,3
|
||||
80000134: 14759263 bne x11,x7,80000278 <fail>
|
||||
|
||||
0000000080000138 <test_15>:
|
||||
80000138: 00f00193 addi x3,x0,15
|
||||
8000013c: 34026673 csrrsi x12,mscratch,4
|
||||
80000140: 00200393 addi x7,x0,2
|
||||
80000144: 12761a63 bne x12,x7,80000278 <fail>
|
||||
|
||||
0000000080000148 <test_16>:
|
||||
80000148: 01000193 addi x3,x0,16
|
||||
8000014c: 340156f3 csrrwi x13,mscratch,2
|
||||
80000150: 00600393 addi x7,x0,6
|
||||
80000154: 12769263 bne x13,x7,80000278 <fail>
|
||||
|
||||
0000000080000158 <test_17>:
|
||||
80000158: 01100193 addi x3,x0,17
|
||||
8000015c: 0bad2537 lui x10,0xbad2
|
||||
80000160: dea5051b addiw x10,x10,-534 # bad1dea <_start-0x7452e216>
|
||||
80000164: 340515f3 csrrw x11,mscratch,x10
|
||||
80000168: 00200393 addi x7,x0,2
|
||||
8000016c: 10759663 bne x11,x7,80000278 <fail>
|
||||
|
||||
0000000080000170 <test_18>:
|
||||
80000170: 01200193 addi x3,x0,18
|
||||
80000174: 00002537 lui x10,0x2
|
||||
80000178: dea5051b addiw x10,x10,-534 # 1dea <_start-0x7fffe216>
|
||||
8000017c: 340535f3 csrrc x11,mscratch,x10
|
||||
80000180: 0bad23b7 lui x7,0xbad2
|
||||
80000184: dea3839b addiw x7,x7,-534 # bad1dea <_start-0x7452e216>
|
||||
80000188: 0e759863 bne x11,x7,80000278 <fail>
|
||||
|
||||
000000008000018c <test_19>:
|
||||
8000018c: 01300193 addi x3,x0,19
|
||||
80000190: 0000c537 lui x10,0xc
|
||||
80000194: eef5051b addiw x10,x10,-273 # beef <_start-0x7fff4111>
|
||||
80000198: 340525f3 csrrs x11,mscratch,x10
|
||||
8000019c: 0bad03b7 lui x7,0xbad0
|
||||
800001a0: 0c759c63 bne x11,x7,80000278 <fail>
|
||||
|
||||
00000000800001a4 <test_20>:
|
||||
800001a4: 01400193 addi x3,x0,20
|
||||
800001a8: 0bad2537 lui x10,0xbad2
|
||||
800001ac: dea5051b addiw x10,x10,-534 # bad1dea <_start-0x7452e216>
|
||||
800001b0: 34051573 csrrw x10,mscratch,x10
|
||||
800001b4: 0badc3b7 lui x7,0xbadc
|
||||
800001b8: eef3839b addiw x7,x7,-273 # badbeef <_start-0x74524111>
|
||||
800001bc: 0a751e63 bne x10,x7,80000278 <fail>
|
||||
|
||||
00000000800001c0 <test_21>:
|
||||
800001c0: 01500193 addi x3,x0,21
|
||||
800001c4: 00002537 lui x10,0x2
|
||||
800001c8: dea5051b addiw x10,x10,-534 # 1dea <_start-0x7fffe216>
|
||||
800001cc: 34053573 csrrc x10,mscratch,x10
|
||||
800001d0: 0bad23b7 lui x7,0xbad2
|
||||
800001d4: dea3839b addiw x7,x7,-534 # bad1dea <_start-0x7452e216>
|
||||
800001d8: 0a751063 bne x10,x7,80000278 <fail>
|
||||
|
||||
00000000800001dc <test_22>:
|
||||
800001dc: 01600193 addi x3,x0,22
|
||||
800001e0: 0000c537 lui x10,0xc
|
||||
800001e4: eef5051b addiw x10,x10,-273 # beef <_start-0x7fff4111>
|
||||
800001e8: 34052573 csrrs x10,mscratch,x10
|
||||
800001ec: 0bad03b7 lui x7,0xbad0
|
||||
800001f0: 08751463 bne x10,x7,80000278 <fail>
|
||||
|
||||
00000000800001f4 <test_23>:
|
||||
800001f4: 01700193 addi x3,x0,23
|
||||
800001f8: 34002573 csrrs x10,mscratch,x0
|
||||
800001fc: 0badc3b7 lui x7,0xbadc
|
||||
80000200: eef3839b addiw x7,x7,-273 # badbeef <_start-0x74524111>
|
||||
80000204: 06751a63 bne x10,x7,80000278 <fail>
|
||||
80000208: 30102573 csrrs x10,misa,x0
|
||||
8000020c: 02057513 andi x10,x10,32
|
||||
80000210: 00050263 beq x10,x0,80000214 <test_23+0x20>
|
||||
80000214: 30102573 csrrs x10,misa,x0
|
||||
80000218: 01455513 srli x10,x10,0x14
|
||||
8000021c: 00157513 andi x10,x10,1
|
||||
80000220: 04050263 beq x10,x0,80000264 <finish>
|
||||
80000224: 3060d073 csrrwi x0,mcounteren,1
|
||||
80000228: 30102573 csrrs x10,misa,x0
|
||||
8000022c: 01255513 srli x10,x10,0x12
|
||||
80000230: 00157513 andi x10,x10,1
|
||||
80000234: 00050463 beq x10,x0,8000023c <test_23+0x48>
|
||||
80000238: 1060d073 csrrwi x0,scounteren,1
|
||||
8000023c: 10000293 addi x5,x0,256
|
||||
80000240: 3002b073 csrrc x0,mstatus,x5
|
||||
80000244: 00000297 auipc x5,0x0
|
||||
80000248: 01028293 addi x5,x5,16 # 80000254 <test_24>
|
||||
8000024c: 34129073 csrrw x0,mepc,x5
|
||||
80000250: 00000013 addi x0,x0,0
|
||||
|
||||
0000000080000254 <test_24>:
|
||||
80000254: 01800193 addi x3,x0,24
|
||||
80000258: 00000013 addi x0,x0,0
|
||||
8000025c: 00000393 addi x7,x0,0
|
||||
80000260: 00701c63 bne x0,x7,80000278 <fail>
|
||||
|
||||
0000000080000264 <finish>:
|
||||
80000264: 00100193 addi x3,x0,1
|
||||
80000268: 05d00893 addi x17,x0,93
|
||||
8000026c: 00000513 addi x10,x0,0
|
||||
80000270: 00000073 ecall
|
||||
80000274: 00301e63 bne x0,x3,80000290 <pass>
|
||||
|
||||
0000000080000278 <fail>:
|
||||
80000278: 00018063 beq x3,x0,80000278 <fail>
|
||||
8000027c: 00119193 slli x3,x3,0x1
|
||||
80000280: 0011e193 ori x3,x3,1
|
||||
80000284: 05d00893 addi x17,x0,93
|
||||
80000288: 00018513 addi x10,x3,0
|
||||
8000028c: 00000073 ecall
|
||||
|
||||
0000000080000290 <pass>:
|
||||
80000290: 00100193 addi x3,x0,1
|
||||
80000294: 05d00893 addi x17,x0,93
|
||||
80000298: 00000513 addi x10,x0,0
|
||||
8000029c: 00000073 ecall
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,163 @@
|
||||
|
||||
./rv64mi-p-access: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 04c0006f jal x0,8000004c <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0a63 beq x30,x31,80000040 <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0663 beq x30,x31,80000040 <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0263 beq x30,x31,80000040 <write_tohost>
|
||||
80000020: 00000f17 auipc x30,0x0
|
||||
80000024: 1e8f0f13 addi x30,x30,488 # 80000208 <mtvec_handler>
|
||||
80000028: 000f0463 beq x30,x0,80000030 <trap_vector+0x2c>
|
||||
8000002c: 000f0067 jalr x0,0(x30)
|
||||
80000030: 34202f73 csrrs x30,mcause,x0
|
||||
80000034: 000f5463 bge x30,x0,8000003c <handle_exception>
|
||||
80000038: 0040006f jal x0,8000003c <handle_exception>
|
||||
|
||||
000000008000003c <handle_exception>:
|
||||
8000003c: 5391e193 ori x3,x3,1337
|
||||
|
||||
0000000080000040 <write_tohost>:
|
||||
80000040: 00001f17 auipc x30,0x1
|
||||
80000044: fc3f2023 sw x3,-64(x30) # 80001000 <tohost>
|
||||
80000048: ff9ff06f jal x0,80000040 <write_tohost>
|
||||
|
||||
000000008000004c <reset_vector>:
|
||||
8000004c: 00000093 addi x1,x0,0
|
||||
80000050: 00000113 addi x2,x0,0
|
||||
80000054: 00000193 addi x3,x0,0
|
||||
80000058: 00000213 addi x4,x0,0
|
||||
8000005c: 00000293 addi x5,x0,0
|
||||
80000060: 00000313 addi x6,x0,0
|
||||
80000064: 00000393 addi x7,x0,0
|
||||
80000068: 00000413 addi x8,x0,0
|
||||
8000006c: 00000493 addi x9,x0,0
|
||||
80000070: 00000513 addi x10,x0,0
|
||||
80000074: 00000593 addi x11,x0,0
|
||||
80000078: 00000613 addi x12,x0,0
|
||||
8000007c: 00000693 addi x13,x0,0
|
||||
80000080: 00000713 addi x14,x0,0
|
||||
80000084: 00000793 addi x15,x0,0
|
||||
80000088: 00000813 addi x16,x0,0
|
||||
8000008c: 00000893 addi x17,x0,0
|
||||
80000090: 00000913 addi x18,x0,0
|
||||
80000094: 00000993 addi x19,x0,0
|
||||
80000098: 00000a13 addi x20,x0,0
|
||||
8000009c: 00000a93 addi x21,x0,0
|
||||
800000a0: 00000b13 addi x22,x0,0
|
||||
800000a4: 00000b93 addi x23,x0,0
|
||||
800000a8: 00000c13 addi x24,x0,0
|
||||
800000ac: 00000c93 addi x25,x0,0
|
||||
800000b0: 00000d13 addi x26,x0,0
|
||||
800000b4: 00000d93 addi x27,x0,0
|
||||
800000b8: 00000e13 addi x28,x0,0
|
||||
800000bc: 00000e93 addi x29,x0,0
|
||||
800000c0: 00000f13 addi x30,x0,0
|
||||
800000c4: 00000f93 addi x31,x0,0
|
||||
800000c8: f1402573 csrrs x10,mhartid,x0
|
||||
800000cc: 00051063 bne x10,x0,800000cc <reset_vector+0x80>
|
||||
800000d0: 00000297 auipc x5,0x0
|
||||
800000d4: 01028293 addi x5,x5,16 # 800000e0 <reset_vector+0x94>
|
||||
800000d8: 30529073 csrrw x0,mtvec,x5
|
||||
800000dc: 18005073 csrrwi x0,satp,0
|
||||
800000e0: 00000297 auipc x5,0x0
|
||||
800000e4: 02428293 addi x5,x5,36 # 80000104 <reset_vector+0xb8>
|
||||
800000e8: 30529073 csrrw x0,mtvec,x5
|
||||
800000ec: 0010029b addiw x5,x0,1
|
||||
800000f0: 03529293 slli x5,x5,0x35
|
||||
800000f4: fff28293 addi x5,x5,-1
|
||||
800000f8: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000fc: 01f00293 addi x5,x0,31
|
||||
80000100: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000104: 30405073 csrrwi x0,mie,0
|
||||
80000108: 00000297 auipc x5,0x0
|
||||
8000010c: 01428293 addi x5,x5,20 # 8000011c <reset_vector+0xd0>
|
||||
80000110: 30529073 csrrw x0,mtvec,x5
|
||||
80000114: 30205073 csrrwi x0,medeleg,0
|
||||
80000118: 30305073 csrrwi x0,mideleg,0
|
||||
8000011c: 00000193 addi x3,x0,0
|
||||
80000120: 00000297 auipc x5,0x0
|
||||
80000124: ee428293 addi x5,x5,-284 # 80000004 <trap_vector>
|
||||
80000128: 30529073 csrrw x0,mtvec,x5
|
||||
8000012c: 00100513 addi x10,x0,1
|
||||
80000130: 01f51513 slli x10,x10,0x1f
|
||||
80000134: 00055c63 bge x10,x0,8000014c <reset_vector+0x100>
|
||||
80000138: 0ff0000f fence iorw,iorw
|
||||
8000013c: 00100193 addi x3,x0,1
|
||||
80000140: 05d00893 addi x17,x0,93
|
||||
80000144: 00000513 addi x10,x0,0
|
||||
80000148: 00000073 ecall
|
||||
8000014c: 00000293 addi x5,x0,0
|
||||
80000150: 00028a63 beq x5,x0,80000164 <reset_vector+0x118>
|
||||
80000154: 10529073 csrrw x0,stvec,x5
|
||||
80000158: 0000b2b7 lui x5,0xb
|
||||
8000015c: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
80000160: 30229073 csrrw x0,medeleg,x5
|
||||
80000164: 30005073 csrrwi x0,mstatus,0
|
||||
80000168: 00002537 lui x10,0x2
|
||||
8000016c: 8005051b addiw x10,x10,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000170: 30052073 csrrs x0,mstatus,x10
|
||||
80000174: 00000297 auipc x5,0x0
|
||||
80000178: 01428293 addi x5,x5,20 # 80000188 <reset_vector+0x13c>
|
||||
8000017c: 34129073 csrrw x0,mepc,x5
|
||||
80000180: f1402573 csrrs x10,mhartid,x0
|
||||
80000184: 30200073 mret
|
||||
80000188: 00000397 auipc x7,0x0
|
||||
8000018c: 05038393 addi x7,x7,80 # 800001d8 <fail>
|
||||
80000190: fff0029b addiw x5,x0,-1
|
||||
80000194: 03f29293 slli x5,x5,0x3f
|
||||
80000198: 0072c2b3 xor x5,x5,x7
|
||||
8000019c: 00200193 addi x3,x0,2
|
||||
800001a0: 00100313 addi x6,x0,1
|
||||
800001a4: 00000497 auipc x9,0x0
|
||||
800001a8: 01048493 addi x9,x9,16 # 800001b4 <reset_vector+0x168>
|
||||
800001ac: 00000393 addi x7,x0,0
|
||||
800001b0: 000283e7 jalr x7,0(x5)
|
||||
800001b4: 00300193 addi x3,x0,3
|
||||
800001b8: 00500313 addi x6,x0,5
|
||||
800001bc: 00000497 auipc x9,0x0
|
||||
800001c0: 01448493 addi x9,x9,20 # 800001d0 <reset_vector+0x184>
|
||||
800001c4: 00048393 addi x7,x9,0
|
||||
800001c8: 00028383 lb x7,0(x5)
|
||||
800001cc: 00c0006f jal x0,800001d8 <fail>
|
||||
800001d0: 0240006f jal x0,800001f4 <pass>
|
||||
800001d4: 02301063 bne x0,x3,800001f4 <pass>
|
||||
|
||||
00000000800001d8 <fail>:
|
||||
800001d8: 0ff0000f fence iorw,iorw
|
||||
800001dc: 00018063 beq x3,x0,800001dc <fail+0x4>
|
||||
800001e0: 00119193 slli x3,x3,0x1
|
||||
800001e4: 0011e193 ori x3,x3,1
|
||||
800001e8: 05d00893 addi x17,x0,93
|
||||
800001ec: 00018513 addi x10,x3,0
|
||||
800001f0: 00000073 ecall
|
||||
|
||||
00000000800001f4 <pass>:
|
||||
800001f4: 0ff0000f fence iorw,iorw
|
||||
800001f8: 00100193 addi x3,x0,1
|
||||
800001fc: 05d00893 addi x17,x0,93
|
||||
80000200: 00000513 addi x10,x0,0
|
||||
80000204: 00000073 ecall
|
||||
|
||||
0000000080000208 <mtvec_handler>:
|
||||
80000208: 00200513 addi x10,x0,2
|
||||
8000020c: 00a18863 beq x3,x10,8000021c <mtvec_handler+0x14>
|
||||
80000210: 00300513 addi x10,x0,3
|
||||
80000214: 00a18463 beq x3,x10,8000021c <mtvec_handler+0x14>
|
||||
80000218: fc1ff06f jal x0,800001d8 <fail>
|
||||
8000021c: fa939ee3 bne x7,x9,800001d8 <fail>
|
||||
80000220: 342023f3 csrrs x7,mcause,x0
|
||||
80000224: fa639ae3 bne x7,x6,800001d8 <fail>
|
||||
80000228: 34149073 csrrw x0,mepc,x9
|
||||
8000022c: 30200073 mret
|
||||
80000230: c0001073 unimp
|
||||
...
|
||||
@ -0,0 +1,205 @@
|
||||
|
||||
./rv64mi-p-breakpoint: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 04c0006f jal x0,8000004c <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0a63 beq x30,x31,80000040 <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0663 beq x30,x31,80000040 <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0263 beq x30,x31,80000040 <write_tohost>
|
||||
80000020: 00000f17 auipc x30,0x0
|
||||
80000024: 294f0f13 addi x30,x30,660 # 800002b4 <mtvec_handler>
|
||||
80000028: 000f0463 beq x30,x0,80000030 <trap_vector+0x2c>
|
||||
8000002c: 000f0067 jalr x0,0(x30)
|
||||
80000030: 34202f73 csrrs x30,mcause,x0
|
||||
80000034: 000f5463 bge x30,x0,8000003c <handle_exception>
|
||||
80000038: 0040006f jal x0,8000003c <handle_exception>
|
||||
|
||||
000000008000003c <handle_exception>:
|
||||
8000003c: 5391e193 ori x3,x3,1337
|
||||
|
||||
0000000080000040 <write_tohost>:
|
||||
80000040: 00001f17 auipc x30,0x1
|
||||
80000044: fc3f2023 sw x3,-64(x30) # 80001000 <tohost>
|
||||
80000048: ff9ff06f jal x0,80000040 <write_tohost>
|
||||
|
||||
000000008000004c <reset_vector>:
|
||||
8000004c: 00000093 addi x1,x0,0
|
||||
80000050: 00000113 addi x2,x0,0
|
||||
80000054: 00000193 addi x3,x0,0
|
||||
80000058: 00000213 addi x4,x0,0
|
||||
8000005c: 00000293 addi x5,x0,0
|
||||
80000060: 00000313 addi x6,x0,0
|
||||
80000064: 00000393 addi x7,x0,0
|
||||
80000068: 00000413 addi x8,x0,0
|
||||
8000006c: 00000493 addi x9,x0,0
|
||||
80000070: 00000513 addi x10,x0,0
|
||||
80000074: 00000593 addi x11,x0,0
|
||||
80000078: 00000613 addi x12,x0,0
|
||||
8000007c: 00000693 addi x13,x0,0
|
||||
80000080: 00000713 addi x14,x0,0
|
||||
80000084: 00000793 addi x15,x0,0
|
||||
80000088: 00000813 addi x16,x0,0
|
||||
8000008c: 00000893 addi x17,x0,0
|
||||
80000090: 00000913 addi x18,x0,0
|
||||
80000094: 00000993 addi x19,x0,0
|
||||
80000098: 00000a13 addi x20,x0,0
|
||||
8000009c: 00000a93 addi x21,x0,0
|
||||
800000a0: 00000b13 addi x22,x0,0
|
||||
800000a4: 00000b93 addi x23,x0,0
|
||||
800000a8: 00000c13 addi x24,x0,0
|
||||
800000ac: 00000c93 addi x25,x0,0
|
||||
800000b0: 00000d13 addi x26,x0,0
|
||||
800000b4: 00000d93 addi x27,x0,0
|
||||
800000b8: 00000e13 addi x28,x0,0
|
||||
800000bc: 00000e93 addi x29,x0,0
|
||||
800000c0: 00000f13 addi x30,x0,0
|
||||
800000c4: 00000f93 addi x31,x0,0
|
||||
800000c8: f1402573 csrrs x10,mhartid,x0
|
||||
800000cc: 00051063 bne x10,x0,800000cc <reset_vector+0x80>
|
||||
800000d0: 00000297 auipc x5,0x0
|
||||
800000d4: 01028293 addi x5,x5,16 # 800000e0 <reset_vector+0x94>
|
||||
800000d8: 30529073 csrrw x0,mtvec,x5
|
||||
800000dc: 18005073 csrrwi x0,satp,0
|
||||
800000e0: 00000297 auipc x5,0x0
|
||||
800000e4: 02428293 addi x5,x5,36 # 80000104 <reset_vector+0xb8>
|
||||
800000e8: 30529073 csrrw x0,mtvec,x5
|
||||
800000ec: 0010029b addiw x5,x0,1
|
||||
800000f0: 03529293 slli x5,x5,0x35
|
||||
800000f4: fff28293 addi x5,x5,-1
|
||||
800000f8: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000fc: 01f00293 addi x5,x0,31
|
||||
80000100: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000104: 30405073 csrrwi x0,mie,0
|
||||
80000108: 00000297 auipc x5,0x0
|
||||
8000010c: 01428293 addi x5,x5,20 # 8000011c <reset_vector+0xd0>
|
||||
80000110: 30529073 csrrw x0,mtvec,x5
|
||||
80000114: 30205073 csrrwi x0,medeleg,0
|
||||
80000118: 30305073 csrrwi x0,mideleg,0
|
||||
8000011c: 00000193 addi x3,x0,0
|
||||
80000120: 00000297 auipc x5,0x0
|
||||
80000124: ee428293 addi x5,x5,-284 # 80000004 <trap_vector>
|
||||
80000128: 30529073 csrrw x0,mtvec,x5
|
||||
8000012c: 00100513 addi x10,x0,1
|
||||
80000130: 01f51513 slli x10,x10,0x1f
|
||||
80000134: 00055c63 bge x10,x0,8000014c <reset_vector+0x100>
|
||||
80000138: 0ff0000f fence iorw,iorw
|
||||
8000013c: 00100193 addi x3,x0,1
|
||||
80000140: 05d00893 addi x17,x0,93
|
||||
80000144: 00000513 addi x10,x0,0
|
||||
80000148: 00000073 ecall
|
||||
8000014c: 00000293 addi x5,x0,0
|
||||
80000150: 00028a63 beq x5,x0,80000164 <reset_vector+0x118>
|
||||
80000154: 10529073 csrrw x0,stvec,x5
|
||||
80000158: 0000b2b7 lui x5,0xb
|
||||
8000015c: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
80000160: 30229073 csrrw x0,medeleg,x5
|
||||
80000164: 30005073 csrrwi x0,mstatus,0
|
||||
80000168: 00002537 lui x10,0x2
|
||||
8000016c: 8005051b addiw x10,x10,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000170: 30052073 csrrs x0,mstatus,x10
|
||||
80000174: 00000297 auipc x5,0x0
|
||||
80000178: 01428293 addi x5,x5,20 # 80000188 <reset_vector+0x13c>
|
||||
8000017c: 34129073 csrrw x0,mepc,x5
|
||||
80000180: f1402573 csrrs x10,mhartid,x0
|
||||
80000184: 30200073 mret
|
||||
80000188: 00200193 addi x3,x0,2
|
||||
8000018c: 7a001073 csrrw x0,tselect,x0
|
||||
80000190: 7a0025f3 csrrs x11,tselect,x0
|
||||
80000194: 10b01663 bne x0,x11,800002a0 <pass>
|
||||
80000198: 00000617 auipc x12,0x0
|
||||
8000019c: 02460613 addi x12,x12,36 # 800001bc <reset_vector+0x170>
|
||||
800001a0: 7a261073 csrrw x0,tdata2,x12
|
||||
800001a4: 0010051b addiw x10,x0,1
|
||||
800001a8: 03d51513 slli x10,x10,0x3d
|
||||
800001ac: 04450513 addi x10,x10,68
|
||||
800001b0: 7a151073 csrrw x0,tdata1,x10
|
||||
800001b4: 7a1025f3 csrrs x11,tdata1,x0
|
||||
800001b8: 00b51863 bne x10,x11,800001c8 <reset_vector+0x17c>
|
||||
800001bc: 0c000463 beq x0,x0,80000284 <fail>
|
||||
800001c0: 00300193 addi x3,x0,3
|
||||
800001c4: 00062503 lw x10,0(x12)
|
||||
800001c8: 00400193 addi x3,x0,4
|
||||
800001cc: 0010051b addiw x10,x0,1
|
||||
800001d0: 03d51513 slli x10,x10,0x3d
|
||||
800001d4: 04150513 addi x10,x10,65
|
||||
800001d8: 7a151073 csrrw x0,tdata1,x10
|
||||
800001dc: 7a1025f3 csrrs x11,tdata1,x0
|
||||
800001e0: 02b51063 bne x10,x11,80000200 <reset_vector+0x1b4>
|
||||
800001e4: 00002617 auipc x12,0x2
|
||||
800001e8: e1c60613 addi x12,x12,-484 # 80002000 <begin_signature>
|
||||
800001ec: 7a261073 csrrw x0,tdata2,x12
|
||||
800001f0: 00062603 lw x12,0(x12)
|
||||
800001f4: 08060863 beq x12,x0,80000284 <fail>
|
||||
800001f8: 00500193 addi x3,x0,5
|
||||
800001fc: 00062023 sw x0,0(x12)
|
||||
80000200: 00600193 addi x3,x0,6
|
||||
80000204: 0010051b addiw x10,x0,1
|
||||
80000208: 03d51513 slli x10,x10,0x3d
|
||||
8000020c: 04250513 addi x10,x10,66
|
||||
80000210: 7a151073 csrrw x0,tdata1,x10
|
||||
80000214: 7a1025f3 csrrs x11,tdata1,x0
|
||||
80000218: 06b51463 bne x10,x11,80000280 <reset_vector+0x234>
|
||||
8000021c: 00c62023 sw x12,0(x12)
|
||||
80000220: 00700193 addi x3,x0,7
|
||||
80000224: 00062603 lw x12,0(x12)
|
||||
80000228: 04061e63 bne x12,x0,80000284 <fail>
|
||||
8000022c: 00100513 addi x10,x0,1
|
||||
80000230: 7a051073 csrrw x0,tselect,x10
|
||||
80000234: 7a0025f3 csrrs x11,tselect,x0
|
||||
80000238: 06b51463 bne x10,x11,800002a0 <pass>
|
||||
8000023c: 0010051b addiw x10,x0,1
|
||||
80000240: 03d51513 slli x10,x10,0x3d
|
||||
80000244: 04150513 addi x10,x10,65
|
||||
80000248: 7a151073 csrrw x0,tdata1,x10
|
||||
8000024c: 00002697 auipc x13,0x2
|
||||
80000250: db868693 addi x13,x13,-584 # 80002004 <data2>
|
||||
80000254: 7a269073 csrrw x0,tdata2,x13
|
||||
80000258: 00800193 addi x3,x0,8
|
||||
8000025c: 0006a683 lw x13,0(x13)
|
||||
80000260: 02068263 beq x13,x0,80000284 <fail>
|
||||
80000264: 00a00193 addi x3,x0,10
|
||||
80000268: 00002617 auipc x12,0x2
|
||||
8000026c: d9860613 addi x12,x12,-616 # 80002000 <begin_signature>
|
||||
80000270: 00c62023 sw x12,0(x12)
|
||||
80000274: 00b00193 addi x3,x0,11
|
||||
80000278: 00062603 lw x12,0(x12)
|
||||
8000027c: 00061463 bne x12,x0,80000284 <fail>
|
||||
80000280: 02301063 bne x0,x3,800002a0 <pass>
|
||||
|
||||
0000000080000284 <fail>:
|
||||
80000284: 0ff0000f fence iorw,iorw
|
||||
80000288: 00018063 beq x3,x0,80000288 <fail+0x4>
|
||||
8000028c: 00119193 slli x3,x3,0x1
|
||||
80000290: 0011e193 ori x3,x3,1
|
||||
80000294: 05d00893 addi x17,x0,93
|
||||
80000298: 00018513 addi x10,x3,0
|
||||
8000029c: 00000073 ecall
|
||||
|
||||
00000000800002a0 <pass>:
|
||||
800002a0: 0ff0000f fence iorw,iorw
|
||||
800002a4: 00100193 addi x3,x0,1
|
||||
800002a8: 05d00893 addi x17,x0,93
|
||||
800002ac: 00000513 addi x10,x0,0
|
||||
800002b0: 00000073 ecall
|
||||
|
||||
00000000800002b4 <mtvec_handler>:
|
||||
800002b4: 0011f293 andi x5,x3,1
|
||||
800002b8: fc0296e3 bne x5,x0,80000284 <fail>
|
||||
800002bc: 00300293 addi x5,x0,3
|
||||
800002c0: 34202373 csrrs x6,mcause,x0
|
||||
800002c4: fc6290e3 bne x5,x6,80000284 <fail>
|
||||
800002c8: 341022f3 csrrs x5,mepc,x0
|
||||
800002cc: 00428293 addi x5,x5,4
|
||||
800002d0: 34129073 csrrw x0,mepc,x5
|
||||
800002d4: 30200073 mret
|
||||
800002d8: c0001073 unimp
|
||||
...
|
||||
@ -0,0 +1,363 @@
|
||||
|
||||
./rv64mi-p-csr: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 04c0006f jal x0,8000004c <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0a63 beq x30,x31,80000040 <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0663 beq x30,x31,80000040 <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0263 beq x30,x31,80000040 <write_tohost>
|
||||
80000020: 00000f17 auipc x30,0x0
|
||||
80000024: 41cf0f13 addi x30,x30,1052 # 8000043c <mtvec_handler>
|
||||
80000028: 000f0463 beq x30,x0,80000030 <trap_vector+0x2c>
|
||||
8000002c: 000f0067 jalr x0,0(x30)
|
||||
80000030: 34202f73 csrrs x30,mcause,x0
|
||||
80000034: 000f5463 bge x30,x0,8000003c <handle_exception>
|
||||
80000038: 0040006f jal x0,8000003c <handle_exception>
|
||||
|
||||
000000008000003c <handle_exception>:
|
||||
8000003c: 5391e193 ori x3,x3,1337
|
||||
|
||||
0000000080000040 <write_tohost>:
|
||||
80000040: 00001f17 auipc x30,0x1
|
||||
80000044: fc3f2023 sw x3,-64(x30) # 80001000 <tohost>
|
||||
80000048: ff9ff06f jal x0,80000040 <write_tohost>
|
||||
|
||||
000000008000004c <reset_vector>:
|
||||
8000004c: 00000093 addi x1,x0,0
|
||||
80000050: 00000113 addi x2,x0,0
|
||||
80000054: 00000193 addi x3,x0,0
|
||||
80000058: 00000213 addi x4,x0,0
|
||||
8000005c: 00000293 addi x5,x0,0
|
||||
80000060: 00000313 addi x6,x0,0
|
||||
80000064: 00000393 addi x7,x0,0
|
||||
80000068: 00000413 addi x8,x0,0
|
||||
8000006c: 00000493 addi x9,x0,0
|
||||
80000070: 00000513 addi x10,x0,0
|
||||
80000074: 00000593 addi x11,x0,0
|
||||
80000078: 00000613 addi x12,x0,0
|
||||
8000007c: 00000693 addi x13,x0,0
|
||||
80000080: 00000713 addi x14,x0,0
|
||||
80000084: 00000793 addi x15,x0,0
|
||||
80000088: 00000813 addi x16,x0,0
|
||||
8000008c: 00000893 addi x17,x0,0
|
||||
80000090: 00000913 addi x18,x0,0
|
||||
80000094: 00000993 addi x19,x0,0
|
||||
80000098: 00000a13 addi x20,x0,0
|
||||
8000009c: 00000a93 addi x21,x0,0
|
||||
800000a0: 00000b13 addi x22,x0,0
|
||||
800000a4: 00000b93 addi x23,x0,0
|
||||
800000a8: 00000c13 addi x24,x0,0
|
||||
800000ac: 00000c93 addi x25,x0,0
|
||||
800000b0: 00000d13 addi x26,x0,0
|
||||
800000b4: 00000d93 addi x27,x0,0
|
||||
800000b8: 00000e13 addi x28,x0,0
|
||||
800000bc: 00000e93 addi x29,x0,0
|
||||
800000c0: 00000f13 addi x30,x0,0
|
||||
800000c4: 00000f93 addi x31,x0,0
|
||||
800000c8: f1402573 csrrs x10,mhartid,x0
|
||||
800000cc: 00051063 bne x10,x0,800000cc <reset_vector+0x80>
|
||||
800000d0: 00000297 auipc x5,0x0
|
||||
800000d4: 01028293 addi x5,x5,16 # 800000e0 <reset_vector+0x94>
|
||||
800000d8: 30529073 csrrw x0,mtvec,x5
|
||||
800000dc: 18005073 csrrwi x0,satp,0
|
||||
800000e0: 00000297 auipc x5,0x0
|
||||
800000e4: 02428293 addi x5,x5,36 # 80000104 <reset_vector+0xb8>
|
||||
800000e8: 30529073 csrrw x0,mtvec,x5
|
||||
800000ec: 0010029b addiw x5,x0,1
|
||||
800000f0: 03529293 slli x5,x5,0x35
|
||||
800000f4: fff28293 addi x5,x5,-1
|
||||
800000f8: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000fc: 01f00293 addi x5,x0,31
|
||||
80000100: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000104: 30405073 csrrwi x0,mie,0
|
||||
80000108: 00000297 auipc x5,0x0
|
||||
8000010c: 01428293 addi x5,x5,20 # 8000011c <reset_vector+0xd0>
|
||||
80000110: 30529073 csrrw x0,mtvec,x5
|
||||
80000114: 30205073 csrrwi x0,medeleg,0
|
||||
80000118: 30305073 csrrwi x0,mideleg,0
|
||||
8000011c: 00000193 addi x3,x0,0
|
||||
80000120: 00000297 auipc x5,0x0
|
||||
80000124: ee428293 addi x5,x5,-284 # 80000004 <trap_vector>
|
||||
80000128: 30529073 csrrw x0,mtvec,x5
|
||||
8000012c: 00100513 addi x10,x0,1
|
||||
80000130: 01f51513 slli x10,x10,0x1f
|
||||
80000134: 00055c63 bge x10,x0,8000014c <reset_vector+0x100>
|
||||
80000138: 0ff0000f fence iorw,iorw
|
||||
8000013c: 00100193 addi x3,x0,1
|
||||
80000140: 05d00893 addi x17,x0,93
|
||||
80000144: 00000513 addi x10,x0,0
|
||||
80000148: 00000073 ecall
|
||||
8000014c: 00000293 addi x5,x0,0
|
||||
80000150: 00028a63 beq x5,x0,80000164 <reset_vector+0x118>
|
||||
80000154: 10529073 csrrw x0,stvec,x5
|
||||
80000158: 0000b2b7 lui x5,0xb
|
||||
8000015c: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
80000160: 30229073 csrrw x0,medeleg,x5
|
||||
80000164: 30005073 csrrwi x0,mstatus,0
|
||||
80000168: 00002537 lui x10,0x2
|
||||
8000016c: 8005051b addiw x10,x10,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000170: 30052073 csrrs x0,mstatus,x10
|
||||
80000174: 00000297 auipc x5,0x0
|
||||
80000178: 01428293 addi x5,x5,20 # 80000188 <reset_vector+0x13c>
|
||||
8000017c: 34129073 csrrw x0,mepc,x5
|
||||
80000180: f1402573 csrrs x10,mhartid,x0
|
||||
80000184: 30200073 mret
|
||||
80000188: 000022b7 lui x5,0x2
|
||||
8000018c: 8002829b addiw x5,x5,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000190: 3002b073 csrrc x0,mstatus,x5
|
||||
80000194: 30002373 csrrs x6,mstatus,x0
|
||||
80000198: 0062f2b3 and x5,x5,x6
|
||||
8000019c: 02029463 bne x5,x0,800001c4 <test_19>
|
||||
|
||||
00000000800001a0 <test_18>:
|
||||
800001a0: 01200193 addi x3,x0,18
|
||||
800001a4: 30002573 csrrs x10,mstatus,x0
|
||||
800001a8: 0030059b addiw x11,x0,3
|
||||
800001ac: 02059593 slli x11,x11,0x20
|
||||
800001b0: 00b57533 and x10,x10,x11
|
||||
800001b4: 0010039b addiw x7,x0,1
|
||||
800001b8: 02139393 slli x7,x7,0x21
|
||||
800001bc: 24751863 bne x10,x7,8000040c <fail>
|
||||
800001c0: 0200006f jal x0,800001e0 <test_25>
|
||||
|
||||
00000000800001c4 <test_19>:
|
||||
800001c4: 01300193 addi x3,x0,19
|
||||
800001c8: 30002573 csrrs x10,mstatus,x0
|
||||
800001cc: 0030059b addiw x11,x0,3
|
||||
800001d0: 02059593 slli x11,x11,0x20
|
||||
800001d4: 00b57533 and x10,x10,x11
|
||||
800001d8: 00000393 addi x7,x0,0
|
||||
800001dc: 22751863 bne x10,x7,8000040c <fail>
|
||||
|
||||
00000000800001e0 <test_25>:
|
||||
800001e0: 01900193 addi x3,x0,25
|
||||
800001e4: c0003073 csrrc x0,cycle,x0
|
||||
800001e8: 00000393 addi x7,x0,0
|
||||
800001ec: 22701063 bne x0,x7,8000040c <fail>
|
||||
|
||||
00000000800001f0 <test_26>:
|
||||
800001f0: 01a00193 addi x3,x0,26
|
||||
800001f4: c0002073 csrrs x0,cycle,x0
|
||||
800001f8: 00000393 addi x7,x0,0
|
||||
800001fc: 20701863 bne x0,x7,8000040c <fail>
|
||||
|
||||
0000000080000200 <test_27>:
|
||||
80000200: 01b00193 addi x3,x0,27
|
||||
80000204: c0007073 csrrci x0,cycle,0
|
||||
80000208: 00000393 addi x7,x0,0
|
||||
8000020c: 20701063 bne x0,x7,8000040c <fail>
|
||||
|
||||
0000000080000210 <test_28>:
|
||||
80000210: 01c00193 addi x3,x0,28
|
||||
80000214: c0006073 csrrsi x0,cycle,0
|
||||
80000218: 00000393 addi x7,x0,0
|
||||
8000021c: 1e701863 bne x0,x7,8000040c <fail>
|
||||
|
||||
0000000080000220 <test_20>:
|
||||
80000220: 01400193 addi x3,x0,20
|
||||
80000224: 34001073 csrrw x0,mscratch,x0
|
||||
80000228: 34002573 csrrs x10,mscratch,x0
|
||||
8000022c: 00000393 addi x7,x0,0
|
||||
80000230: 1c751e63 bne x10,x7,8000040c <fail>
|
||||
|
||||
0000000080000234 <test_21>:
|
||||
80000234: 01500193 addi x3,x0,21
|
||||
80000238: 34005573 csrrwi x10,mscratch,0
|
||||
8000023c: 3407d573 csrrwi x10,mscratch,15
|
||||
80000240: 00000393 addi x7,x0,0
|
||||
80000244: 1c751463 bne x10,x7,8000040c <fail>
|
||||
|
||||
0000000080000248 <test_22>:
|
||||
80000248: 01600193 addi x3,x0,22
|
||||
8000024c: 34086073 csrrsi x0,mscratch,16
|
||||
80000250: 34002573 csrrs x10,mscratch,x0
|
||||
80000254: 01f00393 addi x7,x0,31
|
||||
80000258: 1a751a63 bne x10,x7,8000040c <fail>
|
||||
8000025c: 3401d073 csrrwi x0,mscratch,3
|
||||
|
||||
0000000080000260 <test_2>:
|
||||
80000260: 00200193 addi x3,x0,2
|
||||
80000264: 34002573 csrrs x10,mscratch,x0
|
||||
80000268: 00300393 addi x7,x0,3
|
||||
8000026c: 1a751063 bne x10,x7,8000040c <fail>
|
||||
|
||||
0000000080000270 <test_3>:
|
||||
80000270: 00300193 addi x3,x0,3
|
||||
80000274: 3400f5f3 csrrci x11,mscratch,1
|
||||
80000278: 00300393 addi x7,x0,3
|
||||
8000027c: 18759863 bne x11,x7,8000040c <fail>
|
||||
|
||||
0000000080000280 <test_4>:
|
||||
80000280: 00400193 addi x3,x0,4
|
||||
80000284: 34026673 csrrsi x12,mscratch,4
|
||||
80000288: 00200393 addi x7,x0,2
|
||||
8000028c: 18761063 bne x12,x7,8000040c <fail>
|
||||
|
||||
0000000080000290 <test_5>:
|
||||
80000290: 00500193 addi x3,x0,5
|
||||
80000294: 340156f3 csrrwi x13,mscratch,2
|
||||
80000298: 00600393 addi x7,x0,6
|
||||
8000029c: 16769863 bne x13,x7,8000040c <fail>
|
||||
|
||||
00000000800002a0 <test_6>:
|
||||
800002a0: 00600193 addi x3,x0,6
|
||||
800002a4: 0bad2537 lui x10,0xbad2
|
||||
800002a8: dea5051b addiw x10,x10,-534 # bad1dea <_start-0x7452e216>
|
||||
800002ac: 340515f3 csrrw x11,mscratch,x10
|
||||
800002b0: 00200393 addi x7,x0,2
|
||||
800002b4: 14759c63 bne x11,x7,8000040c <fail>
|
||||
|
||||
00000000800002b8 <test_7>:
|
||||
800002b8: 00700193 addi x3,x0,7
|
||||
800002bc: 00002537 lui x10,0x2
|
||||
800002c0: dea5051b addiw x10,x10,-534 # 1dea <_start-0x7fffe216>
|
||||
800002c4: 340535f3 csrrc x11,mscratch,x10
|
||||
800002c8: 0bad23b7 lui x7,0xbad2
|
||||
800002cc: dea3839b addiw x7,x7,-534 # bad1dea <_start-0x7452e216>
|
||||
800002d0: 12759e63 bne x11,x7,8000040c <fail>
|
||||
|
||||
00000000800002d4 <test_8>:
|
||||
800002d4: 00800193 addi x3,x0,8
|
||||
800002d8: 0000c537 lui x10,0xc
|
||||
800002dc: eef5051b addiw x10,x10,-273 # beef <_start-0x7fff4111>
|
||||
800002e0: 340525f3 csrrs x11,mscratch,x10
|
||||
800002e4: 0bad03b7 lui x7,0xbad0
|
||||
800002e8: 12759263 bne x11,x7,8000040c <fail>
|
||||
|
||||
00000000800002ec <test_9>:
|
||||
800002ec: 00900193 addi x3,x0,9
|
||||
800002f0: 0bad2537 lui x10,0xbad2
|
||||
800002f4: dea5051b addiw x10,x10,-534 # bad1dea <_start-0x7452e216>
|
||||
800002f8: 34051573 csrrw x10,mscratch,x10
|
||||
800002fc: 0badc3b7 lui x7,0xbadc
|
||||
80000300: eef3839b addiw x7,x7,-273 # badbeef <_start-0x74524111>
|
||||
80000304: 10751463 bne x10,x7,8000040c <fail>
|
||||
|
||||
0000000080000308 <test_10>:
|
||||
80000308: 00a00193 addi x3,x0,10
|
||||
8000030c: 00002537 lui x10,0x2
|
||||
80000310: dea5051b addiw x10,x10,-534 # 1dea <_start-0x7fffe216>
|
||||
80000314: 34053573 csrrc x10,mscratch,x10
|
||||
80000318: 0bad23b7 lui x7,0xbad2
|
||||
8000031c: dea3839b addiw x7,x7,-534 # bad1dea <_start-0x7452e216>
|
||||
80000320: 0e751663 bne x10,x7,8000040c <fail>
|
||||
|
||||
0000000080000324 <test_11>:
|
||||
80000324: 00b00193 addi x3,x0,11
|
||||
80000328: 0000c537 lui x10,0xc
|
||||
8000032c: eef5051b addiw x10,x10,-273 # beef <_start-0x7fff4111>
|
||||
80000330: 34052573 csrrs x10,mscratch,x10
|
||||
80000334: 0bad03b7 lui x7,0xbad0
|
||||
80000338: 0c751a63 bne x10,x7,8000040c <fail>
|
||||
|
||||
000000008000033c <test_12>:
|
||||
8000033c: 00c00193 addi x3,x0,12
|
||||
80000340: 34002573 csrrs x10,mscratch,x0
|
||||
80000344: 0badc3b7 lui x7,0xbadc
|
||||
80000348: eef3839b addiw x7,x7,-273 # badbeef <_start-0x74524111>
|
||||
8000034c: 0c751063 bne x10,x7,8000040c <fail>
|
||||
80000350: 30102573 csrrs x10,misa,x0
|
||||
80000354: 02057513 andi x10,x10,32
|
||||
80000358: 02050863 beq x10,x0,80000388 <test_13+0x14>
|
||||
8000035c: 000065b7 lui x11,0x6
|
||||
80000360: 3005a073 csrrs x0,mstatus,x11
|
||||
80000364: f0000053 fmv.w.x f0,x0
|
||||
80000368: 3005b073 csrrc x0,mstatus,x11
|
||||
8000036c: 00002597 auipc x11,0x2
|
||||
80000370: c9458593 addi x11,x11,-876 # 80002000 <begin_signature>
|
||||
|
||||
0000000080000374 <test_13>:
|
||||
80000374: 00d00193 addi x3,x0,13
|
||||
80000378: 0005a027 fsw f0,0(x11)
|
||||
8000037c: 0005a503 lw x10,0(x11)
|
||||
80000380: 00100393 addi x7,x0,1
|
||||
80000384: 08751463 bne x10,x7,8000040c <fail>
|
||||
80000388: 30102573 csrrs x10,misa,x0
|
||||
8000038c: 01455513 srli x10,x10,0x14
|
||||
80000390: 00157513 andi x10,x10,1
|
||||
80000394: 06050063 beq x10,x0,800003f4 <finish>
|
||||
80000398: 3060d073 csrrwi x0,mcounteren,1
|
||||
8000039c: 30102573 csrrs x10,misa,x0
|
||||
800003a0: 01255513 srli x10,x10,0x12
|
||||
800003a4: 00157513 andi x10,x10,1
|
||||
800003a8: 00050463 beq x10,x0,800003b0 <test_13+0x3c>
|
||||
800003ac: 1060d073 csrrwi x0,scounteren,1
|
||||
800003b0: 000022b7 lui x5,0x2
|
||||
800003b4: 8002829b addiw x5,x5,-2048 # 1800 <_start-0x7fffe800>
|
||||
800003b8: 3002b073 csrrc x0,mstatus,x5
|
||||
800003bc: 00000297 auipc x5,0x0
|
||||
800003c0: 01028293 addi x5,x5,16 # 800003cc <test_14>
|
||||
800003c4: 34129073 csrrw x0,mepc,x5
|
||||
800003c8: 30200073 mret
|
||||
|
||||
00000000800003cc <test_14>:
|
||||
800003cc: 00e00193 addi x3,x0,14
|
||||
800003d0: 0ff00513 addi x10,x0,255
|
||||
800003d4: c0001573 csrrw x10,cycle,x0
|
||||
800003d8: 0ff00393 addi x7,x0,255
|
||||
800003dc: 02751863 bne x10,x7,8000040c <fail>
|
||||
|
||||
00000000800003e0 <test_15>:
|
||||
800003e0: 00f00193 addi x3,x0,15
|
||||
800003e4: 0ff00513 addi x10,x0,255
|
||||
800003e8: 30002573 csrrs x10,mstatus,x0
|
||||
800003ec: 0ff00393 addi x7,x0,255
|
||||
800003f0: 00751e63 bne x10,x7,8000040c <fail>
|
||||
|
||||
00000000800003f4 <finish>:
|
||||
800003f4: 0ff0000f fence iorw,iorw
|
||||
800003f8: 00100193 addi x3,x0,1
|
||||
800003fc: 05d00893 addi x17,x0,93
|
||||
80000400: 00000513 addi x10,x0,0
|
||||
80000404: 00000073 ecall
|
||||
80000408: 02301063 bne x0,x3,80000428 <pass>
|
||||
|
||||
000000008000040c <fail>:
|
||||
8000040c: 0ff0000f fence iorw,iorw
|
||||
80000410: 00018063 beq x3,x0,80000410 <fail+0x4>
|
||||
80000414: 00119193 slli x3,x3,0x1
|
||||
80000418: 0011e193 ori x3,x3,1
|
||||
8000041c: 05d00893 addi x17,x0,93
|
||||
80000420: 00018513 addi x10,x3,0
|
||||
80000424: 00000073 ecall
|
||||
|
||||
0000000080000428 <pass>:
|
||||
80000428: 0ff0000f fence iorw,iorw
|
||||
8000042c: 00100193 addi x3,x0,1
|
||||
80000430: 05d00893 addi x17,x0,93
|
||||
80000434: 00000513 addi x10,x0,0
|
||||
80000438: 00000073 ecall
|
||||
|
||||
000000008000043c <mtvec_handler>:
|
||||
8000043c: 00d00293 addi x5,x0,13
|
||||
80000440: 0051e663 bltu x3,x5,8000044c <mtvec_handler+0x10>
|
||||
80000444: 00f00293 addi x5,x0,15
|
||||
80000448: 0232f263 bgeu x5,x3,8000046c <privileged>
|
||||
8000044c: 342022f3 csrrs x5,mcause,x0
|
||||
80000450: 00800313 addi x6,x0,8
|
||||
80000454: fa629ce3 bne x5,x6,8000040c <fail>
|
||||
80000458: 0ff0000f fence iorw,iorw
|
||||
8000045c: 00100193 addi x3,x0,1
|
||||
80000460: 05d00893 addi x17,x0,93
|
||||
80000464: 00000513 addi x10,x0,0
|
||||
80000468: 00000073 ecall
|
||||
|
||||
000000008000046c <privileged>:
|
||||
8000046c: 342022f3 csrrs x5,mcause,x0
|
||||
80000470: 00200313 addi x6,x0,2
|
||||
80000474: f8629ce3 bne x5,x6,8000040c <fail>
|
||||
80000478: 341022f3 csrrs x5,mepc,x0
|
||||
8000047c: 00428293 addi x5,x5,4
|
||||
80000480: 34129073 csrrw x0,mepc,x5
|
||||
80000484: 30200073 mret
|
||||
80000488: c0001073 unimp
|
||||
...
|
||||
@ -0,0 +1,309 @@
|
||||
|
||||
./rv64mi-p-illegal: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 04c0006f jal x0,8000004c <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0a63 beq x30,x31,80000040 <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0663 beq x30,x31,80000040 <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0263 beq x30,x31,80000040 <write_tohost>
|
||||
80000020: 00000f17 auipc x30,0x0
|
||||
80000024: 2e0f0f13 addi x30,x30,736 # 80000300 <mtvec_handler>
|
||||
80000028: 000f0463 beq x30,x0,80000030 <trap_vector+0x2c>
|
||||
8000002c: 000f0067 jalr x0,0(x30)
|
||||
80000030: 34202f73 csrrs x30,mcause,x0
|
||||
80000034: 000f5463 bge x30,x0,8000003c <handle_exception>
|
||||
80000038: 0040006f jal x0,8000003c <handle_exception>
|
||||
|
||||
000000008000003c <handle_exception>:
|
||||
8000003c: 5391e193 ori x3,x3,1337
|
||||
|
||||
0000000080000040 <write_tohost>:
|
||||
80000040: 00001f17 auipc x30,0x1
|
||||
80000044: fc3f2023 sw x3,-64(x30) # 80001000 <tohost>
|
||||
80000048: ff9ff06f jal x0,80000040 <write_tohost>
|
||||
|
||||
000000008000004c <reset_vector>:
|
||||
8000004c: 00000093 addi x1,x0,0
|
||||
80000050: 00000113 addi x2,x0,0
|
||||
80000054: 00000193 addi x3,x0,0
|
||||
80000058: 00000213 addi x4,x0,0
|
||||
8000005c: 00000293 addi x5,x0,0
|
||||
80000060: 00000313 addi x6,x0,0
|
||||
80000064: 00000393 addi x7,x0,0
|
||||
80000068: 00000413 addi x8,x0,0
|
||||
8000006c: 00000493 addi x9,x0,0
|
||||
80000070: 00000513 addi x10,x0,0
|
||||
80000074: 00000593 addi x11,x0,0
|
||||
80000078: 00000613 addi x12,x0,0
|
||||
8000007c: 00000693 addi x13,x0,0
|
||||
80000080: 00000713 addi x14,x0,0
|
||||
80000084: 00000793 addi x15,x0,0
|
||||
80000088: 00000813 addi x16,x0,0
|
||||
8000008c: 00000893 addi x17,x0,0
|
||||
80000090: 00000913 addi x18,x0,0
|
||||
80000094: 00000993 addi x19,x0,0
|
||||
80000098: 00000a13 addi x20,x0,0
|
||||
8000009c: 00000a93 addi x21,x0,0
|
||||
800000a0: 00000b13 addi x22,x0,0
|
||||
800000a4: 00000b93 addi x23,x0,0
|
||||
800000a8: 00000c13 addi x24,x0,0
|
||||
800000ac: 00000c93 addi x25,x0,0
|
||||
800000b0: 00000d13 addi x26,x0,0
|
||||
800000b4: 00000d93 addi x27,x0,0
|
||||
800000b8: 00000e13 addi x28,x0,0
|
||||
800000bc: 00000e93 addi x29,x0,0
|
||||
800000c0: 00000f13 addi x30,x0,0
|
||||
800000c4: 00000f93 addi x31,x0,0
|
||||
800000c8: f1402573 csrrs x10,mhartid,x0
|
||||
800000cc: 00051063 bne x10,x0,800000cc <reset_vector+0x80>
|
||||
800000d0: 00000297 auipc x5,0x0
|
||||
800000d4: 01028293 addi x5,x5,16 # 800000e0 <reset_vector+0x94>
|
||||
800000d8: 30529073 csrrw x0,mtvec,x5
|
||||
800000dc: 18005073 csrrwi x0,satp,0
|
||||
800000e0: 00000297 auipc x5,0x0
|
||||
800000e4: 02428293 addi x5,x5,36 # 80000104 <reset_vector+0xb8>
|
||||
800000e8: 30529073 csrrw x0,mtvec,x5
|
||||
800000ec: 0010029b addiw x5,x0,1
|
||||
800000f0: 03529293 slli x5,x5,0x35
|
||||
800000f4: fff28293 addi x5,x5,-1
|
||||
800000f8: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000fc: 01f00293 addi x5,x0,31
|
||||
80000100: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000104: 30405073 csrrwi x0,mie,0
|
||||
80000108: 00000297 auipc x5,0x0
|
||||
8000010c: 01428293 addi x5,x5,20 # 8000011c <reset_vector+0xd0>
|
||||
80000110: 30529073 csrrw x0,mtvec,x5
|
||||
80000114: 30205073 csrrwi x0,medeleg,0
|
||||
80000118: 30305073 csrrwi x0,mideleg,0
|
||||
8000011c: 00000193 addi x3,x0,0
|
||||
80000120: 00000297 auipc x5,0x0
|
||||
80000124: ee428293 addi x5,x5,-284 # 80000004 <trap_vector>
|
||||
80000128: 30529073 csrrw x0,mtvec,x5
|
||||
8000012c: 00100513 addi x10,x0,1
|
||||
80000130: 01f51513 slli x10,x10,0x1f
|
||||
80000134: 00055c63 bge x10,x0,8000014c <reset_vector+0x100>
|
||||
80000138: 0ff0000f fence iorw,iorw
|
||||
8000013c: 00100193 addi x3,x0,1
|
||||
80000140: 05d00893 addi x17,x0,93
|
||||
80000144: 00000513 addi x10,x0,0
|
||||
80000148: 00000073 ecall
|
||||
8000014c: 00000293 addi x5,x0,0
|
||||
80000150: 00028a63 beq x5,x0,80000164 <reset_vector+0x118>
|
||||
80000154: 10529073 csrrw x0,stvec,x5
|
||||
80000158: 0000b2b7 lui x5,0xb
|
||||
8000015c: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
80000160: 30229073 csrrw x0,medeleg,x5
|
||||
80000164: 30005073 csrrwi x0,mstatus,0
|
||||
80000168: 00002537 lui x10,0x2
|
||||
8000016c: 8005051b addiw x10,x10,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000170: 30052073 csrrs x0,mstatus,x10
|
||||
80000174: 00000297 auipc x5,0x0
|
||||
80000178: 01428293 addi x5,x5,20 # 80000188 <reset_vector+0x13c>
|
||||
8000017c: 34129073 csrrw x0,mepc,x5
|
||||
80000180: f1402573 csrrs x10,mhartid,x0
|
||||
80000184: 30200073 mret
|
||||
80000188: 00200193 addi x3,x0,2
|
||||
|
||||
000000008000018c <bad2>:
|
||||
8000018c: 00000000 .word 0x00000000
|
||||
80000190: 1300006f jal x0,800002c0 <fail>
|
||||
80000194: 000022b7 lui x5,0x2
|
||||
80000198: 8002829b addiw x5,x5,-2048 # 1800 <_start-0x7fffe800>
|
||||
8000019c: 3002b073 csrrc x0,mstatus,x5
|
||||
800001a0: 00001337 lui x6,0x1
|
||||
800001a4: 8003031b addiw x6,x6,-2048 # 800 <_start-0x7ffff800>
|
||||
800001a8: 30032073 csrrs x0,mstatus,x6
|
||||
800001ac: 300023f3 csrrs x7,mstatus,x0
|
||||
800001b0: 0053f3b3 and x7,x7,x5
|
||||
800001b4: 12731463 bne x6,x7,800002dc <pass>
|
||||
|
||||
00000000800001b8 <test_vectored_interrupts>:
|
||||
800001b8: 34415073 csrrwi x0,mip,2
|
||||
800001bc: 30415073 csrrwi x0,mie,2
|
||||
800001c0: 00000297 auipc x5,0x0
|
||||
800001c4: 14128293 addi x5,x5,321 # 80000301 <mtvec_handler+0x1>
|
||||
800001c8: 30529473 csrrw x8,mtvec,x5
|
||||
800001cc: 305022f3 csrrs x5,mtvec,x0
|
||||
800001d0: 0012f293 andi x5,x5,1
|
||||
800001d4: 00028663 beq x5,x0,800001e0 <msip>
|
||||
800001d8: 30046073 csrrsi x0,mstatus,8
|
||||
800001dc: 0000006f jal x0,800001dc <test_vectored_interrupts+0x24>
|
||||
|
||||
00000000800001e0 <msip>:
|
||||
800001e0: 30541073 csrrw x0,mtvec,x8
|
||||
800001e4: 30315073 csrrwi x0,mideleg,2
|
||||
800001e8: 00000297 auipc x5,0x0
|
||||
800001ec: 02828293 addi x5,x5,40 # 80000210 <msip+0x30>
|
||||
800001f0: 34129073 csrrw x0,mepc,x5
|
||||
800001f4: 000022b7 lui x5,0x2
|
||||
800001f8: 8002829b addiw x5,x5,-2048 # 1800 <_start-0x7fffe800>
|
||||
800001fc: 3002b073 csrrc x0,mstatus,x5
|
||||
80000200: 00001337 lui x6,0x1
|
||||
80000204: 8003031b addiw x6,x6,-2048 # 800 <_start-0x7ffff800>
|
||||
80000208: 30032073 csrrs x0,mstatus,x6
|
||||
8000020c: 30200073 mret
|
||||
80000210: 10500073 wfi
|
||||
80000214: 0002f2b3 and x5,x5,x0
|
||||
80000218: 000c02b7 lui x5,0xc0
|
||||
8000021c: 1002b073 csrrc x0,sstatus,x5
|
||||
80000220: 00037333 and x6,x6,x0
|
||||
80000224: 000c0337 lui x6,0xc0
|
||||
80000228: 10032073 csrrs x0,sstatus,x6
|
||||
8000022c: 100023f3 csrrs x7,sstatus,x0
|
||||
80000230: 0053f3b3 and x7,x7,x5
|
||||
80000234: 06038463 beq x7,x0,8000029c <bare_s_1>
|
||||
80000238: 1002b073 csrrc x0,sstatus,x5
|
||||
8000023c: 12000073 sfence.vma x0,x0
|
||||
80000240: 180022f3 csrrs x5,satp,x0
|
||||
|
||||
0000000080000244 <bad5>:
|
||||
80000244: 00000000 .word 0x00000000
|
||||
80000248: 0780006f jal x0,800002c0 <fail>
|
||||
|
||||
000000008000024c <bad6>:
|
||||
8000024c: 12000073 sfence.vma x0,x0
|
||||
80000250: 0700006f jal x0,800002c0 <fail>
|
||||
|
||||
0000000080000254 <bad7>:
|
||||
80000254: 180022f3 csrrs x5,satp,x0
|
||||
80000258: 0680006f jal x0,800002c0 <fail>
|
||||
|
||||
000000008000025c <test_tsr>:
|
||||
8000025c: 00000297 auipc x5,0x0
|
||||
80000260: 02028293 addi x5,x5,32 # 8000027c <bad8>
|
||||
80000264: 14129073 csrrw x0,sepc,x5
|
||||
80000268: 10000293 addi x5,x0,256
|
||||
8000026c: 1002a073 csrrs x0,sstatus,x5
|
||||
80000270: 02000293 addi x5,x0,32
|
||||
80000274: 1002b073 csrrc x0,sstatus,x5
|
||||
80000278: 10200073 sret
|
||||
|
||||
000000008000027c <bad8>:
|
||||
8000027c: 00000000 .word 0x00000000
|
||||
80000280: 0400006f jal x0,800002c0 <fail>
|
||||
80000284: 00000297 auipc x5,0x0
|
||||
80000288: 01028293 addi x5,x5,16 # 80000294 <bad9+0x4>
|
||||
8000028c: 14129073 csrrw x0,sepc,x5
|
||||
|
||||
0000000080000290 <bad9>:
|
||||
80000290: 10200073 sret
|
||||
80000294: 02c0006f jal x0,800002c0 <fail>
|
||||
80000298: 0240006f jal x0,800002bc <skip_bare_s>
|
||||
|
||||
000000008000029c <bare_s_1>:
|
||||
8000029c: 12000073 sfence.vma x0,x0
|
||||
800002a0: 0200006f jal x0,800002c0 <fail>
|
||||
|
||||
00000000800002a4 <bare_s_2>:
|
||||
800002a4: 12000073 sfence.vma x0,x0
|
||||
800002a8: 0180006f jal x0,800002c0 <fail>
|
||||
800002ac: 180022f3 csrrs x5,satp,x0
|
||||
|
||||
00000000800002b0 <bare_s_3>:
|
||||
800002b0: 00000000 .word 0x00000000
|
||||
800002b4: 00c0006f jal x0,800002c0 <fail>
|
||||
800002b8: fa5ff06f jal x0,8000025c <test_tsr>
|
||||
|
||||
00000000800002bc <skip_bare_s>:
|
||||
800002bc: 02301063 bne x0,x3,800002dc <pass>
|
||||
|
||||
00000000800002c0 <fail>:
|
||||
800002c0: 0ff0000f fence iorw,iorw
|
||||
800002c4: 00018063 beq x3,x0,800002c4 <fail+0x4>
|
||||
800002c8: 00119193 slli x3,x3,0x1
|
||||
800002cc: 0011e193 ori x3,x3,1
|
||||
800002d0: 05d00893 addi x17,x0,93
|
||||
800002d4: 00018513 addi x10,x3,0
|
||||
800002d8: 00000073 ecall
|
||||
|
||||
00000000800002dc <pass>:
|
||||
800002dc: 0ff0000f fence iorw,iorw
|
||||
800002e0: 00100193 addi x3,x0,1
|
||||
800002e4: 05d00893 addi x17,x0,93
|
||||
800002e8: 00000513 addi x10,x0,0
|
||||
800002ec: 00000073 ecall
|
||||
800002f0: 00000013 addi x0,x0,0
|
||||
800002f4: 00000013 addi x0,x0,0
|
||||
800002f8: 00000013 addi x0,x0,0
|
||||
800002fc: 00000013 addi x0,x0,0
|
||||
|
||||
0000000080000300 <mtvec_handler>:
|
||||
80000300: 0400006f jal x0,80000340 <synchronous_exception>
|
||||
80000304: eddff06f jal x0,800001e0 <msip>
|
||||
80000308: fb9ff06f jal x0,800002c0 <fail>
|
||||
8000030c: fb5ff06f jal x0,800002c0 <fail>
|
||||
80000310: fb1ff06f jal x0,800002c0 <fail>
|
||||
80000314: fadff06f jal x0,800002c0 <fail>
|
||||
80000318: fa9ff06f jal x0,800002c0 <fail>
|
||||
8000031c: fa5ff06f jal x0,800002c0 <fail>
|
||||
80000320: fa1ff06f jal x0,800002c0 <fail>
|
||||
80000324: f9dff06f jal x0,800002c0 <fail>
|
||||
80000328: f99ff06f jal x0,800002c0 <fail>
|
||||
8000032c: f95ff06f jal x0,800002c0 <fail>
|
||||
80000330: f91ff06f jal x0,800002c0 <fail>
|
||||
80000334: f8dff06f jal x0,800002c0 <fail>
|
||||
80000338: f89ff06f jal x0,800002c0 <fail>
|
||||
8000033c: f85ff06f jal x0,800002c0 <fail>
|
||||
|
||||
0000000080000340 <synchronous_exception>:
|
||||
80000340: 00200313 addi x6,x0,2
|
||||
80000344: 342022f3 csrrs x5,mcause,x0
|
||||
80000348: f6629ce3 bne x5,x6,800002c0 <fail>
|
||||
8000034c: 341022f3 csrrs x5,mepc,x0
|
||||
80000350: 343023f3 csrrs x7,mtval,x0
|
||||
80000354: 00038e63 beq x7,x0,80000370 <synchronous_exception+0x30>
|
||||
80000358: 0002d303 lhu x6,0(x5)
|
||||
8000035c: 0063c3b3 xor x7,x7,x6
|
||||
80000360: 0022d303 lhu x6,2(x5)
|
||||
80000364: 01031313 slli x6,x6,0x10
|
||||
80000368: 0063c3b3 xor x7,x7,x6
|
||||
8000036c: f4039ae3 bne x7,x0,800002c0 <fail>
|
||||
80000370: 00000317 auipc x6,0x0
|
||||
80000374: e1c30313 addi x6,x6,-484 # 8000018c <bad2>
|
||||
80000378: 06628463 beq x5,x6,800003e0 <synchronous_exception+0xa0>
|
||||
8000037c: 00000317 auipc x6,0x0
|
||||
80000380: ec830313 addi x6,x6,-312 # 80000244 <bad5>
|
||||
80000384: 06628463 beq x5,x6,800003ec <synchronous_exception+0xac>
|
||||
80000388: 00000317 auipc x6,0x0
|
||||
8000038c: ec430313 addi x6,x6,-316 # 8000024c <bad6>
|
||||
80000390: 04628863 beq x5,x6,800003e0 <synchronous_exception+0xa0>
|
||||
80000394: 00000317 auipc x6,0x0
|
||||
80000398: ec030313 addi x6,x6,-320 # 80000254 <bad7>
|
||||
8000039c: 04628263 beq x5,x6,800003e0 <synchronous_exception+0xa0>
|
||||
800003a0: 00000317 auipc x6,0x0
|
||||
800003a4: edc30313 addi x6,x6,-292 # 8000027c <bad8>
|
||||
800003a8: 04628863 beq x5,x6,800003f8 <synchronous_exception+0xb8>
|
||||
800003ac: 00000317 auipc x6,0x0
|
||||
800003b0: ee430313 addi x6,x6,-284 # 80000290 <bad9>
|
||||
800003b4: 04628863 beq x5,x6,80000404 <synchronous_exception+0xc4>
|
||||
800003b8: 00000317 auipc x6,0x0
|
||||
800003bc: ee430313 addi x6,x6,-284 # 8000029c <bare_s_1>
|
||||
800003c0: 02628663 beq x5,x6,800003ec <synchronous_exception+0xac>
|
||||
800003c4: 00000317 auipc x6,0x0
|
||||
800003c8: ee030313 addi x6,x6,-288 # 800002a4 <bare_s_2>
|
||||
800003cc: 00628a63 beq x5,x6,800003e0 <synchronous_exception+0xa0>
|
||||
800003d0: 00000317 auipc x6,0x0
|
||||
800003d4: ee030313 addi x6,x6,-288 # 800002b0 <bare_s_3>
|
||||
800003d8: 00628463 beq x5,x6,800003e0 <synchronous_exception+0xa0>
|
||||
800003dc: ee5ff06f jal x0,800002c0 <fail>
|
||||
800003e0: 00828293 addi x5,x5,8
|
||||
800003e4: 34129073 csrrw x0,mepc,x5
|
||||
800003e8: 30200073 mret
|
||||
800003ec: 00100337 lui x6,0x100
|
||||
800003f0: 30032073 csrrs x0,mstatus,x6
|
||||
800003f4: fedff06f jal x0,800003e0 <synchronous_exception+0xa0>
|
||||
800003f8: 00400337 lui x6,0x400
|
||||
800003fc: 30032073 csrrs x0,mstatus,x6
|
||||
80000400: fe1ff06f jal x0,800003e0 <synchronous_exception+0xa0>
|
||||
80000404: fddff06f jal x0,800003e0 <synchronous_exception+0xa0>
|
||||
80000408: c0001073 unimp
|
||||
...
|
||||
@ -0,0 +1,306 @@
|
||||
|
||||
./rv64mi-p-ld-misaligned: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 04c0006f jal x0,8000004c <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0a63 beq x30,x31,80000040 <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0663 beq x30,x31,80000040 <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0263 beq x30,x31,80000040 <write_tohost>
|
||||
80000020: 00000f17 auipc x30,0x0
|
||||
80000024: 3ecf0f13 addi x30,x30,1004 # 8000040c <mtvec_handler>
|
||||
80000028: 000f0463 beq x30,x0,80000030 <trap_vector+0x2c>
|
||||
8000002c: 000f0067 jalr x0,0(x30)
|
||||
80000030: 34202f73 csrrs x30,mcause,x0
|
||||
80000034: 000f5463 bge x30,x0,8000003c <handle_exception>
|
||||
80000038: 0040006f jal x0,8000003c <handle_exception>
|
||||
|
||||
000000008000003c <handle_exception>:
|
||||
8000003c: 5391e193 ori x3,x3,1337
|
||||
|
||||
0000000080000040 <write_tohost>:
|
||||
80000040: 00001f17 auipc x30,0x1
|
||||
80000044: fc3f2023 sw x3,-64(x30) # 80001000 <tohost>
|
||||
80000048: ff9ff06f jal x0,80000040 <write_tohost>
|
||||
|
||||
000000008000004c <reset_vector>:
|
||||
8000004c: 00000093 addi x1,x0,0
|
||||
80000050: 00000113 addi x2,x0,0
|
||||
80000054: 00000193 addi x3,x0,0
|
||||
80000058: 00000213 addi x4,x0,0
|
||||
8000005c: 00000293 addi x5,x0,0
|
||||
80000060: 00000313 addi x6,x0,0
|
||||
80000064: 00000393 addi x7,x0,0
|
||||
80000068: 00000413 addi x8,x0,0
|
||||
8000006c: 00000493 addi x9,x0,0
|
||||
80000070: 00000513 addi x10,x0,0
|
||||
80000074: 00000593 addi x11,x0,0
|
||||
80000078: 00000613 addi x12,x0,0
|
||||
8000007c: 00000693 addi x13,x0,0
|
||||
80000080: 00000713 addi x14,x0,0
|
||||
80000084: 00000793 addi x15,x0,0
|
||||
80000088: 00000813 addi x16,x0,0
|
||||
8000008c: 00000893 addi x17,x0,0
|
||||
80000090: 00000913 addi x18,x0,0
|
||||
80000094: 00000993 addi x19,x0,0
|
||||
80000098: 00000a13 addi x20,x0,0
|
||||
8000009c: 00000a93 addi x21,x0,0
|
||||
800000a0: 00000b13 addi x22,x0,0
|
||||
800000a4: 00000b93 addi x23,x0,0
|
||||
800000a8: 00000c13 addi x24,x0,0
|
||||
800000ac: 00000c93 addi x25,x0,0
|
||||
800000b0: 00000d13 addi x26,x0,0
|
||||
800000b4: 00000d93 addi x27,x0,0
|
||||
800000b8: 00000e13 addi x28,x0,0
|
||||
800000bc: 00000e93 addi x29,x0,0
|
||||
800000c0: 00000f13 addi x30,x0,0
|
||||
800000c4: 00000f93 addi x31,x0,0
|
||||
800000c8: f1402573 csrrs x10,mhartid,x0
|
||||
800000cc: 00051063 bne x10,x0,800000cc <reset_vector+0x80>
|
||||
800000d0: 00000297 auipc x5,0x0
|
||||
800000d4: 01028293 addi x5,x5,16 # 800000e0 <reset_vector+0x94>
|
||||
800000d8: 30529073 csrrw x0,mtvec,x5
|
||||
800000dc: 18005073 csrrwi x0,satp,0
|
||||
800000e0: 00000297 auipc x5,0x0
|
||||
800000e4: 02428293 addi x5,x5,36 # 80000104 <reset_vector+0xb8>
|
||||
800000e8: 30529073 csrrw x0,mtvec,x5
|
||||
800000ec: 0010029b addiw x5,x0,1
|
||||
800000f0: 03529293 slli x5,x5,0x35
|
||||
800000f4: fff28293 addi x5,x5,-1
|
||||
800000f8: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000fc: 01f00293 addi x5,x0,31
|
||||
80000100: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000104: 30405073 csrrwi x0,mie,0
|
||||
80000108: 00000297 auipc x5,0x0
|
||||
8000010c: 01428293 addi x5,x5,20 # 8000011c <reset_vector+0xd0>
|
||||
80000110: 30529073 csrrw x0,mtvec,x5
|
||||
80000114: 30205073 csrrwi x0,medeleg,0
|
||||
80000118: 30305073 csrrwi x0,mideleg,0
|
||||
8000011c: 00000193 addi x3,x0,0
|
||||
80000120: 00000297 auipc x5,0x0
|
||||
80000124: ee428293 addi x5,x5,-284 # 80000004 <trap_vector>
|
||||
80000128: 30529073 csrrw x0,mtvec,x5
|
||||
8000012c: 00100513 addi x10,x0,1
|
||||
80000130: 01f51513 slli x10,x10,0x1f
|
||||
80000134: 00055c63 bge x10,x0,8000014c <reset_vector+0x100>
|
||||
80000138: 0ff0000f fence iorw,iorw
|
||||
8000013c: 00100193 addi x3,x0,1
|
||||
80000140: 05d00893 addi x17,x0,93
|
||||
80000144: 00000513 addi x10,x0,0
|
||||
80000148: 00000073 ecall
|
||||
8000014c: 00000293 addi x5,x0,0
|
||||
80000150: 00028a63 beq x5,x0,80000164 <reset_vector+0x118>
|
||||
80000154: 10529073 csrrw x0,stvec,x5
|
||||
80000158: 0000b2b7 lui x5,0xb
|
||||
8000015c: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
80000160: 30229073 csrrw x0,medeleg,x5
|
||||
80000164: 30005073 csrrwi x0,mstatus,0
|
||||
80000168: 00002537 lui x10,0x2
|
||||
8000016c: 8005051b addiw x10,x10,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000170: 30052073 csrrs x0,mstatus,x10
|
||||
80000174: 00000297 auipc x5,0x0
|
||||
80000178: 01428293 addi x5,x5,20 # 80000188 <test_2>
|
||||
8000017c: 34129073 csrrw x0,mepc,x5
|
||||
80000180: f1402573 csrrs x10,mhartid,x0
|
||||
80000184: 30200073 mret
|
||||
|
||||
0000000080000188 <test_2>:
|
||||
80000188: 00200193 addi x3,x0,2
|
||||
8000018c: 080707b7 lui x15,0x8070
|
||||
80000190: 6057879b addiw x15,x15,1541 # 8070605 <_start-0x77f8f9fb>
|
||||
80000194: 01079793 slli x15,x15,0x10
|
||||
80000198: 40378793 addi x15,x15,1027
|
||||
8000019c: 01079793 slli x15,x15,0x10
|
||||
800001a0: 20178793 addi x15,x15,513
|
||||
800001a4: 00002097 auipc x1,0x2
|
||||
800001a8: e5c08093 addi x1,x1,-420 # 80002000 <begin_signature>
|
||||
800001ac: 0000b703 ld x14,0(x1)
|
||||
800001b0: 080703b7 lui x7,0x8070
|
||||
800001b4: 6053839b addiw x7,x7,1541 # 8070605 <_start-0x77f8f9fb>
|
||||
800001b8: 01039393 slli x7,x7,0x10
|
||||
800001bc: 40338393 addi x7,x7,1027
|
||||
800001c0: 01039393 slli x7,x7,0x10
|
||||
800001c4: 20138393 addi x7,x7,513
|
||||
800001c8: 20771a63 bne x14,x7,800003dc <fail>
|
||||
|
||||
00000000800001cc <test_3>:
|
||||
800001cc: 00300193 addi x3,x0,3
|
||||
800001d0: 048407b7 lui x15,0x4840
|
||||
800001d4: 3837879b addiw x15,x15,899 # 4840383 <_start-0x7b7bfc7d>
|
||||
800001d8: 00f79793 slli x15,x15,0xf
|
||||
800001dc: 14178793 addi x15,x15,321
|
||||
800001e0: 01279793 slli x15,x15,0x12
|
||||
800001e4: 30278793 addi x15,x15,770
|
||||
800001e8: 00002097 auipc x1,0x2
|
||||
800001ec: e1808093 addi x1,x1,-488 # 80002000 <begin_signature>
|
||||
800001f0: 0010b703 ld x14,1(x1)
|
||||
800001f4: 048403b7 lui x7,0x4840
|
||||
800001f8: 3833839b addiw x7,x7,899 # 4840383 <_start-0x7b7bfc7d>
|
||||
800001fc: 00f39393 slli x7,x7,0xf
|
||||
80000200: 14138393 addi x7,x7,321
|
||||
80000204: 01239393 slli x7,x7,0x12
|
||||
80000208: 30238393 addi x7,x7,770
|
||||
8000020c: 1c771863 bne x14,x7,800003dc <fail>
|
||||
|
||||
0000000080000210 <test_4>:
|
||||
80000210: 00400193 addi x3,x0,4
|
||||
80000214: 0a0917b7 lui x15,0xa091
|
||||
80000218: 8077879b addiw x15,x15,-2041 # a090807 <_start-0x75f6f7f9>
|
||||
8000021c: 01079793 slli x15,x15,0x10
|
||||
80000220: 60578793 addi x15,x15,1541
|
||||
80000224: 01079793 slli x15,x15,0x10
|
||||
80000228: 40378793 addi x15,x15,1027
|
||||
8000022c: 00002097 auipc x1,0x2
|
||||
80000230: dd408093 addi x1,x1,-556 # 80002000 <begin_signature>
|
||||
80000234: 0020b703 ld x14,2(x1)
|
||||
80000238: 0a0913b7 lui x7,0xa091
|
||||
8000023c: 8073839b addiw x7,x7,-2041 # a090807 <_start-0x75f6f7f9>
|
||||
80000240: 01039393 slli x7,x7,0x10
|
||||
80000244: 60538393 addi x7,x7,1541
|
||||
80000248: 01039393 slli x7,x7,0x10
|
||||
8000024c: 40338393 addi x7,x7,1027
|
||||
80000250: 18771663 bne x14,x7,800003dc <fail>
|
||||
|
||||
0000000080000254 <test_5>:
|
||||
80000254: 00500193 addi x3,x0,5
|
||||
80000258: 016147b7 lui x15,0x1614
|
||||
8000025c: 1217879b addiw x15,x15,289 # 1614121 <_start-0x7e9ebedf>
|
||||
80000260: 01279793 slli x15,x15,0x12
|
||||
80000264: 38378793 addi x15,x15,899
|
||||
80000268: 01179793 slli x15,x15,0x11
|
||||
8000026c: 50478793 addi x15,x15,1284
|
||||
80000270: 00002097 auipc x1,0x2
|
||||
80000274: d9008093 addi x1,x1,-624 # 80002000 <begin_signature>
|
||||
80000278: 0030b703 ld x14,3(x1)
|
||||
8000027c: 016143b7 lui x7,0x1614
|
||||
80000280: 1213839b addiw x7,x7,289 # 1614121 <_start-0x7e9ebedf>
|
||||
80000284: 01239393 slli x7,x7,0x12
|
||||
80000288: 38338393 addi x7,x7,899
|
||||
8000028c: 01139393 slli x7,x7,0x11
|
||||
80000290: 50438393 addi x7,x7,1284
|
||||
80000294: 14771463 bne x14,x7,800003dc <fail>
|
||||
|
||||
0000000080000298 <test_6>:
|
||||
80000298: 00600193 addi x3,x0,6
|
||||
8000029c: 000607b7 lui x15,0x60
|
||||
800002a0: 5857879b addiw x15,x15,1413 # 60585 <_start-0x7ff9fa7b>
|
||||
800002a4: 00d79793 slli x15,x15,0xd
|
||||
800002a8: 09178793 addi x15,x15,145
|
||||
800002ac: 00c79793 slli x15,x15,0xc
|
||||
800002b0: 80778793 addi x15,x15,-2041
|
||||
800002b4: 01079793 slli x15,x15,0x10
|
||||
800002b8: 60578793 addi x15,x15,1541
|
||||
800002bc: 00002097 auipc x1,0x2
|
||||
800002c0: d4408093 addi x1,x1,-700 # 80002000 <begin_signature>
|
||||
800002c4: 0040b703 ld x14,4(x1)
|
||||
800002c8: 000603b7 lui x7,0x60
|
||||
800002cc: 5853839b addiw x7,x7,1413 # 60585 <_start-0x7ff9fa7b>
|
||||
800002d0: 00d39393 slli x7,x7,0xd
|
||||
800002d4: 09138393 addi x7,x7,145
|
||||
800002d8: 00c39393 slli x7,x7,0xc
|
||||
800002dc: 80738393 addi x7,x7,-2041
|
||||
800002e0: 01039393 slli x7,x7,0x10
|
||||
800002e4: 60538393 addi x7,x7,1541
|
||||
800002e8: 0e771a63 bne x14,x7,800003dc <fail>
|
||||
|
||||
00000000800002ec <test_7>:
|
||||
800002ec: 00700193 addi x3,x0,7
|
||||
800002f0: 068607b7 lui x15,0x6860
|
||||
800002f4: 5857879b addiw x15,x15,1413 # 6860585 <_start-0x7979fa7b>
|
||||
800002f8: 00e79793 slli x15,x15,0xe
|
||||
800002fc: 12178793 addi x15,x15,289
|
||||
80000300: 01379793 slli x15,x15,0x13
|
||||
80000304: 70678793 addi x15,x15,1798
|
||||
80000308: 00002097 auipc x1,0x2
|
||||
8000030c: cf808093 addi x1,x1,-776 # 80002000 <begin_signature>
|
||||
80000310: 0050b703 ld x14,5(x1)
|
||||
80000314: 068603b7 lui x7,0x6860
|
||||
80000318: 5853839b addiw x7,x7,1413 # 6860585 <_start-0x7979fa7b>
|
||||
8000031c: 00e39393 slli x7,x7,0xe
|
||||
80000320: 12138393 addi x7,x7,289
|
||||
80000324: 01339393 slli x7,x7,0x13
|
||||
80000328: 70638393 addi x7,x7,1798
|
||||
8000032c: 0a771863 bne x14,x7,800003dc <fail>
|
||||
|
||||
0000000080000330 <test_8>:
|
||||
80000330: 00800193 addi x3,x0,8
|
||||
80000334: 000387b7 lui x15,0x38
|
||||
80000338: 3437879b addiw x15,x15,835 # 38343 <_start-0x7ffc7cbd>
|
||||
8000033c: 01179793 slli x15,x15,0x11
|
||||
80000340: 58578793 addi x15,x15,1413
|
||||
80000344: 00d79793 slli x15,x15,0xd
|
||||
80000348: 09178793 addi x15,x15,145
|
||||
8000034c: 00c79793 slli x15,x15,0xc
|
||||
80000350: 80778793 addi x15,x15,-2041
|
||||
80000354: 00002097 auipc x1,0x2
|
||||
80000358: cac08093 addi x1,x1,-852 # 80002000 <begin_signature>
|
||||
8000035c: 0060b703 ld x14,6(x1)
|
||||
80000360: 000383b7 lui x7,0x38
|
||||
80000364: 3433839b addiw x7,x7,835 # 38343 <_start-0x7ffc7cbd>
|
||||
80000368: 01139393 slli x7,x7,0x11
|
||||
8000036c: 58538393 addi x7,x7,1413
|
||||
80000370: 00d39393 slli x7,x7,0xd
|
||||
80000374: 09138393 addi x7,x7,145
|
||||
80000378: 00c39393 slli x7,x7,0xc
|
||||
8000037c: 80738393 addi x7,x7,-2041
|
||||
80000380: 04771e63 bne x14,x7,800003dc <fail>
|
||||
|
||||
0000000080000384 <test_9>:
|
||||
80000384: 00900193 addi x3,x0,9
|
||||
80000388: 00f0e7b7 lui x15,0xf0e
|
||||
8000038c: 0d17879b addiw x15,x15,209 # f0e0d1 <_start-0x7f0f1f2f>
|
||||
80000390: 00c79793 slli x15,x15,0xc
|
||||
80000394: c0b78793 addi x15,x15,-1013
|
||||
80000398: 00c79793 slli x15,x15,0xc
|
||||
8000039c: 0a178793 addi x15,x15,161
|
||||
800003a0: 00c79793 slli x15,x15,0xc
|
||||
800003a4: 90878793 addi x15,x15,-1784
|
||||
800003a8: 00002097 auipc x1,0x2
|
||||
800003ac: c5808093 addi x1,x1,-936 # 80002000 <begin_signature>
|
||||
800003b0: 0070b703 ld x14,7(x1)
|
||||
800003b4: 00f0e3b7 lui x7,0xf0e
|
||||
800003b8: 0d13839b addiw x7,x7,209 # f0e0d1 <_start-0x7f0f1f2f>
|
||||
800003bc: 00c39393 slli x7,x7,0xc
|
||||
800003c0: c0b38393 addi x7,x7,-1013
|
||||
800003c4: 00c39393 slli x7,x7,0xc
|
||||
800003c8: 0a138393 addi x7,x7,161
|
||||
800003cc: 00c39393 slli x7,x7,0xc
|
||||
800003d0: 90838393 addi x7,x7,-1784
|
||||
800003d4: 00771463 bne x14,x7,800003dc <fail>
|
||||
800003d8: 02301063 bne x0,x3,800003f8 <pass>
|
||||
|
||||
00000000800003dc <fail>:
|
||||
800003dc: 0ff0000f fence iorw,iorw
|
||||
800003e0: 00018063 beq x3,x0,800003e0 <fail+0x4>
|
||||
800003e4: 00119193 slli x3,x3,0x1
|
||||
800003e8: 0011e193 ori x3,x3,1
|
||||
800003ec: 05d00893 addi x17,x0,93
|
||||
800003f0: 00018513 addi x10,x3,0
|
||||
800003f4: 00000073 ecall
|
||||
|
||||
00000000800003f8 <pass>:
|
||||
800003f8: 0ff0000f fence iorw,iorw
|
||||
800003fc: 00100193 addi x3,x0,1
|
||||
80000400: 05d00893 addi x17,x0,93
|
||||
80000404: 00000513 addi x10,x0,0
|
||||
80000408: 00000073 ecall
|
||||
|
||||
000000008000040c <mtvec_handler>:
|
||||
8000040c: 00400293 addi x5,x0,4
|
||||
80000410: 34202373 csrrs x6,mcause,x0
|
||||
80000414: fc6294e3 bne x5,x6,800003dc <fail>
|
||||
80000418: 00078713 addi x14,x15,0
|
||||
8000041c: 341022f3 csrrs x5,mepc,x0
|
||||
80000420: 00428293 addi x5,x5,4
|
||||
80000424: 34129073 csrrw x0,mepc,x5
|
||||
80000428: 30200073 mret
|
||||
8000042c: c0001073 unimp
|
||||
...
|
||||
@ -0,0 +1,160 @@
|
||||
|
||||
./rv64mi-p-lh-misaligned: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 04c0006f jal x0,8000004c <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0a63 beq x30,x31,80000040 <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0663 beq x30,x31,80000040 <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0263 beq x30,x31,80000040 <write_tohost>
|
||||
80000020: 00000f17 auipc x30,0x0
|
||||
80000024: 1d4f0f13 addi x30,x30,468 # 800001f4 <mtvec_handler>
|
||||
80000028: 000f0463 beq x30,x0,80000030 <trap_vector+0x2c>
|
||||
8000002c: 000f0067 jalr x0,0(x30)
|
||||
80000030: 34202f73 csrrs x30,mcause,x0
|
||||
80000034: 000f5463 bge x30,x0,8000003c <handle_exception>
|
||||
80000038: 0040006f jal x0,8000003c <handle_exception>
|
||||
|
||||
000000008000003c <handle_exception>:
|
||||
8000003c: 5391e193 ori x3,x3,1337
|
||||
|
||||
0000000080000040 <write_tohost>:
|
||||
80000040: 00001f17 auipc x30,0x1
|
||||
80000044: fc3f2023 sw x3,-64(x30) # 80001000 <tohost>
|
||||
80000048: ff9ff06f jal x0,80000040 <write_tohost>
|
||||
|
||||
000000008000004c <reset_vector>:
|
||||
8000004c: 00000093 addi x1,x0,0
|
||||
80000050: 00000113 addi x2,x0,0
|
||||
80000054: 00000193 addi x3,x0,0
|
||||
80000058: 00000213 addi x4,x0,0
|
||||
8000005c: 00000293 addi x5,x0,0
|
||||
80000060: 00000313 addi x6,x0,0
|
||||
80000064: 00000393 addi x7,x0,0
|
||||
80000068: 00000413 addi x8,x0,0
|
||||
8000006c: 00000493 addi x9,x0,0
|
||||
80000070: 00000513 addi x10,x0,0
|
||||
80000074: 00000593 addi x11,x0,0
|
||||
80000078: 00000613 addi x12,x0,0
|
||||
8000007c: 00000693 addi x13,x0,0
|
||||
80000080: 00000713 addi x14,x0,0
|
||||
80000084: 00000793 addi x15,x0,0
|
||||
80000088: 00000813 addi x16,x0,0
|
||||
8000008c: 00000893 addi x17,x0,0
|
||||
80000090: 00000913 addi x18,x0,0
|
||||
80000094: 00000993 addi x19,x0,0
|
||||
80000098: 00000a13 addi x20,x0,0
|
||||
8000009c: 00000a93 addi x21,x0,0
|
||||
800000a0: 00000b13 addi x22,x0,0
|
||||
800000a4: 00000b93 addi x23,x0,0
|
||||
800000a8: 00000c13 addi x24,x0,0
|
||||
800000ac: 00000c93 addi x25,x0,0
|
||||
800000b0: 00000d13 addi x26,x0,0
|
||||
800000b4: 00000d93 addi x27,x0,0
|
||||
800000b8: 00000e13 addi x28,x0,0
|
||||
800000bc: 00000e93 addi x29,x0,0
|
||||
800000c0: 00000f13 addi x30,x0,0
|
||||
800000c4: 00000f93 addi x31,x0,0
|
||||
800000c8: f1402573 csrrs x10,mhartid,x0
|
||||
800000cc: 00051063 bne x10,x0,800000cc <reset_vector+0x80>
|
||||
800000d0: 00000297 auipc x5,0x0
|
||||
800000d4: 01028293 addi x5,x5,16 # 800000e0 <reset_vector+0x94>
|
||||
800000d8: 30529073 csrrw x0,mtvec,x5
|
||||
800000dc: 18005073 csrrwi x0,satp,0
|
||||
800000e0: 00000297 auipc x5,0x0
|
||||
800000e4: 02428293 addi x5,x5,36 # 80000104 <reset_vector+0xb8>
|
||||
800000e8: 30529073 csrrw x0,mtvec,x5
|
||||
800000ec: 0010029b addiw x5,x0,1
|
||||
800000f0: 03529293 slli x5,x5,0x35
|
||||
800000f4: fff28293 addi x5,x5,-1
|
||||
800000f8: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000fc: 01f00293 addi x5,x0,31
|
||||
80000100: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000104: 30405073 csrrwi x0,mie,0
|
||||
80000108: 00000297 auipc x5,0x0
|
||||
8000010c: 01428293 addi x5,x5,20 # 8000011c <reset_vector+0xd0>
|
||||
80000110: 30529073 csrrw x0,mtvec,x5
|
||||
80000114: 30205073 csrrwi x0,medeleg,0
|
||||
80000118: 30305073 csrrwi x0,mideleg,0
|
||||
8000011c: 00000193 addi x3,x0,0
|
||||
80000120: 00000297 auipc x5,0x0
|
||||
80000124: ee428293 addi x5,x5,-284 # 80000004 <trap_vector>
|
||||
80000128: 30529073 csrrw x0,mtvec,x5
|
||||
8000012c: 00100513 addi x10,x0,1
|
||||
80000130: 01f51513 slli x10,x10,0x1f
|
||||
80000134: 00055c63 bge x10,x0,8000014c <reset_vector+0x100>
|
||||
80000138: 0ff0000f fence iorw,iorw
|
||||
8000013c: 00100193 addi x3,x0,1
|
||||
80000140: 05d00893 addi x17,x0,93
|
||||
80000144: 00000513 addi x10,x0,0
|
||||
80000148: 00000073 ecall
|
||||
8000014c: 00000293 addi x5,x0,0
|
||||
80000150: 00028a63 beq x5,x0,80000164 <reset_vector+0x118>
|
||||
80000154: 10529073 csrrw x0,stvec,x5
|
||||
80000158: 0000b2b7 lui x5,0xb
|
||||
8000015c: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
80000160: 30229073 csrrw x0,medeleg,x5
|
||||
80000164: 30005073 csrrwi x0,mstatus,0
|
||||
80000168: 00002537 lui x10,0x2
|
||||
8000016c: 8005051b addiw x10,x10,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000170: 30052073 csrrs x0,mstatus,x10
|
||||
80000174: 00000297 auipc x5,0x0
|
||||
80000178: 01428293 addi x5,x5,20 # 80000188 <test_2>
|
||||
8000017c: 34129073 csrrw x0,mepc,x5
|
||||
80000180: f1402573 csrrs x10,mhartid,x0
|
||||
80000184: 30200073 mret
|
||||
|
||||
0000000080000188 <test_2>:
|
||||
80000188: 00200193 addi x3,x0,2
|
||||
8000018c: 20100793 addi x15,x0,513
|
||||
80000190: 00002097 auipc x1,0x2
|
||||
80000194: e7008093 addi x1,x1,-400 # 80002000 <begin_signature>
|
||||
80000198: 00009703 lh x14,0(x1)
|
||||
8000019c: 20100393 addi x7,x0,513
|
||||
800001a0: 02771263 bne x14,x7,800001c4 <fail>
|
||||
|
||||
00000000800001a4 <test_3>:
|
||||
800001a4: 00300193 addi x3,x0,3
|
||||
800001a8: 30200793 addi x15,x0,770
|
||||
800001ac: 00002097 auipc x1,0x2
|
||||
800001b0: e5408093 addi x1,x1,-428 # 80002000 <begin_signature>
|
||||
800001b4: 00109703 lh x14,1(x1)
|
||||
800001b8: 30200393 addi x7,x0,770
|
||||
800001bc: 00771463 bne x14,x7,800001c4 <fail>
|
||||
800001c0: 02301063 bne x0,x3,800001e0 <pass>
|
||||
|
||||
00000000800001c4 <fail>:
|
||||
800001c4: 0ff0000f fence iorw,iorw
|
||||
800001c8: 00018063 beq x3,x0,800001c8 <fail+0x4>
|
||||
800001cc: 00119193 slli x3,x3,0x1
|
||||
800001d0: 0011e193 ori x3,x3,1
|
||||
800001d4: 05d00893 addi x17,x0,93
|
||||
800001d8: 00018513 addi x10,x3,0
|
||||
800001dc: 00000073 ecall
|
||||
|
||||
00000000800001e0 <pass>:
|
||||
800001e0: 0ff0000f fence iorw,iorw
|
||||
800001e4: 00100193 addi x3,x0,1
|
||||
800001e8: 05d00893 addi x17,x0,93
|
||||
800001ec: 00000513 addi x10,x0,0
|
||||
800001f0: 00000073 ecall
|
||||
|
||||
00000000800001f4 <mtvec_handler>:
|
||||
800001f4: 00400293 addi x5,x0,4
|
||||
800001f8: 34202373 csrrs x6,mcause,x0
|
||||
800001fc: fc6294e3 bne x5,x6,800001c4 <fail>
|
||||
80000200: 00078713 addi x14,x15,0
|
||||
80000204: 341022f3 csrrs x5,mepc,x0
|
||||
80000208: 00428293 addi x5,x5,4
|
||||
8000020c: 34129073 csrrw x0,mepc,x5
|
||||
80000210: 30200073 mret
|
||||
80000214: c0001073 unimp
|
||||
...
|
||||
@ -0,0 +1,186 @@
|
||||
|
||||
./rv64mi-p-lw-misaligned: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 04c0006f jal x0,8000004c <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0a63 beq x30,x31,80000040 <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0663 beq x30,x31,80000040 <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0263 beq x30,x31,80000040 <write_tohost>
|
||||
80000020: 00000f17 auipc x30,0x0
|
||||
80000024: 22cf0f13 addi x30,x30,556 # 8000024c <mtvec_handler>
|
||||
80000028: 000f0463 beq x30,x0,80000030 <trap_vector+0x2c>
|
||||
8000002c: 000f0067 jalr x0,0(x30)
|
||||
80000030: 34202f73 csrrs x30,mcause,x0
|
||||
80000034: 000f5463 bge x30,x0,8000003c <handle_exception>
|
||||
80000038: 0040006f jal x0,8000003c <handle_exception>
|
||||
|
||||
000000008000003c <handle_exception>:
|
||||
8000003c: 5391e193 ori x3,x3,1337
|
||||
|
||||
0000000080000040 <write_tohost>:
|
||||
80000040: 00001f17 auipc x30,0x1
|
||||
80000044: fc3f2023 sw x3,-64(x30) # 80001000 <tohost>
|
||||
80000048: ff9ff06f jal x0,80000040 <write_tohost>
|
||||
|
||||
000000008000004c <reset_vector>:
|
||||
8000004c: 00000093 addi x1,x0,0
|
||||
80000050: 00000113 addi x2,x0,0
|
||||
80000054: 00000193 addi x3,x0,0
|
||||
80000058: 00000213 addi x4,x0,0
|
||||
8000005c: 00000293 addi x5,x0,0
|
||||
80000060: 00000313 addi x6,x0,0
|
||||
80000064: 00000393 addi x7,x0,0
|
||||
80000068: 00000413 addi x8,x0,0
|
||||
8000006c: 00000493 addi x9,x0,0
|
||||
80000070: 00000513 addi x10,x0,0
|
||||
80000074: 00000593 addi x11,x0,0
|
||||
80000078: 00000613 addi x12,x0,0
|
||||
8000007c: 00000693 addi x13,x0,0
|
||||
80000080: 00000713 addi x14,x0,0
|
||||
80000084: 00000793 addi x15,x0,0
|
||||
80000088: 00000813 addi x16,x0,0
|
||||
8000008c: 00000893 addi x17,x0,0
|
||||
80000090: 00000913 addi x18,x0,0
|
||||
80000094: 00000993 addi x19,x0,0
|
||||
80000098: 00000a13 addi x20,x0,0
|
||||
8000009c: 00000a93 addi x21,x0,0
|
||||
800000a0: 00000b13 addi x22,x0,0
|
||||
800000a4: 00000b93 addi x23,x0,0
|
||||
800000a8: 00000c13 addi x24,x0,0
|
||||
800000ac: 00000c93 addi x25,x0,0
|
||||
800000b0: 00000d13 addi x26,x0,0
|
||||
800000b4: 00000d93 addi x27,x0,0
|
||||
800000b8: 00000e13 addi x28,x0,0
|
||||
800000bc: 00000e93 addi x29,x0,0
|
||||
800000c0: 00000f13 addi x30,x0,0
|
||||
800000c4: 00000f93 addi x31,x0,0
|
||||
800000c8: f1402573 csrrs x10,mhartid,x0
|
||||
800000cc: 00051063 bne x10,x0,800000cc <reset_vector+0x80>
|
||||
800000d0: 00000297 auipc x5,0x0
|
||||
800000d4: 01028293 addi x5,x5,16 # 800000e0 <reset_vector+0x94>
|
||||
800000d8: 30529073 csrrw x0,mtvec,x5
|
||||
800000dc: 18005073 csrrwi x0,satp,0
|
||||
800000e0: 00000297 auipc x5,0x0
|
||||
800000e4: 02428293 addi x5,x5,36 # 80000104 <reset_vector+0xb8>
|
||||
800000e8: 30529073 csrrw x0,mtvec,x5
|
||||
800000ec: 0010029b addiw x5,x0,1
|
||||
800000f0: 03529293 slli x5,x5,0x35
|
||||
800000f4: fff28293 addi x5,x5,-1
|
||||
800000f8: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000fc: 01f00293 addi x5,x0,31
|
||||
80000100: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000104: 30405073 csrrwi x0,mie,0
|
||||
80000108: 00000297 auipc x5,0x0
|
||||
8000010c: 01428293 addi x5,x5,20 # 8000011c <reset_vector+0xd0>
|
||||
80000110: 30529073 csrrw x0,mtvec,x5
|
||||
80000114: 30205073 csrrwi x0,medeleg,0
|
||||
80000118: 30305073 csrrwi x0,mideleg,0
|
||||
8000011c: 00000193 addi x3,x0,0
|
||||
80000120: 00000297 auipc x5,0x0
|
||||
80000124: ee428293 addi x5,x5,-284 # 80000004 <trap_vector>
|
||||
80000128: 30529073 csrrw x0,mtvec,x5
|
||||
8000012c: 00100513 addi x10,x0,1
|
||||
80000130: 01f51513 slli x10,x10,0x1f
|
||||
80000134: 00055c63 bge x10,x0,8000014c <reset_vector+0x100>
|
||||
80000138: 0ff0000f fence iorw,iorw
|
||||
8000013c: 00100193 addi x3,x0,1
|
||||
80000140: 05d00893 addi x17,x0,93
|
||||
80000144: 00000513 addi x10,x0,0
|
||||
80000148: 00000073 ecall
|
||||
8000014c: 00000293 addi x5,x0,0
|
||||
80000150: 00028a63 beq x5,x0,80000164 <reset_vector+0x118>
|
||||
80000154: 10529073 csrrw x0,stvec,x5
|
||||
80000158: 0000b2b7 lui x5,0xb
|
||||
8000015c: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
80000160: 30229073 csrrw x0,medeleg,x5
|
||||
80000164: 30005073 csrrwi x0,mstatus,0
|
||||
80000168: 00002537 lui x10,0x2
|
||||
8000016c: 8005051b addiw x10,x10,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000170: 30052073 csrrs x0,mstatus,x10
|
||||
80000174: 00000297 auipc x5,0x0
|
||||
80000178: 01428293 addi x5,x5,20 # 80000188 <test_2>
|
||||
8000017c: 34129073 csrrw x0,mepc,x5
|
||||
80000180: f1402573 csrrs x10,mhartid,x0
|
||||
80000184: 30200073 mret
|
||||
|
||||
0000000080000188 <test_2>:
|
||||
80000188: 00200193 addi x3,x0,2
|
||||
8000018c: 040307b7 lui x15,0x4030
|
||||
80000190: 2017879b addiw x15,x15,513 # 4030201 <_start-0x7bfcfdff>
|
||||
80000194: 00002097 auipc x1,0x2
|
||||
80000198: e6c08093 addi x1,x1,-404 # 80002000 <begin_signature>
|
||||
8000019c: 0000a703 lw x14,0(x1)
|
||||
800001a0: 040303b7 lui x7,0x4030
|
||||
800001a4: 2013839b addiw x7,x7,513 # 4030201 <_start-0x7bfcfdff>
|
||||
800001a8: 06771a63 bne x14,x7,8000021c <fail>
|
||||
|
||||
00000000800001ac <test_3>:
|
||||
800001ac: 00300193 addi x3,x0,3
|
||||
800001b0: 050407b7 lui x15,0x5040
|
||||
800001b4: 3027879b addiw x15,x15,770 # 5040302 <_start-0x7afbfcfe>
|
||||
800001b8: 00002097 auipc x1,0x2
|
||||
800001bc: e4808093 addi x1,x1,-440 # 80002000 <begin_signature>
|
||||
800001c0: 0010a703 lw x14,1(x1)
|
||||
800001c4: 050403b7 lui x7,0x5040
|
||||
800001c8: 3023839b addiw x7,x7,770 # 5040302 <_start-0x7afbfcfe>
|
||||
800001cc: 04771863 bne x14,x7,8000021c <fail>
|
||||
|
||||
00000000800001d0 <test_4>:
|
||||
800001d0: 00400193 addi x3,x0,4
|
||||
800001d4: 060507b7 lui x15,0x6050
|
||||
800001d8: 4037879b addiw x15,x15,1027 # 6050403 <_start-0x79fafbfd>
|
||||
800001dc: 00002097 auipc x1,0x2
|
||||
800001e0: e2408093 addi x1,x1,-476 # 80002000 <begin_signature>
|
||||
800001e4: 0020a703 lw x14,2(x1)
|
||||
800001e8: 060503b7 lui x7,0x6050
|
||||
800001ec: 4033839b addiw x7,x7,1027 # 6050403 <_start-0x79fafbfd>
|
||||
800001f0: 02771663 bne x14,x7,8000021c <fail>
|
||||
|
||||
00000000800001f4 <test_5>:
|
||||
800001f4: 00500193 addi x3,x0,5
|
||||
800001f8: 070607b7 lui x15,0x7060
|
||||
800001fc: 5047879b addiw x15,x15,1284 # 7060504 <_start-0x78f9fafc>
|
||||
80000200: 00002097 auipc x1,0x2
|
||||
80000204: e0008093 addi x1,x1,-512 # 80002000 <begin_signature>
|
||||
80000208: 0030a703 lw x14,3(x1)
|
||||
8000020c: 070603b7 lui x7,0x7060
|
||||
80000210: 5043839b addiw x7,x7,1284 # 7060504 <_start-0x78f9fafc>
|
||||
80000214: 00771463 bne x14,x7,8000021c <fail>
|
||||
80000218: 02301063 bne x0,x3,80000238 <pass>
|
||||
|
||||
000000008000021c <fail>:
|
||||
8000021c: 0ff0000f fence iorw,iorw
|
||||
80000220: 00018063 beq x3,x0,80000220 <fail+0x4>
|
||||
80000224: 00119193 slli x3,x3,0x1
|
||||
80000228: 0011e193 ori x3,x3,1
|
||||
8000022c: 05d00893 addi x17,x0,93
|
||||
80000230: 00018513 addi x10,x3,0
|
||||
80000234: 00000073 ecall
|
||||
|
||||
0000000080000238 <pass>:
|
||||
80000238: 0ff0000f fence iorw,iorw
|
||||
8000023c: 00100193 addi x3,x0,1
|
||||
80000240: 05d00893 addi x17,x0,93
|
||||
80000244: 00000513 addi x10,x0,0
|
||||
80000248: 00000073 ecall
|
||||
|
||||
000000008000024c <mtvec_handler>:
|
||||
8000024c: 00400293 addi x5,x0,4
|
||||
80000250: 34202373 csrrs x6,mcause,x0
|
||||
80000254: fc6294e3 bne x5,x6,8000021c <fail>
|
||||
80000258: 00078713 addi x14,x15,0
|
||||
8000025c: 341022f3 csrrs x5,mepc,x0
|
||||
80000260: 00428293 addi x5,x5,4
|
||||
80000264: 34129073 csrrw x0,mepc,x5
|
||||
80000268: 30200073 mret
|
||||
8000026c: c0001073 unimp
|
||||
...
|
||||
@ -0,0 +1,454 @@
|
||||
|
||||
./rv64mi-p-ma_addr: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 04c0006f jal x0,8000004c <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0a63 beq x30,x31,80000040 <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0663 beq x30,x31,80000040 <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0263 beq x30,x31,80000040 <write_tohost>
|
||||
80000020: 00000f17 auipc x30,0x0
|
||||
80000024: 678f0f13 addi x30,x30,1656 # 80000698 <mtvec_handler>
|
||||
80000028: 000f0463 beq x30,x0,80000030 <trap_vector+0x2c>
|
||||
8000002c: 000f0067 jalr x0,0(x30)
|
||||
80000030: 34202f73 csrrs x30,mcause,x0
|
||||
80000034: 000f5463 bge x30,x0,8000003c <handle_exception>
|
||||
80000038: 0040006f jal x0,8000003c <handle_exception>
|
||||
|
||||
000000008000003c <handle_exception>:
|
||||
8000003c: 5391e193 ori x3,x3,1337
|
||||
|
||||
0000000080000040 <write_tohost>:
|
||||
80000040: 00001f17 auipc x30,0x1
|
||||
80000044: fc3f2023 sw x3,-64(x30) # 80001000 <tohost>
|
||||
80000048: ff9ff06f jal x0,80000040 <write_tohost>
|
||||
|
||||
000000008000004c <reset_vector>:
|
||||
8000004c: 00000093 addi x1,x0,0
|
||||
80000050: 00000113 addi x2,x0,0
|
||||
80000054: 00000193 addi x3,x0,0
|
||||
80000058: 00000213 addi x4,x0,0
|
||||
8000005c: 00000293 addi x5,x0,0
|
||||
80000060: 00000313 addi x6,x0,0
|
||||
80000064: 00000393 addi x7,x0,0
|
||||
80000068: 00000413 addi x8,x0,0
|
||||
8000006c: 00000493 addi x9,x0,0
|
||||
80000070: 00000513 addi x10,x0,0
|
||||
80000074: 00000593 addi x11,x0,0
|
||||
80000078: 00000613 addi x12,x0,0
|
||||
8000007c: 00000693 addi x13,x0,0
|
||||
80000080: 00000713 addi x14,x0,0
|
||||
80000084: 00000793 addi x15,x0,0
|
||||
80000088: 00000813 addi x16,x0,0
|
||||
8000008c: 00000893 addi x17,x0,0
|
||||
80000090: 00000913 addi x18,x0,0
|
||||
80000094: 00000993 addi x19,x0,0
|
||||
80000098: 00000a13 addi x20,x0,0
|
||||
8000009c: 00000a93 addi x21,x0,0
|
||||
800000a0: 00000b13 addi x22,x0,0
|
||||
800000a4: 00000b93 addi x23,x0,0
|
||||
800000a8: 00000c13 addi x24,x0,0
|
||||
800000ac: 00000c93 addi x25,x0,0
|
||||
800000b0: 00000d13 addi x26,x0,0
|
||||
800000b4: 00000d93 addi x27,x0,0
|
||||
800000b8: 00000e13 addi x28,x0,0
|
||||
800000bc: 00000e93 addi x29,x0,0
|
||||
800000c0: 00000f13 addi x30,x0,0
|
||||
800000c4: 00000f93 addi x31,x0,0
|
||||
800000c8: f1402573 csrrs x10,mhartid,x0
|
||||
800000cc: 00051063 bne x10,x0,800000cc <reset_vector+0x80>
|
||||
800000d0: 00000297 auipc x5,0x0
|
||||
800000d4: 01028293 addi x5,x5,16 # 800000e0 <reset_vector+0x94>
|
||||
800000d8: 30529073 csrrw x0,mtvec,x5
|
||||
800000dc: 18005073 csrrwi x0,satp,0
|
||||
800000e0: 00000297 auipc x5,0x0
|
||||
800000e4: 02428293 addi x5,x5,36 # 80000104 <reset_vector+0xb8>
|
||||
800000e8: 30529073 csrrw x0,mtvec,x5
|
||||
800000ec: 0010029b addiw x5,x0,1
|
||||
800000f0: 03529293 slli x5,x5,0x35
|
||||
800000f4: fff28293 addi x5,x5,-1
|
||||
800000f8: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000fc: 01f00293 addi x5,x0,31
|
||||
80000100: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000104: 30405073 csrrwi x0,mie,0
|
||||
80000108: 00000297 auipc x5,0x0
|
||||
8000010c: 01428293 addi x5,x5,20 # 8000011c <reset_vector+0xd0>
|
||||
80000110: 30529073 csrrw x0,mtvec,x5
|
||||
80000114: 30205073 csrrwi x0,medeleg,0
|
||||
80000118: 30305073 csrrwi x0,mideleg,0
|
||||
8000011c: 00000193 addi x3,x0,0
|
||||
80000120: 00000297 auipc x5,0x0
|
||||
80000124: ee428293 addi x5,x5,-284 # 80000004 <trap_vector>
|
||||
80000128: 30529073 csrrw x0,mtvec,x5
|
||||
8000012c: 00100513 addi x10,x0,1
|
||||
80000130: 01f51513 slli x10,x10,0x1f
|
||||
80000134: 00055c63 bge x10,x0,8000014c <reset_vector+0x100>
|
||||
80000138: 0ff0000f fence iorw,iorw
|
||||
8000013c: 00100193 addi x3,x0,1
|
||||
80000140: 05d00893 addi x17,x0,93
|
||||
80000144: 00000513 addi x10,x0,0
|
||||
80000148: 00000073 ecall
|
||||
8000014c: 00000293 addi x5,x0,0
|
||||
80000150: 00028a63 beq x5,x0,80000164 <reset_vector+0x118>
|
||||
80000154: 10529073 csrrw x0,stvec,x5
|
||||
80000158: 0000b2b7 lui x5,0xb
|
||||
8000015c: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
80000160: 30229073 csrrw x0,medeleg,x5
|
||||
80000164: 30005073 csrrwi x0,mstatus,0
|
||||
80000168: 00002537 lui x10,0x2
|
||||
8000016c: 8005051b addiw x10,x10,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000170: 30052073 csrrs x0,mstatus,x10
|
||||
80000174: 00000297 auipc x5,0x0
|
||||
80000178: 01428293 addi x5,x5,20 # 80000188 <reset_vector+0x13c>
|
||||
8000017c: 34129073 csrrw x0,mepc,x5
|
||||
80000180: f1402573 csrrs x10,mhartid,x0
|
||||
80000184: 30200073 mret
|
||||
80000188: 00002417 auipc x8,0x2
|
||||
8000018c: e7840413 addi x8,x8,-392 # 80002000 <begin_signature>
|
||||
80000190: 00400493 addi x9,x0,4
|
||||
80000194: 00200193 addi x3,x0,2
|
||||
80000198: 00000397 auipc x7,0x0
|
||||
8000019c: 01c38393 addi x7,x7,28 # 800001b4 <reset_vector+0x168>
|
||||
800001a0: 00140313 addi x6,x8,1
|
||||
800001a4: 00141303 lh x6,1(x8)
|
||||
800001a8: ffffc3b7 lui x7,0xffffc
|
||||
800001ac: bcc3839b addiw x7,x7,-1076 # ffffffffffffbbcc <_end+0xffffffff7fff9abc>
|
||||
800001b0: 4a731c63 bne x6,x7,80000668 <fail>
|
||||
800001b4: 00300193 addi x3,x0,3
|
||||
800001b8: 00000397 auipc x7,0x0
|
||||
800001bc: 01c38393 addi x7,x7,28 # 800001d4 <reset_vector+0x188>
|
||||
800001c0: 00140313 addi x6,x8,1
|
||||
800001c4: 00145303 lhu x6,1(x8)
|
||||
800001c8: 0000c3b7 lui x7,0xc
|
||||
800001cc: bcc3839b addiw x7,x7,-1076 # bbcc <_start-0x7fff4434>
|
||||
800001d0: 48731c63 bne x6,x7,80000668 <fail>
|
||||
800001d4: 00400193 addi x3,x0,4
|
||||
800001d8: 00000397 auipc x7,0x0
|
||||
800001dc: 01c38393 addi x7,x7,28 # 800001f4 <reset_vector+0x1a8>
|
||||
800001e0: 00140313 addi x6,x8,1
|
||||
800001e4: 00142303 lw x6,1(x8)
|
||||
800001e8: 99aac3b7 lui x7,0x99aac
|
||||
800001ec: bcc3839b addiw x7,x7,-1076 # ffffffff99aabbcc <_end+0xffffffff19aa9abc>
|
||||
800001f0: 46731c63 bne x6,x7,80000668 <fail>
|
||||
800001f4: 00500193 addi x3,x0,5
|
||||
800001f8: 00000397 auipc x7,0x0
|
||||
800001fc: 01c38393 addi x7,x7,28 # 80000214 <reset_vector+0x1c8>
|
||||
80000200: 00240313 addi x6,x8,2
|
||||
80000204: 00242303 lw x6,2(x8)
|
||||
80000208: 8899b3b7 lui x7,0x8899b
|
||||
8000020c: abb3839b addiw x7,x7,-1349 # ffffffff8899aabb <_end+0xffffffff089989ab>
|
||||
80000210: 44731c63 bne x6,x7,80000668 <fail>
|
||||
80000214: 00600193 addi x3,x0,6
|
||||
80000218: 00000397 auipc x7,0x0
|
||||
8000021c: 01c38393 addi x7,x7,28 # 80000234 <reset_vector+0x1e8>
|
||||
80000220: 00340313 addi x6,x8,3
|
||||
80000224: 00342303 lw x6,3(x8)
|
||||
80000228: 7788a3b7 lui x7,0x7788a
|
||||
8000022c: 9aa3839b addiw x7,x7,-1622 # 778899aa <_start-0x8776656>
|
||||
80000230: 42731c63 bne x6,x7,80000668 <fail>
|
||||
80000234: 00700193 addi x3,x0,7
|
||||
80000238: 00000397 auipc x7,0x0
|
||||
8000023c: 02438393 addi x7,x7,36 # 8000025c <reset_vector+0x210>
|
||||
80000240: 00140313 addi x6,x8,1
|
||||
80000244: 00146303 lwu x6,1(x8)
|
||||
80000248: 000263b7 lui x7,0x26
|
||||
8000024c: 6ab3839b addiw x7,x7,1707 # 266ab <_start-0x7ffd9955>
|
||||
80000250: 00e39393 slli x7,x7,0xe
|
||||
80000254: bcc38393 addi x7,x7,-1076
|
||||
80000258: 40731863 bne x6,x7,80000668 <fail>
|
||||
8000025c: 00800193 addi x3,x0,8
|
||||
80000260: 00000397 auipc x7,0x0
|
||||
80000264: 02438393 addi x7,x7,36 # 80000284 <reset_vector+0x238>
|
||||
80000268: 00240313 addi x6,x8,2
|
||||
8000026c: 00246303 lwu x6,2(x8)
|
||||
80000270: 000893b7 lui x7,0x89
|
||||
80000274: 99b3839b addiw x7,x7,-1637 # 8899b <_start-0x7ff77665>
|
||||
80000278: 00c39393 slli x7,x7,0xc
|
||||
8000027c: abb38393 addi x7,x7,-1349
|
||||
80000280: 3e731463 bne x6,x7,80000668 <fail>
|
||||
80000284: 00900193 addi x3,x0,9
|
||||
80000288: 00000397 auipc x7,0x0
|
||||
8000028c: 01c38393 addi x7,x7,28 # 800002a4 <reset_vector+0x258>
|
||||
80000290: 00340313 addi x6,x8,3
|
||||
80000294: 00346303 lwu x6,3(x8)
|
||||
80000298: 7788a3b7 lui x7,0x7788a
|
||||
8000029c: 9aa3839b addiw x7,x7,-1622 # 778899aa <_start-0x8776656>
|
||||
800002a0: 3c731463 bne x6,x7,80000668 <fail>
|
||||
800002a4: 00a00193 addi x3,x0,10
|
||||
800002a8: 00000397 auipc x7,0x0
|
||||
800002ac: 03438393 addi x7,x7,52 # 800002dc <reset_vector+0x290>
|
||||
800002b0: 00140313 addi x6,x8,1
|
||||
800002b4: 00143303 ld x6,1(x8)
|
||||
800002b8: 00aad3b7 lui x7,0xaad
|
||||
800002bc: cef3839b addiw x7,x7,-785 # aaccef <_start-0x7f553311>
|
||||
800002c0: 00c39393 slli x7,x7,0xc
|
||||
800002c4: 11338393 addi x7,x7,275
|
||||
800002c8: 00d39393 slli x7,x7,0xd
|
||||
800002cc: 6ab38393 addi x7,x7,1707
|
||||
800002d0: 00e39393 slli x7,x7,0xe
|
||||
800002d4: bcc38393 addi x7,x7,-1076
|
||||
800002d8: 38731863 bne x6,x7,80000668 <fail>
|
||||
800002dc: 00b00193 addi x3,x0,11
|
||||
800002e0: 00000397 auipc x7,0x0
|
||||
800002e4: 03438393 addi x7,x7,52 # 80000314 <reset_vector+0x2c8>
|
||||
800002e8: 00240313 addi x6,x8,2
|
||||
800002ec: 00243303 ld x6,2(x8)
|
||||
800002f0: 044553b7 lui x7,0x4455
|
||||
800002f4: 6673839b addiw x7,x7,1639 # 4455667 <_start-0x7bbaa999>
|
||||
800002f8: 00c39393 slli x7,x7,0xc
|
||||
800002fc: 78938393 addi x7,x7,1929
|
||||
80000300: 00c39393 slli x7,x7,0xc
|
||||
80000304: 99b38393 addi x7,x7,-1637
|
||||
80000308: 00c39393 slli x7,x7,0xc
|
||||
8000030c: abb38393 addi x7,x7,-1349
|
||||
80000310: 34731c63 bne x6,x7,80000668 <fail>
|
||||
80000314: 00c00193 addi x3,x0,12
|
||||
80000318: 00000397 auipc x7,0x0
|
||||
8000031c: 03438393 addi x7,x7,52 # 8000034c <reset_vector+0x300>
|
||||
80000320: 00340313 addi x6,x8,3
|
||||
80000324: 00343303 ld x6,3(x8)
|
||||
80000328: 006693b7 lui x7,0x669
|
||||
8000032c: 8ab3839b addiw x7,x7,-1877 # 6688ab <_start-0x7f997755>
|
||||
80000330: 00c39393 slli x7,x7,0xc
|
||||
80000334: ccf38393 addi x7,x7,-817
|
||||
80000338: 00e39393 slli x7,x7,0xe
|
||||
8000033c: c4538393 addi x7,x7,-955
|
||||
80000340: 00d39393 slli x7,x7,0xd
|
||||
80000344: 9aa38393 addi x7,x7,-1622
|
||||
80000348: 32731063 bne x6,x7,80000668 <fail>
|
||||
8000034c: 00d00193 addi x3,x0,13
|
||||
80000350: 00000397 auipc x7,0x0
|
||||
80000354: 03438393 addi x7,x7,52 # 80000384 <reset_vector+0x338>
|
||||
80000358: 00440313 addi x6,x8,4
|
||||
8000035c: 00443303 ld x6,4(x8)
|
||||
80000360: 0111a3b7 lui x7,0x111a
|
||||
80000364: a233839b addiw x7,x7,-1501 # 1119a23 <_start-0x7eee65dd>
|
||||
80000368: 00c39393 slli x7,x7,0xc
|
||||
8000036c: ab338393 addi x7,x7,-1357
|
||||
80000370: 00d39393 slli x7,x7,0xd
|
||||
80000374: 77938393 addi x7,x7,1913
|
||||
80000378: 00c39393 slli x7,x7,0xc
|
||||
8000037c: 89938393 addi x7,x7,-1895
|
||||
80000380: 2e731463 bne x6,x7,80000668 <fail>
|
||||
80000384: 00e00193 addi x3,x0,14
|
||||
80000388: 00000397 auipc x7,0x0
|
||||
8000038c: 03438393 addi x7,x7,52 # 800003bc <reset_vector+0x370>
|
||||
80000390: 00540313 addi x6,x8,5
|
||||
80000394: 00543303 ld x6,5(x8)
|
||||
80000398: 004493b7 lui x7,0x449
|
||||
8000039c: 8cd3839b addiw x7,x7,-1843 # 4488cd <_start-0x7fbb7733>
|
||||
800003a0: 00e39393 slli x7,x7,0xe
|
||||
800003a4: 45538393 addi x7,x7,1109
|
||||
800003a8: 00c39393 slli x7,x7,0xc
|
||||
800003ac: 66738393 addi x7,x7,1639
|
||||
800003b0: 00c39393 slli x7,x7,0xc
|
||||
800003b4: 78838393 addi x7,x7,1928
|
||||
800003b8: 2a731863 bne x6,x7,80000668 <fail>
|
||||
800003bc: 00f00193 addi x3,x0,15
|
||||
800003c0: 00000397 auipc x7,0x0
|
||||
800003c4: 03438393 addi x7,x7,52 # 800003f4 <reset_vector+0x3a8>
|
||||
800003c8: 00640313 addi x6,x8,6
|
||||
800003cc: 00643303 ld x6,6(x8)
|
||||
800003d0: ffb843b7 lui x7,0xffb84
|
||||
800003d4: 4893839b addiw x7,x7,1161 # ffffffffffb84489 <_end+0xffffffff7fb82379>
|
||||
800003d8: 00c39393 slli x7,x7,0xc
|
||||
800003dc: cd138393 addi x7,x7,-815
|
||||
800003e0: 00d39393 slli x7,x7,0xd
|
||||
800003e4: 2ab38393 addi x7,x7,683
|
||||
800003e8: 00d39393 slli x7,x7,0xd
|
||||
800003ec: 67738393 addi x7,x7,1655
|
||||
800003f0: 26731c63 bne x6,x7,80000668 <fail>
|
||||
800003f4: 01000193 addi x3,x0,16
|
||||
800003f8: 00000397 auipc x7,0x0
|
||||
800003fc: 02c38393 addi x7,x7,44 # 80000424 <reset_vector+0x3d8>
|
||||
80000400: 00740313 addi x6,x8,7
|
||||
80000404: 00743303 ld x6,7(x8)
|
||||
80000408: ee1123b7 lui x7,0xee112
|
||||
8000040c: 2333839b addiw x7,x7,563 # ffffffffee112233 <_end+0xffffffff6e110123>
|
||||
80000410: 00c39393 slli x7,x7,0xc
|
||||
80000414: 44538393 addi x7,x7,1093
|
||||
80000418: 00c39393 slli x7,x7,0xc
|
||||
8000041c: 56638393 addi x7,x7,1382
|
||||
80000420: 24731463 bne x6,x7,80000668 <fail>
|
||||
80000424: 00600493 addi x9,x0,6
|
||||
80000428: 01600193 addi x3,x0,22
|
||||
8000042c: 00000397 auipc x7,0x0
|
||||
80000430: 03038393 addi x7,x7,48 # 8000045c <reset_vector+0x410>
|
||||
80000434: 00140313 addi x6,x8,1
|
||||
80000438: 000410a3 sh x0,1(x8)
|
||||
8000043c: 00040303 lb x6,0(x8)
|
||||
80000440: 22030463 beq x6,x0,80000668 <fail>
|
||||
80000444: 00340303 lb x6,3(x8)
|
||||
80000448: 22030063 beq x6,x0,80000668 <fail>
|
||||
8000044c: 00140303 lb x6,1(x8)
|
||||
80000450: 20031c63 bne x6,x0,80000668 <fail>
|
||||
80000454: 00240303 lb x6,2(x8)
|
||||
80000458: 20031863 bne x6,x0,80000668 <fail>
|
||||
8000045c: 01700193 addi x3,x0,23
|
||||
80000460: 00000397 auipc x7,0x0
|
||||
80000464: 03038393 addi x7,x7,48 # 80000490 <reset_vector+0x444>
|
||||
80000468: 00540313 addi x6,x8,5
|
||||
8000046c: 000422a3 sw x0,5(x8)
|
||||
80000470: 00440303 lb x6,4(x8)
|
||||
80000474: 1e030a63 beq x6,x0,80000668 <fail>
|
||||
80000478: 00940303 lb x6,9(x8)
|
||||
8000047c: 1e030663 beq x6,x0,80000668 <fail>
|
||||
80000480: 00540303 lb x6,5(x8)
|
||||
80000484: 1e031263 bne x6,x0,80000668 <fail>
|
||||
80000488: 00840303 lb x6,8(x8)
|
||||
8000048c: 1c031e63 bne x6,x0,80000668 <fail>
|
||||
80000490: 01800193 addi x3,x0,24
|
||||
80000494: 00000397 auipc x7,0x0
|
||||
80000498: 03038393 addi x7,x7,48 # 800004c4 <reset_vector+0x478>
|
||||
8000049c: 00a40313 addi x6,x8,10
|
||||
800004a0: 00042523 sw x0,10(x8)
|
||||
800004a4: 00940303 lb x6,9(x8)
|
||||
800004a8: 1c030063 beq x6,x0,80000668 <fail>
|
||||
800004ac: 00e40303 lb x6,14(x8)
|
||||
800004b0: 1a030c63 beq x6,x0,80000668 <fail>
|
||||
800004b4: 00a40303 lb x6,10(x8)
|
||||
800004b8: 1a031863 bne x6,x0,80000668 <fail>
|
||||
800004bc: 00d40303 lb x6,13(x8)
|
||||
800004c0: 1a031463 bne x6,x0,80000668 <fail>
|
||||
800004c4: 01900193 addi x3,x0,25
|
||||
800004c8: 00000397 auipc x7,0x0
|
||||
800004cc: 03038393 addi x7,x7,48 # 800004f8 <reset_vector+0x4ac>
|
||||
800004d0: 00f40313 addi x6,x8,15
|
||||
800004d4: 000427a3 sw x0,15(x8)
|
||||
800004d8: 00e40303 lb x6,14(x8)
|
||||
800004dc: 18030663 beq x6,x0,80000668 <fail>
|
||||
800004e0: 01340303 lb x6,19(x8)
|
||||
800004e4: 18030263 beq x6,x0,80000668 <fail>
|
||||
800004e8: 00f40303 lb x6,15(x8)
|
||||
800004ec: 16031e63 bne x6,x0,80000668 <fail>
|
||||
800004f0: 01240303 lb x6,18(x8)
|
||||
800004f4: 16031a63 bne x6,x0,80000668 <fail>
|
||||
800004f8: 01a00193 addi x3,x0,26
|
||||
800004fc: 00000397 auipc x7,0x0
|
||||
80000500: 03038393 addi x7,x7,48 # 8000052c <reset_vector+0x4e0>
|
||||
80000504: 01940313 addi x6,x8,25
|
||||
80000508: 00043ca3 sd x0,25(x8)
|
||||
8000050c: 01840303 lb x6,24(x8)
|
||||
80000510: 14030c63 beq x6,x0,80000668 <fail>
|
||||
80000514: 02140303 lb x6,33(x8)
|
||||
80000518: 14030863 beq x6,x0,80000668 <fail>
|
||||
8000051c: 01940303 lb x6,25(x8)
|
||||
80000520: 14031463 bne x6,x0,80000668 <fail>
|
||||
80000524: 02040303 lb x6,32(x8)
|
||||
80000528: 14031063 bne x6,x0,80000668 <fail>
|
||||
8000052c: 01b00193 addi x3,x0,27
|
||||
80000530: 00000397 auipc x7,0x0
|
||||
80000534: 03038393 addi x7,x7,48 # 80000560 <reset_vector+0x514>
|
||||
80000538: 02240313 addi x6,x8,34
|
||||
8000053c: 02043123 sd x0,34(x8)
|
||||
80000540: 02140303 lb x6,33(x8)
|
||||
80000544: 12030263 beq x6,x0,80000668 <fail>
|
||||
80000548: 02a40303 lb x6,42(x8)
|
||||
8000054c: 10030e63 beq x6,x0,80000668 <fail>
|
||||
80000550: 02240303 lb x6,34(x8)
|
||||
80000554: 10031a63 bne x6,x0,80000668 <fail>
|
||||
80000558: 02940303 lb x6,41(x8)
|
||||
8000055c: 10031663 bne x6,x0,80000668 <fail>
|
||||
80000560: 01c00193 addi x3,x0,28
|
||||
80000564: 00000397 auipc x7,0x0
|
||||
80000568: 03038393 addi x7,x7,48 # 80000594 <reset_vector+0x548>
|
||||
8000056c: 02b40313 addi x6,x8,43
|
||||
80000570: 020435a3 sd x0,43(x8)
|
||||
80000574: 02a40303 lb x6,42(x8)
|
||||
80000578: 0e030863 beq x6,x0,80000668 <fail>
|
||||
8000057c: 03340303 lb x6,51(x8)
|
||||
80000580: 0e030463 beq x6,x0,80000668 <fail>
|
||||
80000584: 02b40303 lb x6,43(x8)
|
||||
80000588: 0e031063 bne x6,x0,80000668 <fail>
|
||||
8000058c: 03240303 lb x6,50(x8)
|
||||
80000590: 0c031c63 bne x6,x0,80000668 <fail>
|
||||
80000594: 01d00193 addi x3,x0,29
|
||||
80000598: 00000397 auipc x7,0x0
|
||||
8000059c: 03038393 addi x7,x7,48 # 800005c8 <reset_vector+0x57c>
|
||||
800005a0: 03440313 addi x6,x8,52
|
||||
800005a4: 02043a23 sd x0,52(x8)
|
||||
800005a8: 03340303 lb x6,51(x8)
|
||||
800005ac: 0a030e63 beq x6,x0,80000668 <fail>
|
||||
800005b0: 03c40303 lb x6,60(x8)
|
||||
800005b4: 0a030a63 beq x6,x0,80000668 <fail>
|
||||
800005b8: 03440303 lb x6,52(x8)
|
||||
800005bc: 0a031663 bne x6,x0,80000668 <fail>
|
||||
800005c0: 03b40303 lb x6,59(x8)
|
||||
800005c4: 0a031263 bne x6,x0,80000668 <fail>
|
||||
800005c8: 01e00193 addi x3,x0,30
|
||||
800005cc: 00000397 auipc x7,0x0
|
||||
800005d0: 03038393 addi x7,x7,48 # 800005fc <reset_vector+0x5b0>
|
||||
800005d4: 03d40313 addi x6,x8,61
|
||||
800005d8: 02043ea3 sd x0,61(x8)
|
||||
800005dc: 03c40303 lb x6,60(x8)
|
||||
800005e0: 08030463 beq x6,x0,80000668 <fail>
|
||||
800005e4: 04540303 lb x6,69(x8)
|
||||
800005e8: 08030063 beq x6,x0,80000668 <fail>
|
||||
800005ec: 03d40303 lb x6,61(x8)
|
||||
800005f0: 06031c63 bne x6,x0,80000668 <fail>
|
||||
800005f4: 04440303 lb x6,68(x8)
|
||||
800005f8: 06031863 bne x6,x0,80000668 <fail>
|
||||
800005fc: 01f00193 addi x3,x0,31
|
||||
80000600: 00000397 auipc x7,0x0
|
||||
80000604: 03038393 addi x7,x7,48 # 80000630 <reset_vector+0x5e4>
|
||||
80000608: 04640313 addi x6,x8,70
|
||||
8000060c: 04043323 sd x0,70(x8)
|
||||
80000610: 04540303 lb x6,69(x8)
|
||||
80000614: 04030a63 beq x6,x0,80000668 <fail>
|
||||
80000618: 04e40303 lb x6,78(x8)
|
||||
8000061c: 04030663 beq x6,x0,80000668 <fail>
|
||||
80000620: 04640303 lb x6,70(x8)
|
||||
80000624: 04031263 bne x6,x0,80000668 <fail>
|
||||
80000628: 04d40303 lb x6,77(x8)
|
||||
8000062c: 02031e63 bne x6,x0,80000668 <fail>
|
||||
80000630: 02000193 addi x3,x0,32
|
||||
80000634: 00000397 auipc x7,0x0
|
||||
80000638: 03038393 addi x7,x7,48 # 80000664 <reset_vector+0x618>
|
||||
8000063c: 04f40313 addi x6,x8,79
|
||||
80000640: 040437a3 sd x0,79(x8)
|
||||
80000644: 04e40303 lb x6,78(x8)
|
||||
80000648: 02030063 beq x6,x0,80000668 <fail>
|
||||
8000064c: 05740303 lb x6,87(x8)
|
||||
80000650: 00030c63 beq x6,x0,80000668 <fail>
|
||||
80000654: 04f40303 lb x6,79(x8)
|
||||
80000658: 00031863 bne x6,x0,80000668 <fail>
|
||||
8000065c: 05640303 lb x6,86(x8)
|
||||
80000660: 00031463 bne x6,x0,80000668 <fail>
|
||||
80000664: 02301063 bne x0,x3,80000684 <pass>
|
||||
|
||||
0000000080000668 <fail>:
|
||||
80000668: 0ff0000f fence iorw,iorw
|
||||
8000066c: 00018063 beq x3,x0,8000066c <fail+0x4>
|
||||
80000670: 00119193 slli x3,x3,0x1
|
||||
80000674: 0011e193 ori x3,x3,1
|
||||
80000678: 05d00893 addi x17,x0,93
|
||||
8000067c: 00018513 addi x10,x3,0
|
||||
80000680: 00000073 ecall
|
||||
|
||||
0000000080000684 <pass>:
|
||||
80000684: 0ff0000f fence iorw,iorw
|
||||
80000688: 00100193 addi x3,x0,1
|
||||
8000068c: 05d00893 addi x17,x0,93
|
||||
80000690: 00000513 addi x10,x0,0
|
||||
80000694: 00000073 ecall
|
||||
|
||||
0000000080000698 <mtvec_handler>:
|
||||
80000698: 342022f3 csrrs x5,mcause,x0
|
||||
8000069c: fc9296e3 bne x5,x9,80000668 <fail>
|
||||
800006a0: 343022f3 csrrs x5,mtval,x0
|
||||
800006a4: 00028863 beq x5,x0,800006b4 <mtvec_handler+0x1c>
|
||||
800006a8: fc6290e3 bne x5,x6,80000668 <fail>
|
||||
800006ac: 00028283 lb x5,0(x5)
|
||||
800006b0: fa028ce3 beq x5,x0,80000668 <fail>
|
||||
800006b4: 34139073 csrrw x0,mepc,x7
|
||||
800006b8: 30200073 mret
|
||||
800006bc: c0001073 unimp
|
||||
...
|
||||
@ -0,0 +1,226 @@
|
||||
|
||||
./rv64mi-p-ma_fetch: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 04c0006f jal x0,8000004c <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0a63 beq x30,x31,80000040 <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0663 beq x30,x31,80000040 <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0263 beq x30,x31,80000040 <write_tohost>
|
||||
80000020: 00000f17 auipc x30,0x0
|
||||
80000024: 298f0f13 addi x30,x30,664 # 800002b8 <mtvec_handler>
|
||||
80000028: 000f0463 beq x30,x0,80000030 <trap_vector+0x2c>
|
||||
8000002c: 000f0067 jalr x0,0(x30)
|
||||
80000030: 34202f73 csrrs x30,mcause,x0
|
||||
80000034: 000f5463 bge x30,x0,8000003c <handle_exception>
|
||||
80000038: 0040006f jal x0,8000003c <handle_exception>
|
||||
|
||||
000000008000003c <handle_exception>:
|
||||
8000003c: 5391e193 ori x3,x3,1337
|
||||
|
||||
0000000080000040 <write_tohost>:
|
||||
80000040: 00001f17 auipc x30,0x1
|
||||
80000044: fc3f2023 sw x3,-64(x30) # 80001000 <tohost>
|
||||
80000048: ff9ff06f jal x0,80000040 <write_tohost>
|
||||
|
||||
000000008000004c <reset_vector>:
|
||||
8000004c: 00000093 addi x1,x0,0
|
||||
80000050: 00000113 addi x2,x0,0
|
||||
80000054: 00000193 addi x3,x0,0
|
||||
80000058: 00000213 addi x4,x0,0
|
||||
8000005c: 00000293 addi x5,x0,0
|
||||
80000060: 00000313 addi x6,x0,0
|
||||
80000064: 00000393 addi x7,x0,0
|
||||
80000068: 00000413 addi x8,x0,0
|
||||
8000006c: 00000493 addi x9,x0,0
|
||||
80000070: 00000513 addi x10,x0,0
|
||||
80000074: 00000593 addi x11,x0,0
|
||||
80000078: 00000613 addi x12,x0,0
|
||||
8000007c: 00000693 addi x13,x0,0
|
||||
80000080: 00000713 addi x14,x0,0
|
||||
80000084: 00000793 addi x15,x0,0
|
||||
80000088: 00000813 addi x16,x0,0
|
||||
8000008c: 00000893 addi x17,x0,0
|
||||
80000090: 00000913 addi x18,x0,0
|
||||
80000094: 00000993 addi x19,x0,0
|
||||
80000098: 00000a13 addi x20,x0,0
|
||||
8000009c: 00000a93 addi x21,x0,0
|
||||
800000a0: 00000b13 addi x22,x0,0
|
||||
800000a4: 00000b93 addi x23,x0,0
|
||||
800000a8: 00000c13 addi x24,x0,0
|
||||
800000ac: 00000c93 addi x25,x0,0
|
||||
800000b0: 00000d13 addi x26,x0,0
|
||||
800000b4: 00000d93 addi x27,x0,0
|
||||
800000b8: 00000e13 addi x28,x0,0
|
||||
800000bc: 00000e93 addi x29,x0,0
|
||||
800000c0: 00000f13 addi x30,x0,0
|
||||
800000c4: 00000f93 addi x31,x0,0
|
||||
800000c8: f1402573 csrrs x10,mhartid,x0
|
||||
800000cc: 00051063 bne x10,x0,800000cc <reset_vector+0x80>
|
||||
800000d0: 00000297 auipc x5,0x0
|
||||
800000d4: 01028293 addi x5,x5,16 # 800000e0 <reset_vector+0x94>
|
||||
800000d8: 30529073 csrrw x0,mtvec,x5
|
||||
800000dc: 18005073 csrrwi x0,satp,0
|
||||
800000e0: 00000297 auipc x5,0x0
|
||||
800000e4: 02428293 addi x5,x5,36 # 80000104 <reset_vector+0xb8>
|
||||
800000e8: 30529073 csrrw x0,mtvec,x5
|
||||
800000ec: 0010029b addiw x5,x0,1
|
||||
800000f0: 03529293 slli x5,x5,0x35
|
||||
800000f4: fff28293 addi x5,x5,-1
|
||||
800000f8: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000fc: 01f00293 addi x5,x0,31
|
||||
80000100: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000104: 30405073 csrrwi x0,mie,0
|
||||
80000108: 00000297 auipc x5,0x0
|
||||
8000010c: 01428293 addi x5,x5,20 # 8000011c <reset_vector+0xd0>
|
||||
80000110: 30529073 csrrw x0,mtvec,x5
|
||||
80000114: 30205073 csrrwi x0,medeleg,0
|
||||
80000118: 30305073 csrrwi x0,mideleg,0
|
||||
8000011c: 00000193 addi x3,x0,0
|
||||
80000120: 00000297 auipc x5,0x0
|
||||
80000124: ee428293 addi x5,x5,-284 # 80000004 <trap_vector>
|
||||
80000128: 30529073 csrrw x0,mtvec,x5
|
||||
8000012c: 00100513 addi x10,x0,1
|
||||
80000130: 01f51513 slli x10,x10,0x1f
|
||||
80000134: 00055c63 bge x10,x0,8000014c <reset_vector+0x100>
|
||||
80000138: 0ff0000f fence iorw,iorw
|
||||
8000013c: 00100193 addi x3,x0,1
|
||||
80000140: 05d00893 addi x17,x0,93
|
||||
80000144: 00000513 addi x10,x0,0
|
||||
80000148: 00000073 ecall
|
||||
8000014c: 00000293 addi x5,x0,0
|
||||
80000150: 00028a63 beq x5,x0,80000164 <reset_vector+0x118>
|
||||
80000154: 10529073 csrrw x0,stvec,x5
|
||||
80000158: 0000b2b7 lui x5,0xb
|
||||
8000015c: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
80000160: 30229073 csrrw x0,medeleg,x5
|
||||
80000164: 30005073 csrrwi x0,mstatus,0
|
||||
80000168: 00002537 lui x10,0x2
|
||||
8000016c: 8005051b addiw x10,x10,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000170: 30052073 csrrs x0,mstatus,x10
|
||||
80000174: 00000297 auipc x5,0x0
|
||||
80000178: 01428293 addi x5,x5,20 # 80000188 <reset_vector+0x13c>
|
||||
8000017c: 34129073 csrrw x0,mepc,x5
|
||||
80000180: f1402573 csrrs x10,mhartid,x0
|
||||
80000184: 30200073 mret
|
||||
80000188: 00200193 addi x3,x0,2
|
||||
8000018c: 00000313 addi x6,x0,0
|
||||
80000190: 00000297 auipc x5,0x0
|
||||
80000194: 00c28293 addi x5,x5,12 # 8000019c <reset_vector+0x150>
|
||||
80000198: 00228367 jalr x6,2(x5)
|
||||
8000019c: a011 c.j 800001a0 <reset_vector+0x154>
|
||||
8000019e: a019 c.j 800001a4 <reset_vector+0x158>
|
||||
800001a0: 0e80006f jal x0,80000288 <fail>
|
||||
800001a4: 00300193 addi x3,x0,3
|
||||
800001a8: 00000297 auipc x5,0x0
|
||||
800001ac: 00c28293 addi x5,x5,12 # 800001b4 <reset_vector+0x168>
|
||||
800001b0: 00128367 jalr x6,1(x5)
|
||||
800001b4: 0080006f jal x0,800001bc <reset_vector+0x170>
|
||||
800001b8: 0d00006f jal x0,80000288 <fail>
|
||||
800001bc: 00400193 addi x3,x0,4
|
||||
800001c0: 00000313 addi x6,x0,0
|
||||
800001c4: 00000297 auipc x5,0x0
|
||||
800001c8: 00c28293 addi x5,x5,12 # 800001d0 <reset_vector+0x184>
|
||||
800001cc: 00328367 jalr x6,3(x5)
|
||||
800001d0: a011 c.j 800001d4 <reset_vector+0x188>
|
||||
800001d2: a019 c.j 800001d8 <reset_vector+0x18c>
|
||||
800001d4: 0b40006f jal x0,80000288 <fail>
|
||||
800001d8: 00500193 addi x3,x0,5
|
||||
800001dc: 00000313 addi x6,x0,0
|
||||
800001e0: 00000297 auipc x5,0x0
|
||||
800001e4: 00c28293 addi x5,x5,12 # 800001ec <reset_vector+0x1a0>
|
||||
800001e8: 0060036f jal x6,800001ee <reset_vector+0x1a2>
|
||||
800001ec: a011 c.j 800001f0 <reset_vector+0x1a4>
|
||||
800001ee: a019 c.j 800001f4 <reset_vector+0x1a8>
|
||||
800001f0: 0980006f jal x0,80000288 <fail>
|
||||
800001f4: 00600193 addi x3,x0,6
|
||||
800001f8: 00000313 addi x6,x0,0
|
||||
800001fc: 00000297 auipc x5,0x0
|
||||
80000200: 00c28293 addi x5,x5,12 # 80000208 <reset_vector+0x1bc>
|
||||
80000204: 00000363 beq x0,x0,8000020a <reset_vector+0x1be>
|
||||
80000208: a011 c.j 8000020c <reset_vector+0x1c0>
|
||||
8000020a: a019 c.j 80000210 <reset_vector+0x1c4>
|
||||
8000020c: 07c0006f jal x0,80000288 <fail>
|
||||
80000210: 00700193 addi x3,x0,7
|
||||
80000214: 00001563 bne x0,x0,8000021e <reset_vector+0x1d2>
|
||||
80000218: 00c0006f jal x0,80000224 <reset_vector+0x1d8>
|
||||
8000021c: a009 c.j 8000021e <reset_vector+0x1d2>
|
||||
8000021e: a009 c.j 80000220 <reset_vector+0x1d4>
|
||||
80000220: 0680006f jal x0,80000288 <fail>
|
||||
80000224: 00800193 addi x3,x0,8
|
||||
80000228: 301023f3 csrrs x7,misa,x0
|
||||
8000022c: 0043f393 andi x7,x7,4
|
||||
80000230: 04038863 beq x7,x0,80000280 <reset_vector+0x234>
|
||||
80000234: 0001 c.addi x0,0
|
||||
80000236: 30127073 csrrci x0,misa,4
|
||||
8000023a: 0001 c.addi x0,0
|
||||
8000023c: 301023f3 csrrs x7,misa,x0
|
||||
80000240: 0043f393 andi x7,x7,4
|
||||
80000244: 04038263 beq x7,x0,80000288 <fail>
|
||||
80000248: 00000297 auipc x5,0x0
|
||||
8000024c: 03428293 addi x5,x5,52 # 8000027c <reset_vector+0x230>
|
||||
80000250: ffe28293 addi x5,x5,-2
|
||||
80000254: 34129073 csrrw x0,mepc,x5
|
||||
80000258: 30127073 csrrci x0,misa,4
|
||||
8000025c: 301023f3 csrrs x7,misa,x0
|
||||
80000260: 0043f393 andi x7,x7,4
|
||||
80000264: 00039e63 bne x7,x0,80000280 <reset_vector+0x234>
|
||||
80000268: 000023b7 lui x7,0x2
|
||||
8000026c: 8003839b addiw x7,x7,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000270: 3003a073 csrrs x0,mstatus,x7
|
||||
80000274: 30200073 mret
|
||||
80000278: 00000263 beq x0,x0,8000027c <reset_vector+0x230>
|
||||
8000027c: 30126073 csrrsi x0,misa,4
|
||||
80000280: 0240006f jal x0,800002a4 <pass>
|
||||
80000284: 02301063 bne x0,x3,800002a4 <pass>
|
||||
|
||||
0000000080000288 <fail>:
|
||||
80000288: 0ff0000f fence iorw,iorw
|
||||
8000028c: 00018063 beq x3,x0,8000028c <fail+0x4>
|
||||
80000290: 00119193 slli x3,x3,0x1
|
||||
80000294: 0011e193 ori x3,x3,1
|
||||
80000298: 05d00893 addi x17,x0,93
|
||||
8000029c: 00018513 addi x10,x3,0
|
||||
800002a0: 00000073 ecall
|
||||
|
||||
00000000800002a4 <pass>:
|
||||
800002a4: 0ff0000f fence iorw,iorw
|
||||
800002a8: 00100193 addi x3,x0,1
|
||||
800002ac: 05d00893 addi x17,x0,93
|
||||
800002b0: 00000513 addi x10,x0,0
|
||||
800002b4: 00000073 ecall
|
||||
|
||||
00000000800002b8 <mtvec_handler>:
|
||||
800002b8: 00200513 addi x10,x0,2
|
||||
800002bc: 02a18063 beq x3,x10,800002dc <mtvec_handler+0x24>
|
||||
800002c0: 00400513 addi x10,x0,4
|
||||
800002c4: 00a18c63 beq x3,x10,800002dc <mtvec_handler+0x24>
|
||||
800002c8: 00500513 addi x10,x0,5
|
||||
800002cc: 00a18863 beq x3,x10,800002dc <mtvec_handler+0x24>
|
||||
800002d0: 00600513 addi x10,x0,6
|
||||
800002d4: 00a18463 beq x3,x10,800002dc <mtvec_handler+0x24>
|
||||
800002d8: fb1ff06f jal x0,80000288 <fail>
|
||||
800002dc: fa0316e3 bne x6,x0,80000288 <fail>
|
||||
800002e0: 00000593 addi x11,x0,0
|
||||
800002e4: 34202573 csrrs x10,mcause,x0
|
||||
800002e8: fab510e3 bne x10,x11,80000288 <fail>
|
||||
800002ec: 341025f3 csrrs x11,mepc,x0
|
||||
800002f0: 00458593 addi x11,x11,4
|
||||
800002f4: f8b29ae3 bne x5,x11,80000288 <fail>
|
||||
800002f8: 34302573 csrrs x10,mtval,x0
|
||||
800002fc: 00050663 beq x10,x0,80000308 <mtvec_handler+0x50>
|
||||
80000300: ffe50513 addi x10,x10,-2
|
||||
80000304: f85512e3 bne x10,x5,80000288 <fail>
|
||||
80000308: 00c58593 addi x11,x11,12
|
||||
8000030c: 34159073 csrrw x0,mepc,x11
|
||||
80000310: 30200073 mret
|
||||
80000314: c0001073 unimp
|
||||
...
|
||||
@ -0,0 +1,151 @@
|
||||
|
||||
./rv64mi-p-mcsr: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 0480006f jal x0,80000048 <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0863 beq x30,x31,8000003c <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0463 beq x30,x31,8000003c <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0063 beq x30,x31,8000003c <write_tohost>
|
||||
80000020: 00000f13 addi x30,x0,0
|
||||
80000024: 000f0463 beq x30,x0,8000002c <trap_vector+0x28>
|
||||
80000028: 000f0067 jalr x0,0(x30)
|
||||
8000002c: 34202f73 csrrs x30,mcause,x0
|
||||
80000030: 000f5463 bge x30,x0,80000038 <handle_exception>
|
||||
80000034: 0040006f jal x0,80000038 <handle_exception>
|
||||
|
||||
0000000080000038 <handle_exception>:
|
||||
80000038: 5391e193 ori x3,x3,1337
|
||||
|
||||
000000008000003c <write_tohost>:
|
||||
8000003c: 00001f17 auipc x30,0x1
|
||||
80000040: fc3f2223 sw x3,-60(x30) # 80001000 <tohost>
|
||||
80000044: ff9ff06f jal x0,8000003c <write_tohost>
|
||||
|
||||
0000000080000048 <reset_vector>:
|
||||
80000048: 00000093 addi x1,x0,0
|
||||
8000004c: 00000113 addi x2,x0,0
|
||||
80000050: 00000193 addi x3,x0,0
|
||||
80000054: 00000213 addi x4,x0,0
|
||||
80000058: 00000293 addi x5,x0,0
|
||||
8000005c: 00000313 addi x6,x0,0
|
||||
80000060: 00000393 addi x7,x0,0
|
||||
80000064: 00000413 addi x8,x0,0
|
||||
80000068: 00000493 addi x9,x0,0
|
||||
8000006c: 00000513 addi x10,x0,0
|
||||
80000070: 00000593 addi x11,x0,0
|
||||
80000074: 00000613 addi x12,x0,0
|
||||
80000078: 00000693 addi x13,x0,0
|
||||
8000007c: 00000713 addi x14,x0,0
|
||||
80000080: 00000793 addi x15,x0,0
|
||||
80000084: 00000813 addi x16,x0,0
|
||||
80000088: 00000893 addi x17,x0,0
|
||||
8000008c: 00000913 addi x18,x0,0
|
||||
80000090: 00000993 addi x19,x0,0
|
||||
80000094: 00000a13 addi x20,x0,0
|
||||
80000098: 00000a93 addi x21,x0,0
|
||||
8000009c: 00000b13 addi x22,x0,0
|
||||
800000a0: 00000b93 addi x23,x0,0
|
||||
800000a4: 00000c13 addi x24,x0,0
|
||||
800000a8: 00000c93 addi x25,x0,0
|
||||
800000ac: 00000d13 addi x26,x0,0
|
||||
800000b0: 00000d93 addi x27,x0,0
|
||||
800000b4: 00000e13 addi x28,x0,0
|
||||
800000b8: 00000e93 addi x29,x0,0
|
||||
800000bc: 00000f13 addi x30,x0,0
|
||||
800000c0: 00000f93 addi x31,x0,0
|
||||
800000c4: f1402573 csrrs x10,mhartid,x0
|
||||
800000c8: 00051063 bne x10,x0,800000c8 <reset_vector+0x80>
|
||||
800000cc: 00000297 auipc x5,0x0
|
||||
800000d0: 01028293 addi x5,x5,16 # 800000dc <reset_vector+0x94>
|
||||
800000d4: 30529073 csrrw x0,mtvec,x5
|
||||
800000d8: 18005073 csrrwi x0,satp,0
|
||||
800000dc: 00000297 auipc x5,0x0
|
||||
800000e0: 02428293 addi x5,x5,36 # 80000100 <reset_vector+0xb8>
|
||||
800000e4: 30529073 csrrw x0,mtvec,x5
|
||||
800000e8: 0010029b addiw x5,x0,1
|
||||
800000ec: 03529293 slli x5,x5,0x35
|
||||
800000f0: fff28293 addi x5,x5,-1
|
||||
800000f4: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000f8: 01f00293 addi x5,x0,31
|
||||
800000fc: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000100: 30405073 csrrwi x0,mie,0
|
||||
80000104: 00000297 auipc x5,0x0
|
||||
80000108: 01428293 addi x5,x5,20 # 80000118 <reset_vector+0xd0>
|
||||
8000010c: 30529073 csrrw x0,mtvec,x5
|
||||
80000110: 30205073 csrrwi x0,medeleg,0
|
||||
80000114: 30305073 csrrwi x0,mideleg,0
|
||||
80000118: 00000193 addi x3,x0,0
|
||||
8000011c: 00000297 auipc x5,0x0
|
||||
80000120: ee828293 addi x5,x5,-280 # 80000004 <trap_vector>
|
||||
80000124: 30529073 csrrw x0,mtvec,x5
|
||||
80000128: 00100513 addi x10,x0,1
|
||||
8000012c: 01f51513 slli x10,x10,0x1f
|
||||
80000130: 00055c63 bge x10,x0,80000148 <reset_vector+0x100>
|
||||
80000134: 0ff0000f fence iorw,iorw
|
||||
80000138: 00100193 addi x3,x0,1
|
||||
8000013c: 05d00893 addi x17,x0,93
|
||||
80000140: 00000513 addi x10,x0,0
|
||||
80000144: 00000073 ecall
|
||||
80000148: 00000293 addi x5,x0,0
|
||||
8000014c: 00028a63 beq x5,x0,80000160 <reset_vector+0x118>
|
||||
80000150: 10529073 csrrw x0,stvec,x5
|
||||
80000154: 0000b2b7 lui x5,0xb
|
||||
80000158: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
8000015c: 30229073 csrrw x0,medeleg,x5
|
||||
80000160: 30005073 csrrwi x0,mstatus,0
|
||||
80000164: 00002537 lui x10,0x2
|
||||
80000168: 8005051b addiw x10,x10,-2048 # 1800 <_start-0x7fffe800>
|
||||
8000016c: 30052073 csrrs x0,mstatus,x10
|
||||
80000170: 00000297 auipc x5,0x0
|
||||
80000174: 01428293 addi x5,x5,20 # 80000184 <test_2>
|
||||
80000178: 34129073 csrrw x0,mepc,x5
|
||||
8000017c: f1402573 csrrs x10,mhartid,x0
|
||||
80000180: 30200073 mret
|
||||
|
||||
0000000080000184 <test_2>:
|
||||
80000184: 00200193 addi x3,x0,2
|
||||
80000188: 30102573 csrrs x10,misa,x0
|
||||
8000018c: 03e55513 srli x10,x10,0x3e
|
||||
80000190: 00200393 addi x7,x0,2
|
||||
80000194: 02751863 bne x10,x7,800001c4 <fail>
|
||||
|
||||
0000000080000198 <test_3>:
|
||||
80000198: 00300193 addi x3,x0,3
|
||||
8000019c: f1402573 csrrs x10,mhartid,x0
|
||||
800001a0: 00000393 addi x7,x0,0
|
||||
800001a4: 02751063 bne x10,x7,800001c4 <fail>
|
||||
800001a8: f1302573 csrrs x10,mimpid,x0
|
||||
800001ac: f1202573 csrrs x10,marchid,x0
|
||||
800001b0: f1102573 csrrs x10,mvendorid,x0
|
||||
800001b4: 00000293 addi x5,x0,0
|
||||
800001b8: 3052a073 csrrs x0,mtvec,x5
|
||||
800001bc: 3412a073 csrrs x0,mepc,x5
|
||||
800001c0: 02301063 bne x0,x3,800001e0 <pass>
|
||||
|
||||
00000000800001c4 <fail>:
|
||||
800001c4: 0ff0000f fence iorw,iorw
|
||||
800001c8: 00018063 beq x3,x0,800001c8 <fail+0x4>
|
||||
800001cc: 00119193 slli x3,x3,0x1
|
||||
800001d0: 0011e193 ori x3,x3,1
|
||||
800001d4: 05d00893 addi x17,x0,93
|
||||
800001d8: 00018513 addi x10,x3,0
|
||||
800001dc: 00000073 ecall
|
||||
|
||||
00000000800001e0 <pass>:
|
||||
800001e0: 0ff0000f fence iorw,iorw
|
||||
800001e4: 00100193 addi x3,x0,1
|
||||
800001e8: 05d00893 addi x17,x0,93
|
||||
800001ec: 00000513 addi x10,x0,0
|
||||
800001f0: 00000073 ecall
|
||||
800001f4: c0001073 unimp
|
||||
800001f8: 0000 .insn 2, 0x
|
||||
...
|
||||
@ -0,0 +1,154 @@
|
||||
|
||||
./rv64mi-p-sbreak: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 04c0006f jal x0,8000004c <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0a63 beq x30,x31,80000040 <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0663 beq x30,x31,80000040 <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0263 beq x30,x31,80000040 <write_tohost>
|
||||
80000020: 00000f17 auipc x30,0x0
|
||||
80000024: 1a8f0f13 addi x30,x30,424 # 800001c8 <mtvec_handler>
|
||||
80000028: 000f0463 beq x30,x0,80000030 <trap_vector+0x2c>
|
||||
8000002c: 000f0067 jalr x0,0(x30)
|
||||
80000030: 34202f73 csrrs x30,mcause,x0
|
||||
80000034: 000f5463 bge x30,x0,8000003c <handle_exception>
|
||||
80000038: 0040006f jal x0,8000003c <handle_exception>
|
||||
|
||||
000000008000003c <handle_exception>:
|
||||
8000003c: 5391e193 ori x3,x3,1337
|
||||
|
||||
0000000080000040 <write_tohost>:
|
||||
80000040: 00001f17 auipc x30,0x1
|
||||
80000044: fc3f2023 sw x3,-64(x30) # 80001000 <tohost>
|
||||
80000048: ff9ff06f jal x0,80000040 <write_tohost>
|
||||
|
||||
000000008000004c <reset_vector>:
|
||||
8000004c: 00000093 addi x1,x0,0
|
||||
80000050: 00000113 addi x2,x0,0
|
||||
80000054: 00000193 addi x3,x0,0
|
||||
80000058: 00000213 addi x4,x0,0
|
||||
8000005c: 00000293 addi x5,x0,0
|
||||
80000060: 00000313 addi x6,x0,0
|
||||
80000064: 00000393 addi x7,x0,0
|
||||
80000068: 00000413 addi x8,x0,0
|
||||
8000006c: 00000493 addi x9,x0,0
|
||||
80000070: 00000513 addi x10,x0,0
|
||||
80000074: 00000593 addi x11,x0,0
|
||||
80000078: 00000613 addi x12,x0,0
|
||||
8000007c: 00000693 addi x13,x0,0
|
||||
80000080: 00000713 addi x14,x0,0
|
||||
80000084: 00000793 addi x15,x0,0
|
||||
80000088: 00000813 addi x16,x0,0
|
||||
8000008c: 00000893 addi x17,x0,0
|
||||
80000090: 00000913 addi x18,x0,0
|
||||
80000094: 00000993 addi x19,x0,0
|
||||
80000098: 00000a13 addi x20,x0,0
|
||||
8000009c: 00000a93 addi x21,x0,0
|
||||
800000a0: 00000b13 addi x22,x0,0
|
||||
800000a4: 00000b93 addi x23,x0,0
|
||||
800000a8: 00000c13 addi x24,x0,0
|
||||
800000ac: 00000c93 addi x25,x0,0
|
||||
800000b0: 00000d13 addi x26,x0,0
|
||||
800000b4: 00000d93 addi x27,x0,0
|
||||
800000b8: 00000e13 addi x28,x0,0
|
||||
800000bc: 00000e93 addi x29,x0,0
|
||||
800000c0: 00000f13 addi x30,x0,0
|
||||
800000c4: 00000f93 addi x31,x0,0
|
||||
800000c8: f1402573 csrrs x10,mhartid,x0
|
||||
800000cc: 00051063 bne x10,x0,800000cc <reset_vector+0x80>
|
||||
800000d0: 00000297 auipc x5,0x0
|
||||
800000d4: 01028293 addi x5,x5,16 # 800000e0 <reset_vector+0x94>
|
||||
800000d8: 30529073 csrrw x0,mtvec,x5
|
||||
800000dc: 18005073 csrrwi x0,satp,0
|
||||
800000e0: 00000297 auipc x5,0x0
|
||||
800000e4: 02428293 addi x5,x5,36 # 80000104 <reset_vector+0xb8>
|
||||
800000e8: 30529073 csrrw x0,mtvec,x5
|
||||
800000ec: 0010029b addiw x5,x0,1
|
||||
800000f0: 03529293 slli x5,x5,0x35
|
||||
800000f4: fff28293 addi x5,x5,-1
|
||||
800000f8: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000fc: 01f00293 addi x5,x0,31
|
||||
80000100: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000104: 30405073 csrrwi x0,mie,0
|
||||
80000108: 00000297 auipc x5,0x0
|
||||
8000010c: 01428293 addi x5,x5,20 # 8000011c <reset_vector+0xd0>
|
||||
80000110: 30529073 csrrw x0,mtvec,x5
|
||||
80000114: 30205073 csrrwi x0,medeleg,0
|
||||
80000118: 30305073 csrrwi x0,mideleg,0
|
||||
8000011c: 00000193 addi x3,x0,0
|
||||
80000120: 00000297 auipc x5,0x0
|
||||
80000124: ee428293 addi x5,x5,-284 # 80000004 <trap_vector>
|
||||
80000128: 30529073 csrrw x0,mtvec,x5
|
||||
8000012c: 00100513 addi x10,x0,1
|
||||
80000130: 01f51513 slli x10,x10,0x1f
|
||||
80000134: 00055c63 bge x10,x0,8000014c <reset_vector+0x100>
|
||||
80000138: 0ff0000f fence iorw,iorw
|
||||
8000013c: 00100193 addi x3,x0,1
|
||||
80000140: 05d00893 addi x17,x0,93
|
||||
80000144: 00000513 addi x10,x0,0
|
||||
80000148: 00000073 ecall
|
||||
8000014c: 00000293 addi x5,x0,0
|
||||
80000150: 00028a63 beq x5,x0,80000164 <reset_vector+0x118>
|
||||
80000154: 10529073 csrrw x0,stvec,x5
|
||||
80000158: 0000b2b7 lui x5,0xb
|
||||
8000015c: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
80000160: 30229073 csrrw x0,medeleg,x5
|
||||
80000164: 30005073 csrrwi x0,mstatus,0
|
||||
80000168: 00002537 lui x10,0x2
|
||||
8000016c: 8005051b addiw x10,x10,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000170: 30052073 csrrs x0,mstatus,x10
|
||||
80000174: 00000297 auipc x5,0x0
|
||||
80000178: 01428293 addi x5,x5,20 # 80000188 <reset_vector+0x13c>
|
||||
8000017c: 34129073 csrrw x0,mepc,x5
|
||||
80000180: f1402573 csrrs x10,mhartid,x0
|
||||
80000184: 30200073 mret
|
||||
80000188: 00200193 addi x3,x0,2
|
||||
|
||||
000000008000018c <do_break>:
|
||||
8000018c: 00100073 ebreak
|
||||
80000190: 0080006f jal x0,80000198 <fail>
|
||||
80000194: 02301063 bne x0,x3,800001b4 <pass>
|
||||
|
||||
0000000080000198 <fail>:
|
||||
80000198: 0ff0000f fence iorw,iorw
|
||||
8000019c: 00018063 beq x3,x0,8000019c <fail+0x4>
|
||||
800001a0: 00119193 slli x3,x3,0x1
|
||||
800001a4: 0011e193 ori x3,x3,1
|
||||
800001a8: 05d00893 addi x17,x0,93
|
||||
800001ac: 00018513 addi x10,x3,0
|
||||
800001b0: 00000073 ecall
|
||||
|
||||
00000000800001b4 <pass>:
|
||||
800001b4: 0ff0000f fence iorw,iorw
|
||||
800001b8: 00100193 addi x3,x0,1
|
||||
800001bc: 05d00893 addi x17,x0,93
|
||||
800001c0: 00000513 addi x10,x0,0
|
||||
800001c4: 00000073 ecall
|
||||
|
||||
00000000800001c8 <mtvec_handler>:
|
||||
800001c8: 00300313 addi x6,x0,3
|
||||
800001cc: 342022f3 csrrs x5,mcause,x0
|
||||
800001d0: 305023f3 csrrs x7,mtvec,x0
|
||||
800001d4: 0023f393 andi x7,x7,2
|
||||
800001d8: 00038463 beq x7,x0,800001e0 <skip_mask>
|
||||
800001dc: 0ff2f293 andi x5,x5,255
|
||||
|
||||
00000000800001e0 <skip_mask>:
|
||||
800001e0: fa629ce3 bne x5,x6,80000198 <fail>
|
||||
800001e4: 00000317 auipc x6,0x0
|
||||
800001e8: fa830313 addi x6,x6,-88 # 8000018c <do_break>
|
||||
800001ec: 341022f3 csrrs x5,mepc,x0
|
||||
800001f0: fa6294e3 bne x5,x6,80000198 <fail>
|
||||
800001f4: fc1ff06f jal x0,800001b4 <pass>
|
||||
800001f8: c0001073 unimp
|
||||
800001fc: 0000 .insn 2, 0x
|
||||
...
|
||||
@ -0,0 +1,168 @@
|
||||
|
||||
./rv64mi-p-scall: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 04c0006f jal x0,8000004c <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0a63 beq x30,x31,80000040 <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0663 beq x30,x31,80000040 <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0263 beq x30,x31,80000040 <write_tohost>
|
||||
80000020: 00000f17 auipc x30,0x0
|
||||
80000024: 1e8f0f13 addi x30,x30,488 # 80000208 <mtvec_handler>
|
||||
80000028: 000f0463 beq x30,x0,80000030 <trap_vector+0x2c>
|
||||
8000002c: 000f0067 jalr x0,0(x30)
|
||||
80000030: 34202f73 csrrs x30,mcause,x0
|
||||
80000034: 000f5463 bge x30,x0,8000003c <handle_exception>
|
||||
80000038: 0040006f jal x0,8000003c <handle_exception>
|
||||
|
||||
000000008000003c <handle_exception>:
|
||||
8000003c: 5391e193 ori x3,x3,1337
|
||||
|
||||
0000000080000040 <write_tohost>:
|
||||
80000040: 00001f17 auipc x30,0x1
|
||||
80000044: fc3f2023 sw x3,-64(x30) # 80001000 <tohost>
|
||||
80000048: ff9ff06f jal x0,80000040 <write_tohost>
|
||||
|
||||
000000008000004c <reset_vector>:
|
||||
8000004c: 00000093 addi x1,x0,0
|
||||
80000050: 00000113 addi x2,x0,0
|
||||
80000054: 00000193 addi x3,x0,0
|
||||
80000058: 00000213 addi x4,x0,0
|
||||
8000005c: 00000293 addi x5,x0,0
|
||||
80000060: 00000313 addi x6,x0,0
|
||||
80000064: 00000393 addi x7,x0,0
|
||||
80000068: 00000413 addi x8,x0,0
|
||||
8000006c: 00000493 addi x9,x0,0
|
||||
80000070: 00000513 addi x10,x0,0
|
||||
80000074: 00000593 addi x11,x0,0
|
||||
80000078: 00000613 addi x12,x0,0
|
||||
8000007c: 00000693 addi x13,x0,0
|
||||
80000080: 00000713 addi x14,x0,0
|
||||
80000084: 00000793 addi x15,x0,0
|
||||
80000088: 00000813 addi x16,x0,0
|
||||
8000008c: 00000893 addi x17,x0,0
|
||||
80000090: 00000913 addi x18,x0,0
|
||||
80000094: 00000993 addi x19,x0,0
|
||||
80000098: 00000a13 addi x20,x0,0
|
||||
8000009c: 00000a93 addi x21,x0,0
|
||||
800000a0: 00000b13 addi x22,x0,0
|
||||
800000a4: 00000b93 addi x23,x0,0
|
||||
800000a8: 00000c13 addi x24,x0,0
|
||||
800000ac: 00000c93 addi x25,x0,0
|
||||
800000b0: 00000d13 addi x26,x0,0
|
||||
800000b4: 00000d93 addi x27,x0,0
|
||||
800000b8: 00000e13 addi x28,x0,0
|
||||
800000bc: 00000e93 addi x29,x0,0
|
||||
800000c0: 00000f13 addi x30,x0,0
|
||||
800000c4: 00000f93 addi x31,x0,0
|
||||
800000c8: f1402573 csrrs x10,mhartid,x0
|
||||
800000cc: 00051063 bne x10,x0,800000cc <reset_vector+0x80>
|
||||
800000d0: 00000297 auipc x5,0x0
|
||||
800000d4: 01028293 addi x5,x5,16 # 800000e0 <reset_vector+0x94>
|
||||
800000d8: 30529073 csrrw x0,mtvec,x5
|
||||
800000dc: 18005073 csrrwi x0,satp,0
|
||||
800000e0: 00000297 auipc x5,0x0
|
||||
800000e4: 02428293 addi x5,x5,36 # 80000104 <reset_vector+0xb8>
|
||||
800000e8: 30529073 csrrw x0,mtvec,x5
|
||||
800000ec: 0010029b addiw x5,x0,1
|
||||
800000f0: 03529293 slli x5,x5,0x35
|
||||
800000f4: fff28293 addi x5,x5,-1
|
||||
800000f8: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000fc: 01f00293 addi x5,x0,31
|
||||
80000100: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000104: 30405073 csrrwi x0,mie,0
|
||||
80000108: 00000297 auipc x5,0x0
|
||||
8000010c: 01428293 addi x5,x5,20 # 8000011c <reset_vector+0xd0>
|
||||
80000110: 30529073 csrrw x0,mtvec,x5
|
||||
80000114: 30205073 csrrwi x0,medeleg,0
|
||||
80000118: 30305073 csrrwi x0,mideleg,0
|
||||
8000011c: 00000193 addi x3,x0,0
|
||||
80000120: 00000297 auipc x5,0x0
|
||||
80000124: ee428293 addi x5,x5,-284 # 80000004 <trap_vector>
|
||||
80000128: 30529073 csrrw x0,mtvec,x5
|
||||
8000012c: 00100513 addi x10,x0,1
|
||||
80000130: 01f51513 slli x10,x10,0x1f
|
||||
80000134: 00055c63 bge x10,x0,8000014c <reset_vector+0x100>
|
||||
80000138: 0ff0000f fence iorw,iorw
|
||||
8000013c: 00100193 addi x3,x0,1
|
||||
80000140: 05d00893 addi x17,x0,93
|
||||
80000144: 00000513 addi x10,x0,0
|
||||
80000148: 00000073 ecall
|
||||
8000014c: 00000293 addi x5,x0,0
|
||||
80000150: 00028a63 beq x5,x0,80000164 <reset_vector+0x118>
|
||||
80000154: 10529073 csrrw x0,stvec,x5
|
||||
80000158: 0000b2b7 lui x5,0xb
|
||||
8000015c: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
80000160: 30229073 csrrw x0,medeleg,x5
|
||||
80000164: 30005073 csrrwi x0,mstatus,0
|
||||
80000168: 00002537 lui x10,0x2
|
||||
8000016c: 8005051b addiw x10,x10,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000170: 30052073 csrrs x0,mstatus,x10
|
||||
80000174: 00000297 auipc x5,0x0
|
||||
80000178: 01428293 addi x5,x5,20 # 80000188 <reset_vector+0x13c>
|
||||
8000017c: 34129073 csrrw x0,mepc,x5
|
||||
80000180: f1402573 csrrs x10,mhartid,x0
|
||||
80000184: 30200073 mret
|
||||
80000188: 00200193 addi x3,x0,2
|
||||
8000018c: 00800313 addi x6,x0,8
|
||||
80000190: 000022b7 lui x5,0x2
|
||||
80000194: 8002829b addiw x5,x5,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000198: 3002b073 csrrc x0,mstatus,x5
|
||||
8000019c: 300023f3 csrrs x7,mstatus,x0
|
||||
800001a0: 0072f2b3 and x5,x5,x7
|
||||
800001a4: 00028463 beq x5,x0,800001ac <reset_vector+0x160>
|
||||
800001a8: 00b00313 addi x6,x0,11
|
||||
800001ac: 000022b7 lui x5,0x2
|
||||
800001b0: 8002829b addiw x5,x5,-2048 # 1800 <_start-0x7fffe800>
|
||||
800001b4: 3002b073 csrrc x0,mstatus,x5
|
||||
800001b8: 00000297 auipc x5,0x0
|
||||
800001bc: 01028293 addi x5,x5,16 # 800001c8 <reset_vector+0x17c>
|
||||
800001c0: 34129073 csrrw x0,mepc,x5
|
||||
800001c4: 30200073 mret
|
||||
800001c8: 00100193 addi x3,x0,1
|
||||
|
||||
00000000800001cc <do_scall>:
|
||||
800001cc: 00000073 ecall
|
||||
800001d0: 0080006f jal x0,800001d8 <fail>
|
||||
800001d4: 02301063 bne x0,x3,800001f4 <pass>
|
||||
|
||||
00000000800001d8 <fail>:
|
||||
800001d8: 0ff0000f fence iorw,iorw
|
||||
800001dc: 00018063 beq x3,x0,800001dc <fail+0x4>
|
||||
800001e0: 00119193 slli x3,x3,0x1
|
||||
800001e4: 0011e193 ori x3,x3,1
|
||||
800001e8: 05d00893 addi x17,x0,93
|
||||
800001ec: 00018513 addi x10,x3,0
|
||||
800001f0: 00000073 ecall
|
||||
|
||||
00000000800001f4 <pass>:
|
||||
800001f4: 0ff0000f fence iorw,iorw
|
||||
800001f8: 00100193 addi x3,x0,1
|
||||
800001fc: 05d00893 addi x17,x0,93
|
||||
80000200: 00000513 addi x10,x0,0
|
||||
80000204: 00000073 ecall
|
||||
|
||||
0000000080000208 <mtvec_handler>:
|
||||
80000208: 342022f3 csrrs x5,mcause,x0
|
||||
8000020c: 305023f3 csrrs x7,mtvec,x0
|
||||
80000210: 0023f393 andi x7,x7,2
|
||||
80000214: 00038463 beq x7,x0,8000021c <skip_mask>
|
||||
80000218: 0ff2f293 andi x5,x5,255
|
||||
|
||||
000000008000021c <skip_mask>:
|
||||
8000021c: fa629ee3 bne x5,x6,800001d8 <fail>
|
||||
80000220: 00000397 auipc x7,0x0
|
||||
80000224: fac38393 addi x7,x7,-84 # 800001cc <do_scall>
|
||||
80000228: 341022f3 csrrs x5,mepc,x0
|
||||
8000022c: fa7296e3 bne x5,x7,800001d8 <fail>
|
||||
80000230: fc5ff06f jal x0,800001f4 <pass>
|
||||
80000234: c0001073 unimp
|
||||
...
|
||||
@ -0,0 +1,359 @@
|
||||
|
||||
./rv64mi-p-sd-misaligned: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 04c0006f jal x0,8000004c <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0a63 beq x30,x31,80000040 <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0663 beq x30,x31,80000040 <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0263 beq x30,x31,80000040 <write_tohost>
|
||||
80000020: 00000f17 auipc x30,0x0
|
||||
80000024: 4ccf0f13 addi x30,x30,1228 # 800004ec <mtvec_handler>
|
||||
80000028: 000f0463 beq x30,x0,80000030 <trap_vector+0x2c>
|
||||
8000002c: 000f0067 jalr x0,0(x30)
|
||||
80000030: 34202f73 csrrs x30,mcause,x0
|
||||
80000034: 000f5463 bge x30,x0,8000003c <handle_exception>
|
||||
80000038: 0040006f jal x0,8000003c <handle_exception>
|
||||
|
||||
000000008000003c <handle_exception>:
|
||||
8000003c: 5391e193 ori x3,x3,1337
|
||||
|
||||
0000000080000040 <write_tohost>:
|
||||
80000040: 00001f17 auipc x30,0x1
|
||||
80000044: fc3f2023 sw x3,-64(x30) # 80001000 <tohost>
|
||||
80000048: ff9ff06f jal x0,80000040 <write_tohost>
|
||||
|
||||
000000008000004c <reset_vector>:
|
||||
8000004c: 00000093 addi x1,x0,0
|
||||
80000050: 00000113 addi x2,x0,0
|
||||
80000054: 00000193 addi x3,x0,0
|
||||
80000058: 00000213 addi x4,x0,0
|
||||
8000005c: 00000293 addi x5,x0,0
|
||||
80000060: 00000313 addi x6,x0,0
|
||||
80000064: 00000393 addi x7,x0,0
|
||||
80000068: 00000413 addi x8,x0,0
|
||||
8000006c: 00000493 addi x9,x0,0
|
||||
80000070: 00000513 addi x10,x0,0
|
||||
80000074: 00000593 addi x11,x0,0
|
||||
80000078: 00000613 addi x12,x0,0
|
||||
8000007c: 00000693 addi x13,x0,0
|
||||
80000080: 00000713 addi x14,x0,0
|
||||
80000084: 00000793 addi x15,x0,0
|
||||
80000088: 00000813 addi x16,x0,0
|
||||
8000008c: 00000893 addi x17,x0,0
|
||||
80000090: 00000913 addi x18,x0,0
|
||||
80000094: 00000993 addi x19,x0,0
|
||||
80000098: 00000a13 addi x20,x0,0
|
||||
8000009c: 00000a93 addi x21,x0,0
|
||||
800000a0: 00000b13 addi x22,x0,0
|
||||
800000a4: 00000b93 addi x23,x0,0
|
||||
800000a8: 00000c13 addi x24,x0,0
|
||||
800000ac: 00000c93 addi x25,x0,0
|
||||
800000b0: 00000d13 addi x26,x0,0
|
||||
800000b4: 00000d93 addi x27,x0,0
|
||||
800000b8: 00000e13 addi x28,x0,0
|
||||
800000bc: 00000e93 addi x29,x0,0
|
||||
800000c0: 00000f13 addi x30,x0,0
|
||||
800000c4: 00000f93 addi x31,x0,0
|
||||
800000c8: f1402573 csrrs x10,mhartid,x0
|
||||
800000cc: 00051063 bne x10,x0,800000cc <reset_vector+0x80>
|
||||
800000d0: 00000297 auipc x5,0x0
|
||||
800000d4: 01028293 addi x5,x5,16 # 800000e0 <reset_vector+0x94>
|
||||
800000d8: 30529073 csrrw x0,mtvec,x5
|
||||
800000dc: 18005073 csrrwi x0,satp,0
|
||||
800000e0: 00000297 auipc x5,0x0
|
||||
800000e4: 02428293 addi x5,x5,36 # 80000104 <reset_vector+0xb8>
|
||||
800000e8: 30529073 csrrw x0,mtvec,x5
|
||||
800000ec: 0010029b addiw x5,x0,1
|
||||
800000f0: 03529293 slli x5,x5,0x35
|
||||
800000f4: fff28293 addi x5,x5,-1
|
||||
800000f8: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000fc: 01f00293 addi x5,x0,31
|
||||
80000100: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000104: 30405073 csrrwi x0,mie,0
|
||||
80000108: 00000297 auipc x5,0x0
|
||||
8000010c: 01428293 addi x5,x5,20 # 8000011c <reset_vector+0xd0>
|
||||
80000110: 30529073 csrrw x0,mtvec,x5
|
||||
80000114: 30205073 csrrwi x0,medeleg,0
|
||||
80000118: 30305073 csrrwi x0,mideleg,0
|
||||
8000011c: 00000193 addi x3,x0,0
|
||||
80000120: 00000297 auipc x5,0x0
|
||||
80000124: ee428293 addi x5,x5,-284 # 80000004 <trap_vector>
|
||||
80000128: 30529073 csrrw x0,mtvec,x5
|
||||
8000012c: 00100513 addi x10,x0,1
|
||||
80000130: 01f51513 slli x10,x10,0x1f
|
||||
80000134: 00055c63 bge x10,x0,8000014c <reset_vector+0x100>
|
||||
80000138: 0ff0000f fence iorw,iorw
|
||||
8000013c: 00100193 addi x3,x0,1
|
||||
80000140: 05d00893 addi x17,x0,93
|
||||
80000144: 00000513 addi x10,x0,0
|
||||
80000148: 00000073 ecall
|
||||
8000014c: 00000293 addi x5,x0,0
|
||||
80000150: 00028a63 beq x5,x0,80000164 <reset_vector+0x118>
|
||||
80000154: 10529073 csrrw x0,stvec,x5
|
||||
80000158: 0000b2b7 lui x5,0xb
|
||||
8000015c: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
80000160: 30229073 csrrw x0,medeleg,x5
|
||||
80000164: 30005073 csrrwi x0,mstatus,0
|
||||
80000168: 00002537 lui x10,0x2
|
||||
8000016c: 8005051b addiw x10,x10,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000170: 30052073 csrrs x0,mstatus,x10
|
||||
80000174: 00000297 auipc x5,0x0
|
||||
80000178: 01428293 addi x5,x5,20 # 80000188 <test_2>
|
||||
8000017c: 34129073 csrrw x0,mepc,x5
|
||||
80000180: f1402573 csrrs x10,mhartid,x0
|
||||
80000184: 30200073 mret
|
||||
|
||||
0000000080000188 <test_2>:
|
||||
80000188: 00200193 addi x3,x0,2
|
||||
8000018c: 00002097 auipc x1,0x2
|
||||
80000190: e7408093 addi x1,x1,-396 # 80002000 <begin_signature>
|
||||
80000194: 00408137 lui x2,0x408
|
||||
80000198: 0c11011b addiw x2,x2,193 # 4080c1 <_start-0x7fbf7f3f>
|
||||
8000019c: 01111113 slli x2,x2,0x11
|
||||
800001a0: 28310113 addi x2,x2,643
|
||||
800001a4: 01111113 slli x2,x2,0x11
|
||||
800001a8: 70810113 addi x2,x2,1800
|
||||
800001ac: 00000797 auipc x15,0x0
|
||||
800001b0: 01478793 addi x15,x15,20 # 800001c0 <test_2+0x38>
|
||||
800001b4: 0020b023 sd x2,0(x1)
|
||||
800001b8: 0000b703 ld x14,0(x1)
|
||||
800001bc: 0080006f jal x0,800001c4 <test_2+0x3c>
|
||||
800001c0: 00010713 addi x14,x2,0
|
||||
800001c4: 004083b7 lui x7,0x408
|
||||
800001c8: 0c13839b addiw x7,x7,193 # 4080c1 <_start-0x7fbf7f3f>
|
||||
800001cc: 01139393 slli x7,x7,0x11
|
||||
800001d0: 28338393 addi x7,x7,643
|
||||
800001d4: 01139393 slli x7,x7,0x11
|
||||
800001d8: 70838393 addi x7,x7,1800
|
||||
800001dc: 2e771063 bne x14,x7,800004bc <fail>
|
||||
|
||||
00000000800001e0 <test_3>:
|
||||
800001e0: 00300193 addi x3,x0,3
|
||||
800001e4: 00002097 auipc x1,0x2
|
||||
800001e8: e1c08093 addi x1,x1,-484 # 80002000 <begin_signature>
|
||||
800001ec: 0090a137 lui x2,0x90a
|
||||
800001f0: 0b11011b addiw x2,x2,177 # 90a0b1 <_start-0x7f6f5f4f>
|
||||
800001f4: 00c11113 slli x2,x2,0xc
|
||||
800001f8: c0d10113 addi x2,x2,-1011
|
||||
800001fc: 00c11113 slli x2,x2,0xc
|
||||
80000200: 0e110113 addi x2,x2,225
|
||||
80000204: 00c11113 slli x2,x2,0xc
|
||||
80000208: f1010113 addi x2,x2,-240
|
||||
8000020c: 00000797 auipc x15,0x0
|
||||
80000210: 01478793 addi x15,x15,20 # 80000220 <test_3+0x40>
|
||||
80000214: 0020b0a3 sd x2,1(x1)
|
||||
80000218: 0010b703 ld x14,1(x1)
|
||||
8000021c: 0080006f jal x0,80000224 <test_3+0x44>
|
||||
80000220: 00010713 addi x14,x2,0
|
||||
80000224: 0090a3b7 lui x7,0x90a
|
||||
80000228: 0b13839b addiw x7,x7,177 # 90a0b1 <_start-0x7f6f5f4f>
|
||||
8000022c: 00c39393 slli x7,x7,0xc
|
||||
80000230: c0d38393 addi x7,x7,-1011
|
||||
80000234: 00c39393 slli x7,x7,0xc
|
||||
80000238: 0e138393 addi x7,x7,225
|
||||
8000023c: 00c39393 slli x7,x7,0xc
|
||||
80000240: f1038393 addi x7,x7,-240
|
||||
80000244: 26771c63 bne x14,x7,800004bc <fail>
|
||||
|
||||
0000000080000248 <test_4>:
|
||||
80000248: 00400193 addi x3,x0,4
|
||||
8000024c: 00002097 auipc x1,0x2
|
||||
80000250: db408093 addi x1,x1,-588 # 80002000 <begin_signature>
|
||||
80000254: 01112137 lui x2,0x1112
|
||||
80000258: 1311011b addiw x2,x2,305 # 1112131 <_start-0x7eeedecf>
|
||||
8000025c: 00c11113 slli x2,x2,0xc
|
||||
80000260: 41510113 addi x2,x2,1045
|
||||
80000264: 00c11113 slli x2,x2,0xc
|
||||
80000268: 16110113 addi x2,x2,353
|
||||
8000026c: 00c11113 slli x2,x2,0xc
|
||||
80000270: 71810113 addi x2,x2,1816
|
||||
80000274: 00000797 auipc x15,0x0
|
||||
80000278: 01478793 addi x15,x15,20 # 80000288 <test_4+0x40>
|
||||
8000027c: 0020b123 sd x2,2(x1)
|
||||
80000280: 0020b703 ld x14,2(x1)
|
||||
80000284: 0080006f jal x0,8000028c <test_4+0x44>
|
||||
80000288: 00010713 addi x14,x2,0
|
||||
8000028c: 011123b7 lui x7,0x1112
|
||||
80000290: 1313839b addiw x7,x7,305 # 1112131 <_start-0x7eeedecf>
|
||||
80000294: 00c39393 slli x7,x7,0xc
|
||||
80000298: 41538393 addi x7,x7,1045
|
||||
8000029c: 00c39393 slli x7,x7,0xc
|
||||
800002a0: 16138393 addi x7,x7,353
|
||||
800002a4: 00c39393 slli x7,x7,0xc
|
||||
800002a8: 71838393 addi x7,x7,1816
|
||||
800002ac: 20771863 bne x14,x7,800004bc <fail>
|
||||
|
||||
00000000800002b0 <test_5>:
|
||||
800002b0: 00500193 addi x3,x0,5
|
||||
800002b4: 00002097 auipc x1,0x2
|
||||
800002b8: d4c08093 addi x1,x1,-692 # 80002000 <begin_signature>
|
||||
800002bc: 00c8d137 lui x2,0xc8d
|
||||
800002c0: 0d91011b addiw x2,x2,217 # c8d0d9 <_start-0x7f372f27>
|
||||
800002c4: 00c11113 slli x2,x2,0xc
|
||||
800002c8: e0f10113 addi x2,x2,-497
|
||||
800002cc: 00c11113 slli x2,x2,0xc
|
||||
800002d0: 8f110113 addi x2,x2,-1807
|
||||
800002d4: 00d11113 slli x2,x2,0xd
|
||||
800002d8: f2010113 addi x2,x2,-224
|
||||
800002dc: 00000797 auipc x15,0x0
|
||||
800002e0: 01478793 addi x15,x15,20 # 800002f0 <test_5+0x40>
|
||||
800002e4: 0020b1a3 sd x2,3(x1)
|
||||
800002e8: 0030b703 ld x14,3(x1)
|
||||
800002ec: 0080006f jal x0,800002f4 <test_5+0x44>
|
||||
800002f0: 00010713 addi x14,x2,0
|
||||
800002f4: 00c8d3b7 lui x7,0xc8d
|
||||
800002f8: 0d93839b addiw x7,x7,217 # c8d0d9 <_start-0x7f372f27>
|
||||
800002fc: 00c39393 slli x7,x7,0xc
|
||||
80000300: e0f38393 addi x7,x7,-497
|
||||
80000304: 00c39393 slli x7,x7,0xc
|
||||
80000308: 8f138393 addi x7,x7,-1807
|
||||
8000030c: 00d39393 slli x7,x7,0xd
|
||||
80000310: f2038393 addi x7,x7,-224
|
||||
80000314: 1a771463 bne x14,x7,800004bc <fail>
|
||||
|
||||
0000000080000318 <test_6>:
|
||||
80000318: 00600193 addi x3,x0,6
|
||||
8000031c: 00002097 auipc x1,0x2
|
||||
80000320: ce408093 addi x1,x1,-796 # 80002000 <begin_signature>
|
||||
80000324: 01091137 lui x2,0x1091
|
||||
80000328: 1191011b addiw x2,x2,281 # 1091119 <_start-0x7ef6eee7>
|
||||
8000032c: 00c11113 slli x2,x2,0xc
|
||||
80000330: 21310113 addi x2,x2,531
|
||||
80000334: 00c11113 slli x2,x2,0xc
|
||||
80000338: 93110113 addi x2,x2,-1743
|
||||
8000033c: 00d11113 slli x2,x2,0xd
|
||||
80000340: 72810113 addi x2,x2,1832
|
||||
80000344: 00000797 auipc x15,0x0
|
||||
80000348: 01478793 addi x15,x15,20 # 80000358 <test_6+0x40>
|
||||
8000034c: 0020b223 sd x2,4(x1)
|
||||
80000350: 0040b703 ld x14,4(x1)
|
||||
80000354: 0080006f jal x0,8000035c <test_6+0x44>
|
||||
80000358: 00010713 addi x14,x2,0
|
||||
8000035c: 010913b7 lui x7,0x1091
|
||||
80000360: 1193839b addiw x7,x7,281 # 1091119 <_start-0x7ef6eee7>
|
||||
80000364: 00c39393 slli x7,x7,0xc
|
||||
80000368: 21338393 addi x7,x7,531
|
||||
8000036c: 00c39393 slli x7,x7,0xc
|
||||
80000370: 93138393 addi x7,x7,-1743
|
||||
80000374: 00d39393 slli x7,x7,0xd
|
||||
80000378: 72838393 addi x7,x7,1832
|
||||
8000037c: 14771063 bne x14,x7,800004bc <fail>
|
||||
|
||||
0000000080000380 <test_7>:
|
||||
80000380: 00700193 addi x3,x0,7
|
||||
80000384: 00002097 auipc x1,0x2
|
||||
80000388: c7c08093 addi x1,x1,-900 # 80002000 <begin_signature>
|
||||
8000038c: 0292a137 lui x2,0x292a
|
||||
80000390: 2b31011b addiw x2,x2,691 # 292a2b3 <_start-0x7d6d5d4d>
|
||||
80000394: 00c11113 slli x2,x2,0xc
|
||||
80000398: c2d10113 addi x2,x2,-979
|
||||
8000039c: 00c11113 slli x2,x2,0xc
|
||||
800003a0: 2e310113 addi x2,x2,739
|
||||
800003a4: 00c11113 slli x2,x2,0xc
|
||||
800003a8: f3010113 addi x2,x2,-208
|
||||
800003ac: 00000797 auipc x15,0x0
|
||||
800003b0: 01478793 addi x15,x15,20 # 800003c0 <test_7+0x40>
|
||||
800003b4: 0020b2a3 sd x2,5(x1)
|
||||
800003b8: 0050b703 ld x14,5(x1)
|
||||
800003bc: 0080006f jal x0,800003c4 <test_7+0x44>
|
||||
800003c0: 00010713 addi x14,x2,0
|
||||
800003c4: 0292a3b7 lui x7,0x292a
|
||||
800003c8: 2b33839b addiw x7,x7,691 # 292a2b3 <_start-0x7d6d5d4d>
|
||||
800003cc: 00c39393 slli x7,x7,0xc
|
||||
800003d0: c2d38393 addi x7,x7,-979
|
||||
800003d4: 00c39393 slli x7,x7,0xc
|
||||
800003d8: 2e338393 addi x7,x7,739
|
||||
800003dc: 00c39393 slli x7,x7,0xc
|
||||
800003e0: f3038393 addi x7,x7,-208
|
||||
800003e4: 0c771c63 bne x14,x7,800004bc <fail>
|
||||
|
||||
00000000800003e8 <test_8>:
|
||||
800003e8: 00800193 addi x3,x0,8
|
||||
800003ec: 00002097 auipc x1,0x2
|
||||
800003f0: c1408093 addi x1,x1,-1004 # 80002000 <begin_signature>
|
||||
800003f4: 03132137 lui x2,0x3132
|
||||
800003f8: 3331011b addiw x2,x2,819 # 3132333 <_start-0x7cecdccd>
|
||||
800003fc: 00c11113 slli x2,x2,0xc
|
||||
80000400: 43510113 addi x2,x2,1077
|
||||
80000404: 00c11113 slli x2,x2,0xc
|
||||
80000408: 36310113 addi x2,x2,867
|
||||
8000040c: 00c11113 slli x2,x2,0xc
|
||||
80000410: 73810113 addi x2,x2,1848
|
||||
80000414: 00000797 auipc x15,0x0
|
||||
80000418: 01478793 addi x15,x15,20 # 80000428 <test_8+0x40>
|
||||
8000041c: 0020b323 sd x2,6(x1)
|
||||
80000420: 0060b703 ld x14,6(x1)
|
||||
80000424: 0080006f jal x0,8000042c <test_8+0x44>
|
||||
80000428: 00010713 addi x14,x2,0
|
||||
8000042c: 031323b7 lui x7,0x3132
|
||||
80000430: 3333839b addiw x7,x7,819 # 3132333 <_start-0x7cecdccd>
|
||||
80000434: 00c39393 slli x7,x7,0xc
|
||||
80000438: 43538393 addi x7,x7,1077
|
||||
8000043c: 00c39393 slli x7,x7,0xc
|
||||
80000440: 36338393 addi x7,x7,867
|
||||
80000444: 00c39393 slli x7,x7,0xc
|
||||
80000448: 73838393 addi x7,x7,1848
|
||||
8000044c: 06771863 bne x14,x7,800004bc <fail>
|
||||
|
||||
0000000080000450 <test_9>:
|
||||
80000450: 00900193 addi x3,x0,9
|
||||
80000454: 00002097 auipc x1,0x2
|
||||
80000458: bac08093 addi x1,x1,-1108 # 80002000 <begin_signature>
|
||||
8000045c: 00e4f137 lui x2,0xe4f
|
||||
80000460: 8ed1011b addiw x2,x2,-1811 # e4e8ed <_start-0x7f1b1713>
|
||||
80000464: 00c11113 slli x2,x2,0xc
|
||||
80000468: f0f10113 addi x2,x2,-241
|
||||
8000046c: 00c11113 slli x2,x2,0xc
|
||||
80000470: 4f910113 addi x2,x2,1273
|
||||
80000474: 00e11113 slli x2,x2,0xe
|
||||
80000478: f4010113 addi x2,x2,-192
|
||||
8000047c: 00000797 auipc x15,0x0
|
||||
80000480: 01478793 addi x15,x15,20 # 80000490 <test_9+0x40>
|
||||
80000484: 0020b3a3 sd x2,7(x1)
|
||||
80000488: 0070b703 ld x14,7(x1)
|
||||
8000048c: 0080006f jal x0,80000494 <test_9+0x44>
|
||||
80000490: 00010713 addi x14,x2,0
|
||||
80000494: 00e4f3b7 lui x7,0xe4f
|
||||
80000498: 8ed3839b addiw x7,x7,-1811 # e4e8ed <_start-0x7f1b1713>
|
||||
8000049c: 00c39393 slli x7,x7,0xc
|
||||
800004a0: f0f38393 addi x7,x7,-241
|
||||
800004a4: 00c39393 slli x7,x7,0xc
|
||||
800004a8: 4f938393 addi x7,x7,1273
|
||||
800004ac: 00e39393 slli x7,x7,0xe
|
||||
800004b0: f4038393 addi x7,x7,-192
|
||||
800004b4: 00771463 bne x14,x7,800004bc <fail>
|
||||
800004b8: 02301063 bne x0,x3,800004d8 <pass>
|
||||
|
||||
00000000800004bc <fail>:
|
||||
800004bc: 0ff0000f fence iorw,iorw
|
||||
800004c0: 00018063 beq x3,x0,800004c0 <fail+0x4>
|
||||
800004c4: 00119193 slli x3,x3,0x1
|
||||
800004c8: 0011e193 ori x3,x3,1
|
||||
800004cc: 05d00893 addi x17,x0,93
|
||||
800004d0: 00018513 addi x10,x3,0
|
||||
800004d4: 00000073 ecall
|
||||
|
||||
00000000800004d8 <pass>:
|
||||
800004d8: 0ff0000f fence iorw,iorw
|
||||
800004dc: 00100193 addi x3,x0,1
|
||||
800004e0: 05d00893 addi x17,x0,93
|
||||
800004e4: 00000513 addi x10,x0,0
|
||||
800004e8: 00000073 ecall
|
||||
|
||||
00000000800004ec <mtvec_handler>:
|
||||
800004ec: 00600293 addi x5,x0,6
|
||||
800004f0: 34202373 csrrs x6,mcause,x0
|
||||
800004f4: fc6294e3 bne x5,x6,800004bc <fail>
|
||||
800004f8: 34179073 csrrw x0,mepc,x15
|
||||
800004fc: 30200073 mret
|
||||
80000500: c0001073 unimp
|
||||
...
|
||||
@ -0,0 +1,171 @@
|
||||
|
||||
./rv64mi-p-sh-misaligned: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 04c0006f jal x0,8000004c <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0a63 beq x30,x31,80000040 <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0663 beq x30,x31,80000040 <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0263 beq x30,x31,80000040 <write_tohost>
|
||||
80000020: 00000f17 auipc x30,0x0
|
||||
80000024: 20cf0f13 addi x30,x30,524 # 8000022c <mtvec_handler>
|
||||
80000028: 000f0463 beq x30,x0,80000030 <trap_vector+0x2c>
|
||||
8000002c: 000f0067 jalr x0,0(x30)
|
||||
80000030: 34202f73 csrrs x30,mcause,x0
|
||||
80000034: 000f5463 bge x30,x0,8000003c <handle_exception>
|
||||
80000038: 0040006f jal x0,8000003c <handle_exception>
|
||||
|
||||
000000008000003c <handle_exception>:
|
||||
8000003c: 5391e193 ori x3,x3,1337
|
||||
|
||||
0000000080000040 <write_tohost>:
|
||||
80000040: 00001f17 auipc x30,0x1
|
||||
80000044: fc3f2023 sw x3,-64(x30) # 80001000 <tohost>
|
||||
80000048: ff9ff06f jal x0,80000040 <write_tohost>
|
||||
|
||||
000000008000004c <reset_vector>:
|
||||
8000004c: 00000093 addi x1,x0,0
|
||||
80000050: 00000113 addi x2,x0,0
|
||||
80000054: 00000193 addi x3,x0,0
|
||||
80000058: 00000213 addi x4,x0,0
|
||||
8000005c: 00000293 addi x5,x0,0
|
||||
80000060: 00000313 addi x6,x0,0
|
||||
80000064: 00000393 addi x7,x0,0
|
||||
80000068: 00000413 addi x8,x0,0
|
||||
8000006c: 00000493 addi x9,x0,0
|
||||
80000070: 00000513 addi x10,x0,0
|
||||
80000074: 00000593 addi x11,x0,0
|
||||
80000078: 00000613 addi x12,x0,0
|
||||
8000007c: 00000693 addi x13,x0,0
|
||||
80000080: 00000713 addi x14,x0,0
|
||||
80000084: 00000793 addi x15,x0,0
|
||||
80000088: 00000813 addi x16,x0,0
|
||||
8000008c: 00000893 addi x17,x0,0
|
||||
80000090: 00000913 addi x18,x0,0
|
||||
80000094: 00000993 addi x19,x0,0
|
||||
80000098: 00000a13 addi x20,x0,0
|
||||
8000009c: 00000a93 addi x21,x0,0
|
||||
800000a0: 00000b13 addi x22,x0,0
|
||||
800000a4: 00000b93 addi x23,x0,0
|
||||
800000a8: 00000c13 addi x24,x0,0
|
||||
800000ac: 00000c93 addi x25,x0,0
|
||||
800000b0: 00000d13 addi x26,x0,0
|
||||
800000b4: 00000d93 addi x27,x0,0
|
||||
800000b8: 00000e13 addi x28,x0,0
|
||||
800000bc: 00000e93 addi x29,x0,0
|
||||
800000c0: 00000f13 addi x30,x0,0
|
||||
800000c4: 00000f93 addi x31,x0,0
|
||||
800000c8: f1402573 csrrs x10,mhartid,x0
|
||||
800000cc: 00051063 bne x10,x0,800000cc <reset_vector+0x80>
|
||||
800000d0: 00000297 auipc x5,0x0
|
||||
800000d4: 01028293 addi x5,x5,16 # 800000e0 <reset_vector+0x94>
|
||||
800000d8: 30529073 csrrw x0,mtvec,x5
|
||||
800000dc: 18005073 csrrwi x0,satp,0
|
||||
800000e0: 00000297 auipc x5,0x0
|
||||
800000e4: 02428293 addi x5,x5,36 # 80000104 <reset_vector+0xb8>
|
||||
800000e8: 30529073 csrrw x0,mtvec,x5
|
||||
800000ec: 0010029b addiw x5,x0,1
|
||||
800000f0: 03529293 slli x5,x5,0x35
|
||||
800000f4: fff28293 addi x5,x5,-1
|
||||
800000f8: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000fc: 01f00293 addi x5,x0,31
|
||||
80000100: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000104: 30405073 csrrwi x0,mie,0
|
||||
80000108: 00000297 auipc x5,0x0
|
||||
8000010c: 01428293 addi x5,x5,20 # 8000011c <reset_vector+0xd0>
|
||||
80000110: 30529073 csrrw x0,mtvec,x5
|
||||
80000114: 30205073 csrrwi x0,medeleg,0
|
||||
80000118: 30305073 csrrwi x0,mideleg,0
|
||||
8000011c: 00000193 addi x3,x0,0
|
||||
80000120: 00000297 auipc x5,0x0
|
||||
80000124: ee428293 addi x5,x5,-284 # 80000004 <trap_vector>
|
||||
80000128: 30529073 csrrw x0,mtvec,x5
|
||||
8000012c: 00100513 addi x10,x0,1
|
||||
80000130: 01f51513 slli x10,x10,0x1f
|
||||
80000134: 00055c63 bge x10,x0,8000014c <reset_vector+0x100>
|
||||
80000138: 0ff0000f fence iorw,iorw
|
||||
8000013c: 00100193 addi x3,x0,1
|
||||
80000140: 05d00893 addi x17,x0,93
|
||||
80000144: 00000513 addi x10,x0,0
|
||||
80000148: 00000073 ecall
|
||||
8000014c: 00000293 addi x5,x0,0
|
||||
80000150: 00028a63 beq x5,x0,80000164 <reset_vector+0x118>
|
||||
80000154: 10529073 csrrw x0,stvec,x5
|
||||
80000158: 0000b2b7 lui x5,0xb
|
||||
8000015c: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
80000160: 30229073 csrrw x0,medeleg,x5
|
||||
80000164: 30005073 csrrwi x0,mstatus,0
|
||||
80000168: 00002537 lui x10,0x2
|
||||
8000016c: 8005051b addiw x10,x10,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000170: 30052073 csrrs x0,mstatus,x10
|
||||
80000174: 00000297 auipc x5,0x0
|
||||
80000178: 01428293 addi x5,x5,20 # 80000188 <test_2>
|
||||
8000017c: 34129073 csrrw x0,mepc,x5
|
||||
80000180: f1402573 csrrs x10,mhartid,x0
|
||||
80000184: 30200073 mret
|
||||
|
||||
0000000080000188 <test_2>:
|
||||
80000188: 00200193 addi x3,x0,2
|
||||
8000018c: 00002097 auipc x1,0x2
|
||||
80000190: e7408093 addi x1,x1,-396 # 80002000 <begin_signature>
|
||||
80000194: 00001137 lui x2,0x1
|
||||
80000198: 2341011b addiw x2,x2,564 # 1234 <_start-0x7fffedcc>
|
||||
8000019c: 00000797 auipc x15,0x0
|
||||
800001a0: 01478793 addi x15,x15,20 # 800001b0 <test_2+0x28>
|
||||
800001a4: 00209023 sh x2,0(x1)
|
||||
800001a8: 00009703 lh x14,0(x1)
|
||||
800001ac: 0080006f jal x0,800001b4 <test_2+0x2c>
|
||||
800001b0: 00010713 addi x14,x2,0
|
||||
800001b4: 000013b7 lui x7,0x1
|
||||
800001b8: 2343839b addiw x7,x7,564 # 1234 <_start-0x7fffedcc>
|
||||
800001bc: 04771063 bne x14,x7,800001fc <fail>
|
||||
|
||||
00000000800001c0 <test_3>:
|
||||
800001c0: 00300193 addi x3,x0,3
|
||||
800001c4: 00002097 auipc x1,0x2
|
||||
800001c8: e3c08093 addi x1,x1,-452 # 80002000 <begin_signature>
|
||||
800001cc: 00005137 lui x2,0x5
|
||||
800001d0: 6781011b addiw x2,x2,1656 # 5678 <_start-0x7fffa988>
|
||||
800001d4: 00000797 auipc x15,0x0
|
||||
800001d8: 01478793 addi x15,x15,20 # 800001e8 <test_3+0x28>
|
||||
800001dc: 002090a3 sh x2,1(x1)
|
||||
800001e0: 00109703 lh x14,1(x1)
|
||||
800001e4: 0080006f jal x0,800001ec <test_3+0x2c>
|
||||
800001e8: 00010713 addi x14,x2,0
|
||||
800001ec: 000053b7 lui x7,0x5
|
||||
800001f0: 6783839b addiw x7,x7,1656 # 5678 <_start-0x7fffa988>
|
||||
800001f4: 00771463 bne x14,x7,800001fc <fail>
|
||||
800001f8: 02301063 bne x0,x3,80000218 <pass>
|
||||
|
||||
00000000800001fc <fail>:
|
||||
800001fc: 0ff0000f fence iorw,iorw
|
||||
80000200: 00018063 beq x3,x0,80000200 <fail+0x4>
|
||||
80000204: 00119193 slli x3,x3,0x1
|
||||
80000208: 0011e193 ori x3,x3,1
|
||||
8000020c: 05d00893 addi x17,x0,93
|
||||
80000210: 00018513 addi x10,x3,0
|
||||
80000214: 00000073 ecall
|
||||
|
||||
0000000080000218 <pass>:
|
||||
80000218: 0ff0000f fence iorw,iorw
|
||||
8000021c: 00100193 addi x3,x0,1
|
||||
80000220: 05d00893 addi x17,x0,93
|
||||
80000224: 00000513 addi x10,x0,0
|
||||
80000228: 00000073 ecall
|
||||
|
||||
000000008000022c <mtvec_handler>:
|
||||
8000022c: 00600293 addi x5,x0,6
|
||||
80000230: 34202373 csrrs x6,mcause,x0
|
||||
80000234: fc6294e3 bne x5,x6,800001fc <fail>
|
||||
80000238: 34179073 csrrw x0,mepc,x15
|
||||
8000023c: 30200073 mret
|
||||
80000240: c0001073 unimp
|
||||
...
|
||||
@ -0,0 +1,203 @@
|
||||
|
||||
./rv64mi-p-sw-misaligned: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 04c0006f jal x0,8000004c <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0a63 beq x30,x31,80000040 <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0663 beq x30,x31,80000040 <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0263 beq x30,x31,80000040 <write_tohost>
|
||||
80000020: 00000f17 auipc x30,0x0
|
||||
80000024: 27cf0f13 addi x30,x30,636 # 8000029c <mtvec_handler>
|
||||
80000028: 000f0463 beq x30,x0,80000030 <trap_vector+0x2c>
|
||||
8000002c: 000f0067 jalr x0,0(x30)
|
||||
80000030: 34202f73 csrrs x30,mcause,x0
|
||||
80000034: 000f5463 bge x30,x0,8000003c <handle_exception>
|
||||
80000038: 0040006f jal x0,8000003c <handle_exception>
|
||||
|
||||
000000008000003c <handle_exception>:
|
||||
8000003c: 5391e193 ori x3,x3,1337
|
||||
|
||||
0000000080000040 <write_tohost>:
|
||||
80000040: 00001f17 auipc x30,0x1
|
||||
80000044: fc3f2023 sw x3,-64(x30) # 80001000 <tohost>
|
||||
80000048: ff9ff06f jal x0,80000040 <write_tohost>
|
||||
|
||||
000000008000004c <reset_vector>:
|
||||
8000004c: 00000093 addi x1,x0,0
|
||||
80000050: 00000113 addi x2,x0,0
|
||||
80000054: 00000193 addi x3,x0,0
|
||||
80000058: 00000213 addi x4,x0,0
|
||||
8000005c: 00000293 addi x5,x0,0
|
||||
80000060: 00000313 addi x6,x0,0
|
||||
80000064: 00000393 addi x7,x0,0
|
||||
80000068: 00000413 addi x8,x0,0
|
||||
8000006c: 00000493 addi x9,x0,0
|
||||
80000070: 00000513 addi x10,x0,0
|
||||
80000074: 00000593 addi x11,x0,0
|
||||
80000078: 00000613 addi x12,x0,0
|
||||
8000007c: 00000693 addi x13,x0,0
|
||||
80000080: 00000713 addi x14,x0,0
|
||||
80000084: 00000793 addi x15,x0,0
|
||||
80000088: 00000813 addi x16,x0,0
|
||||
8000008c: 00000893 addi x17,x0,0
|
||||
80000090: 00000913 addi x18,x0,0
|
||||
80000094: 00000993 addi x19,x0,0
|
||||
80000098: 00000a13 addi x20,x0,0
|
||||
8000009c: 00000a93 addi x21,x0,0
|
||||
800000a0: 00000b13 addi x22,x0,0
|
||||
800000a4: 00000b93 addi x23,x0,0
|
||||
800000a8: 00000c13 addi x24,x0,0
|
||||
800000ac: 00000c93 addi x25,x0,0
|
||||
800000b0: 00000d13 addi x26,x0,0
|
||||
800000b4: 00000d93 addi x27,x0,0
|
||||
800000b8: 00000e13 addi x28,x0,0
|
||||
800000bc: 00000e93 addi x29,x0,0
|
||||
800000c0: 00000f13 addi x30,x0,0
|
||||
800000c4: 00000f93 addi x31,x0,0
|
||||
800000c8: f1402573 csrrs x10,mhartid,x0
|
||||
800000cc: 00051063 bne x10,x0,800000cc <reset_vector+0x80>
|
||||
800000d0: 00000297 auipc x5,0x0
|
||||
800000d4: 01028293 addi x5,x5,16 # 800000e0 <reset_vector+0x94>
|
||||
800000d8: 30529073 csrrw x0,mtvec,x5
|
||||
800000dc: 18005073 csrrwi x0,satp,0
|
||||
800000e0: 00000297 auipc x5,0x0
|
||||
800000e4: 02428293 addi x5,x5,36 # 80000104 <reset_vector+0xb8>
|
||||
800000e8: 30529073 csrrw x0,mtvec,x5
|
||||
800000ec: 0010029b addiw x5,x0,1
|
||||
800000f0: 03529293 slli x5,x5,0x35
|
||||
800000f4: fff28293 addi x5,x5,-1
|
||||
800000f8: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000fc: 01f00293 addi x5,x0,31
|
||||
80000100: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000104: 30405073 csrrwi x0,mie,0
|
||||
80000108: 00000297 auipc x5,0x0
|
||||
8000010c: 01428293 addi x5,x5,20 # 8000011c <reset_vector+0xd0>
|
||||
80000110: 30529073 csrrw x0,mtvec,x5
|
||||
80000114: 30205073 csrrwi x0,medeleg,0
|
||||
80000118: 30305073 csrrwi x0,mideleg,0
|
||||
8000011c: 00000193 addi x3,x0,0
|
||||
80000120: 00000297 auipc x5,0x0
|
||||
80000124: ee428293 addi x5,x5,-284 # 80000004 <trap_vector>
|
||||
80000128: 30529073 csrrw x0,mtvec,x5
|
||||
8000012c: 00100513 addi x10,x0,1
|
||||
80000130: 01f51513 slli x10,x10,0x1f
|
||||
80000134: 00055c63 bge x10,x0,8000014c <reset_vector+0x100>
|
||||
80000138: 0ff0000f fence iorw,iorw
|
||||
8000013c: 00100193 addi x3,x0,1
|
||||
80000140: 05d00893 addi x17,x0,93
|
||||
80000144: 00000513 addi x10,x0,0
|
||||
80000148: 00000073 ecall
|
||||
8000014c: 00000293 addi x5,x0,0
|
||||
80000150: 00028a63 beq x5,x0,80000164 <reset_vector+0x118>
|
||||
80000154: 10529073 csrrw x0,stvec,x5
|
||||
80000158: 0000b2b7 lui x5,0xb
|
||||
8000015c: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
80000160: 30229073 csrrw x0,medeleg,x5
|
||||
80000164: 30005073 csrrwi x0,mstatus,0
|
||||
80000168: 00002537 lui x10,0x2
|
||||
8000016c: 8005051b addiw x10,x10,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000170: 30052073 csrrs x0,mstatus,x10
|
||||
80000174: 00000297 auipc x5,0x0
|
||||
80000178: 01428293 addi x5,x5,20 # 80000188 <test_2>
|
||||
8000017c: 34129073 csrrw x0,mepc,x5
|
||||
80000180: f1402573 csrrs x10,mhartid,x0
|
||||
80000184: 30200073 mret
|
||||
|
||||
0000000080000188 <test_2>:
|
||||
80000188: 00200193 addi x3,x0,2
|
||||
8000018c: 00002097 auipc x1,0x2
|
||||
80000190: e7408093 addi x1,x1,-396 # 80002000 <begin_signature>
|
||||
80000194: 12345137 lui x2,0x12345
|
||||
80000198: 6781011b addiw x2,x2,1656 # 12345678 <_start-0x6dcba988>
|
||||
8000019c: 00000797 auipc x15,0x0
|
||||
800001a0: 01478793 addi x15,x15,20 # 800001b0 <test_2+0x28>
|
||||
800001a4: 0020a023 sw x2,0(x1)
|
||||
800001a8: 0000a703 lw x14,0(x1)
|
||||
800001ac: 0080006f jal x0,800001b4 <test_2+0x2c>
|
||||
800001b0: 00010713 addi x14,x2,0
|
||||
800001b4: 123453b7 lui x7,0x12345
|
||||
800001b8: 6783839b addiw x7,x7,1656 # 12345678 <_start-0x6dcba988>
|
||||
800001bc: 0a771863 bne x14,x7,8000026c <fail>
|
||||
|
||||
00000000800001c0 <test_3>:
|
||||
800001c0: 00300193 addi x3,x0,3
|
||||
800001c4: 00002097 auipc x1,0x2
|
||||
800001c8: e3c08093 addi x1,x1,-452 # 80002000 <begin_signature>
|
||||
800001cc: 9abce137 lui x2,0x9abce
|
||||
800001d0: ef01011b addiw x2,x2,-272 # ffffffff9abcdef0 <_end+0xffffffff1abcbee0>
|
||||
800001d4: 00000797 auipc x15,0x0
|
||||
800001d8: 01478793 addi x15,x15,20 # 800001e8 <test_3+0x28>
|
||||
800001dc: 0020a0a3 sw x2,1(x1)
|
||||
800001e0: 0010a703 lw x14,1(x1)
|
||||
800001e4: 0080006f jal x0,800001ec <test_3+0x2c>
|
||||
800001e8: 00010713 addi x14,x2,0
|
||||
800001ec: 9abce3b7 lui x7,0x9abce
|
||||
800001f0: ef03839b addiw x7,x7,-272 # ffffffff9abcdef0 <_end+0xffffffff1abcbee0>
|
||||
800001f4: 06771c63 bne x14,x7,8000026c <fail>
|
||||
|
||||
00000000800001f8 <test_4>:
|
||||
800001f8: 00400193 addi x3,x0,4
|
||||
800001fc: 00002097 auipc x1,0x2
|
||||
80000200: e0408093 addi x1,x1,-508 # 80002000 <begin_signature>
|
||||
80000204: deadc137 lui x2,0xdeadc
|
||||
80000208: eef1011b addiw x2,x2,-273 # ffffffffdeadbeef <_end+0xffffffff5ead9edf>
|
||||
8000020c: 00000797 auipc x15,0x0
|
||||
80000210: 01478793 addi x15,x15,20 # 80000220 <test_4+0x28>
|
||||
80000214: 0020a123 sw x2,2(x1)
|
||||
80000218: 0020a703 lw x14,2(x1)
|
||||
8000021c: 0080006f jal x0,80000224 <test_4+0x2c>
|
||||
80000220: 00010713 addi x14,x2,0
|
||||
80000224: deadc3b7 lui x7,0xdeadc
|
||||
80000228: eef3839b addiw x7,x7,-273 # ffffffffdeadbeef <_end+0xffffffff5ead9edf>
|
||||
8000022c: 04771063 bne x14,x7,8000026c <fail>
|
||||
|
||||
0000000080000230 <test_5>:
|
||||
80000230: 00500193 addi x3,x0,5
|
||||
80000234: 00002097 auipc x1,0x2
|
||||
80000238: dcc08093 addi x1,x1,-564 # 80002000 <begin_signature>
|
||||
8000023c: feed0137 lui x2,0xfeed0
|
||||
80000240: 0111011b addiw x2,x2,17 # fffffffffeed0011 <_end+0xffffffff7eece001>
|
||||
80000244: 00000797 auipc x15,0x0
|
||||
80000248: 01478793 addi x15,x15,20 # 80000258 <test_5+0x28>
|
||||
8000024c: 0020a1a3 sw x2,3(x1)
|
||||
80000250: 0030a703 lw x14,3(x1)
|
||||
80000254: 0080006f jal x0,8000025c <test_5+0x2c>
|
||||
80000258: 00010713 addi x14,x2,0
|
||||
8000025c: feed03b7 lui x7,0xfeed0
|
||||
80000260: 0113839b addiw x7,x7,17 # fffffffffeed0011 <_end+0xffffffff7eece001>
|
||||
80000264: 00771463 bne x14,x7,8000026c <fail>
|
||||
80000268: 02301063 bne x0,x3,80000288 <pass>
|
||||
|
||||
000000008000026c <fail>:
|
||||
8000026c: 0ff0000f fence iorw,iorw
|
||||
80000270: 00018063 beq x3,x0,80000270 <fail+0x4>
|
||||
80000274: 00119193 slli x3,x3,0x1
|
||||
80000278: 0011e193 ori x3,x3,1
|
||||
8000027c: 05d00893 addi x17,x0,93
|
||||
80000280: 00018513 addi x10,x3,0
|
||||
80000284: 00000073 ecall
|
||||
|
||||
0000000080000288 <pass>:
|
||||
80000288: 0ff0000f fence iorw,iorw
|
||||
8000028c: 00100193 addi x3,x0,1
|
||||
80000290: 05d00893 addi x17,x0,93
|
||||
80000294: 00000513 addi x10,x0,0
|
||||
80000298: 00000073 ecall
|
||||
|
||||
000000008000029c <mtvec_handler>:
|
||||
8000029c: 00600293 addi x5,x0,6
|
||||
800002a0: 34202373 csrrs x6,mcause,x0
|
||||
800002a4: fc6294e3 bne x5,x6,8000026c <fail>
|
||||
800002a8: 34179073 csrrw x0,mepc,x15
|
||||
800002ac: 30200073 mret
|
||||
800002b0: c0001073 unimp
|
||||
...
|
||||
@ -0,0 +1,290 @@
|
||||
|
||||
./rv64si-p-csr: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 0480006f jal x0,80000048 <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0863 beq x30,x31,8000003c <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0463 beq x30,x31,8000003c <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0063 beq x30,x31,8000003c <write_tohost>
|
||||
80000020: 00000f13 addi x30,x0,0
|
||||
80000024: 000f0463 beq x30,x0,8000002c <trap_vector+0x28>
|
||||
80000028: 000f0067 jalr x0,0(x30)
|
||||
8000002c: 34202f73 csrrs x30,mcause,x0
|
||||
80000030: 000f5463 bge x30,x0,80000038 <handle_exception>
|
||||
80000034: 0040006f jal x0,80000038 <handle_exception>
|
||||
|
||||
0000000080000038 <handle_exception>:
|
||||
80000038: 5391e193 ori x3,x3,1337
|
||||
|
||||
000000008000003c <write_tohost>:
|
||||
8000003c: 00001f17 auipc x30,0x1
|
||||
80000040: fc3f2223 sw x3,-60(x30) # 80001000 <tohost>
|
||||
80000044: ff9ff06f jal x0,8000003c <write_tohost>
|
||||
|
||||
0000000080000048 <reset_vector>:
|
||||
80000048: 00000093 addi x1,x0,0
|
||||
8000004c: 00000113 addi x2,x0,0
|
||||
80000050: 00000193 addi x3,x0,0
|
||||
80000054: 00000213 addi x4,x0,0
|
||||
80000058: 00000293 addi x5,x0,0
|
||||
8000005c: 00000313 addi x6,x0,0
|
||||
80000060: 00000393 addi x7,x0,0
|
||||
80000064: 00000413 addi x8,x0,0
|
||||
80000068: 00000493 addi x9,x0,0
|
||||
8000006c: 00000513 addi x10,x0,0
|
||||
80000070: 00000593 addi x11,x0,0
|
||||
80000074: 00000613 addi x12,x0,0
|
||||
80000078: 00000693 addi x13,x0,0
|
||||
8000007c: 00000713 addi x14,x0,0
|
||||
80000080: 00000793 addi x15,x0,0
|
||||
80000084: 00000813 addi x16,x0,0
|
||||
80000088: 00000893 addi x17,x0,0
|
||||
8000008c: 00000913 addi x18,x0,0
|
||||
80000090: 00000993 addi x19,x0,0
|
||||
80000094: 00000a13 addi x20,x0,0
|
||||
80000098: 00000a93 addi x21,x0,0
|
||||
8000009c: 00000b13 addi x22,x0,0
|
||||
800000a0: 00000b93 addi x23,x0,0
|
||||
800000a4: 00000c13 addi x24,x0,0
|
||||
800000a8: 00000c93 addi x25,x0,0
|
||||
800000ac: 00000d13 addi x26,x0,0
|
||||
800000b0: 00000d93 addi x27,x0,0
|
||||
800000b4: 00000e13 addi x28,x0,0
|
||||
800000b8: 00000e93 addi x29,x0,0
|
||||
800000bc: 00000f13 addi x30,x0,0
|
||||
800000c0: 00000f93 addi x31,x0,0
|
||||
800000c4: f1402573 csrrs x10,mhartid,x0
|
||||
800000c8: 00051063 bne x10,x0,800000c8 <reset_vector+0x80>
|
||||
800000cc: 00000297 auipc x5,0x0
|
||||
800000d0: 01028293 addi x5,x5,16 # 800000dc <reset_vector+0x94>
|
||||
800000d4: 30529073 csrrw x0,mtvec,x5
|
||||
800000d8: 18005073 csrrwi x0,satp,0
|
||||
800000dc: 00000297 auipc x5,0x0
|
||||
800000e0: 02428293 addi x5,x5,36 # 80000100 <reset_vector+0xb8>
|
||||
800000e4: 30529073 csrrw x0,mtvec,x5
|
||||
800000e8: 0010029b addiw x5,x0,1
|
||||
800000ec: 03529293 slli x5,x5,0x35
|
||||
800000f0: fff28293 addi x5,x5,-1
|
||||
800000f4: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000f8: 01f00293 addi x5,x0,31
|
||||
800000fc: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000100: 30405073 csrrwi x0,mie,0
|
||||
80000104: 00000297 auipc x5,0x0
|
||||
80000108: 01428293 addi x5,x5,20 # 80000118 <reset_vector+0xd0>
|
||||
8000010c: 30529073 csrrw x0,mtvec,x5
|
||||
80000110: 30205073 csrrwi x0,medeleg,0
|
||||
80000114: 30305073 csrrwi x0,mideleg,0
|
||||
80000118: 00000193 addi x3,x0,0
|
||||
8000011c: 00000297 auipc x5,0x0
|
||||
80000120: ee828293 addi x5,x5,-280 # 80000004 <trap_vector>
|
||||
80000124: 30529073 csrrw x0,mtvec,x5
|
||||
80000128: 00100513 addi x10,x0,1
|
||||
8000012c: 01f51513 slli x10,x10,0x1f
|
||||
80000130: 00055c63 bge x10,x0,80000148 <reset_vector+0x100>
|
||||
80000134: 0ff0000f fence iorw,iorw
|
||||
80000138: 00100193 addi x3,x0,1
|
||||
8000013c: 05d00893 addi x17,x0,93
|
||||
80000140: 00000513 addi x10,x0,0
|
||||
80000144: 00000073 ecall
|
||||
80000148: 00000297 auipc x5,0x0
|
||||
8000014c: 20828293 addi x5,x5,520 # 80000350 <stvec_handler>
|
||||
80000150: 00028a63 beq x5,x0,80000164 <reset_vector+0x11c>
|
||||
80000154: 10529073 csrrw x0,stvec,x5
|
||||
80000158: 0000b2b7 lui x5,0xb
|
||||
8000015c: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
80000160: 30229073 csrrw x0,medeleg,x5
|
||||
80000164: 30005073 csrrwi x0,mstatus,0
|
||||
80000168: 00001537 lui x10,0x1
|
||||
8000016c: 8005051b addiw x10,x10,-2048 # 800 <_start-0x7ffff800>
|
||||
80000170: 30052073 csrrs x0,mstatus,x10
|
||||
80000174: 02200513 addi x10,x0,34
|
||||
80000178: 30352073 csrrs x0,mideleg,x10
|
||||
8000017c: 00000297 auipc x5,0x0
|
||||
80000180: 01428293 addi x5,x5,20 # 80000190 <test_18>
|
||||
80000184: 34129073 csrrw x0,mepc,x5
|
||||
80000188: f1402573 csrrs x10,mhartid,x0
|
||||
8000018c: 30200073 mret
|
||||
|
||||
0000000080000190 <test_18>:
|
||||
80000190: 01200193 addi x3,x0,18
|
||||
80000194: 10002573 csrrs x10,sstatus,x0
|
||||
80000198: 0030059b addiw x11,x0,3
|
||||
8000019c: 02059593 slli x11,x11,0x20
|
||||
800001a0: 00b57533 and x10,x10,x11
|
||||
800001a4: 0010039b addiw x7,x0,1
|
||||
800001a8: 02139393 slli x7,x7,0x21
|
||||
800001ac: 16751a63 bne x10,x7,80000320 <fail>
|
||||
|
||||
00000000800001b0 <test_20>:
|
||||
800001b0: 01400193 addi x3,x0,20
|
||||
800001b4: 14001073 csrrw x0,sscratch,x0
|
||||
800001b8: 14002573 csrrs x10,sscratch,x0
|
||||
800001bc: 00000393 addi x7,x0,0
|
||||
800001c0: 16751063 bne x10,x7,80000320 <fail>
|
||||
|
||||
00000000800001c4 <test_21>:
|
||||
800001c4: 01500193 addi x3,x0,21
|
||||
800001c8: 14005573 csrrwi x10,sscratch,0
|
||||
800001cc: 1407d573 csrrwi x10,sscratch,15
|
||||
800001d0: 00000393 addi x7,x0,0
|
||||
800001d4: 14751663 bne x10,x7,80000320 <fail>
|
||||
|
||||
00000000800001d8 <test_22>:
|
||||
800001d8: 01600193 addi x3,x0,22
|
||||
800001dc: 14086073 csrrsi x0,sscratch,16
|
||||
800001e0: 14002573 csrrs x10,sscratch,x0
|
||||
800001e4: 01f00393 addi x7,x0,31
|
||||
800001e8: 12751c63 bne x10,x7,80000320 <fail>
|
||||
800001ec: 1401d073 csrrwi x0,sscratch,3
|
||||
|
||||
00000000800001f0 <test_2>:
|
||||
800001f0: 00200193 addi x3,x0,2
|
||||
800001f4: 14002573 csrrs x10,sscratch,x0
|
||||
800001f8: 00300393 addi x7,x0,3
|
||||
800001fc: 12751263 bne x10,x7,80000320 <fail>
|
||||
|
||||
0000000080000200 <test_3>:
|
||||
80000200: 00300193 addi x3,x0,3
|
||||
80000204: 1400f5f3 csrrci x11,sscratch,1
|
||||
80000208: 00300393 addi x7,x0,3
|
||||
8000020c: 10759a63 bne x11,x7,80000320 <fail>
|
||||
|
||||
0000000080000210 <test_4>:
|
||||
80000210: 00400193 addi x3,x0,4
|
||||
80000214: 14026673 csrrsi x12,sscratch,4
|
||||
80000218: 00200393 addi x7,x0,2
|
||||
8000021c: 10761263 bne x12,x7,80000320 <fail>
|
||||
|
||||
0000000080000220 <test_5>:
|
||||
80000220: 00500193 addi x3,x0,5
|
||||
80000224: 140156f3 csrrwi x13,sscratch,2
|
||||
80000228: 00600393 addi x7,x0,6
|
||||
8000022c: 0e769a63 bne x13,x7,80000320 <fail>
|
||||
|
||||
0000000080000230 <test_6>:
|
||||
80000230: 00600193 addi x3,x0,6
|
||||
80000234: 0bad2537 lui x10,0xbad2
|
||||
80000238: dea5051b addiw x10,x10,-534 # bad1dea <_start-0x7452e216>
|
||||
8000023c: 140515f3 csrrw x11,sscratch,x10
|
||||
80000240: 00200393 addi x7,x0,2
|
||||
80000244: 0c759e63 bne x11,x7,80000320 <fail>
|
||||
|
||||
0000000080000248 <test_7>:
|
||||
80000248: 00700193 addi x3,x0,7
|
||||
8000024c: 00002537 lui x10,0x2
|
||||
80000250: dea5051b addiw x10,x10,-534 # 1dea <_start-0x7fffe216>
|
||||
80000254: 140535f3 csrrc x11,sscratch,x10
|
||||
80000258: 0bad23b7 lui x7,0xbad2
|
||||
8000025c: dea3839b addiw x7,x7,-534 # bad1dea <_start-0x7452e216>
|
||||
80000260: 0c759063 bne x11,x7,80000320 <fail>
|
||||
|
||||
0000000080000264 <test_8>:
|
||||
80000264: 00800193 addi x3,x0,8
|
||||
80000268: 0000c537 lui x10,0xc
|
||||
8000026c: eef5051b addiw x10,x10,-273 # beef <_start-0x7fff4111>
|
||||
80000270: 140525f3 csrrs x11,sscratch,x10
|
||||
80000274: 0bad03b7 lui x7,0xbad0
|
||||
80000278: 0a759463 bne x11,x7,80000320 <fail>
|
||||
|
||||
000000008000027c <test_9>:
|
||||
8000027c: 00900193 addi x3,x0,9
|
||||
80000280: 0bad2537 lui x10,0xbad2
|
||||
80000284: dea5051b addiw x10,x10,-534 # bad1dea <_start-0x7452e216>
|
||||
80000288: 14051573 csrrw x10,sscratch,x10
|
||||
8000028c: 0badc3b7 lui x7,0xbadc
|
||||
80000290: eef3839b addiw x7,x7,-273 # badbeef <_start-0x74524111>
|
||||
80000294: 08751663 bne x10,x7,80000320 <fail>
|
||||
|
||||
0000000080000298 <test_10>:
|
||||
80000298: 00a00193 addi x3,x0,10
|
||||
8000029c: 00002537 lui x10,0x2
|
||||
800002a0: dea5051b addiw x10,x10,-534 # 1dea <_start-0x7fffe216>
|
||||
800002a4: 14053573 csrrc x10,sscratch,x10
|
||||
800002a8: 0bad23b7 lui x7,0xbad2
|
||||
800002ac: dea3839b addiw x7,x7,-534 # bad1dea <_start-0x7452e216>
|
||||
800002b0: 06751863 bne x10,x7,80000320 <fail>
|
||||
|
||||
00000000800002b4 <test_11>:
|
||||
800002b4: 00b00193 addi x3,x0,11
|
||||
800002b8: 0000c537 lui x10,0xc
|
||||
800002bc: eef5051b addiw x10,x10,-273 # beef <_start-0x7fff4111>
|
||||
800002c0: 14052573 csrrs x10,sscratch,x10
|
||||
800002c4: 0bad03b7 lui x7,0xbad0
|
||||
800002c8: 04751c63 bne x10,x7,80000320 <fail>
|
||||
|
||||
00000000800002cc <test_12>:
|
||||
800002cc: 00c00193 addi x3,x0,12
|
||||
800002d0: 14002573 csrrs x10,sscratch,x0
|
||||
800002d4: 0badc3b7 lui x7,0xbadc
|
||||
800002d8: eef3839b addiw x7,x7,-273 # badbeef <_start-0x74524111>
|
||||
800002dc: 04751263 bne x10,x7,80000320 <fail>
|
||||
800002e0: 10000293 addi x5,x0,256
|
||||
800002e4: 1002b073 csrrc x0,sstatus,x5
|
||||
800002e8: 00000297 auipc x5,0x0
|
||||
800002ec: 01028293 addi x5,x5,16 # 800002f8 <test_15>
|
||||
800002f0: 14129073 csrrw x0,sepc,x5
|
||||
800002f4: 10200073 sret
|
||||
|
||||
00000000800002f8 <test_15>:
|
||||
800002f8: 00f00193 addi x3,x0,15
|
||||
800002fc: 00000013 addi x0,x0,0
|
||||
80000300: 00000393 addi x7,x0,0
|
||||
80000304: 00701e63 bne x0,x7,80000320 <fail>
|
||||
|
||||
0000000080000308 <finish>:
|
||||
80000308: 0ff0000f fence iorw,iorw
|
||||
8000030c: 00100193 addi x3,x0,1
|
||||
80000310: 05d00893 addi x17,x0,93
|
||||
80000314: 00000513 addi x10,x0,0
|
||||
80000318: 00000073 ecall
|
||||
8000031c: 02301063 bne x0,x3,8000033c <pass>
|
||||
|
||||
0000000080000320 <fail>:
|
||||
80000320: 0ff0000f fence iorw,iorw
|
||||
80000324: 00018063 beq x3,x0,80000324 <fail+0x4>
|
||||
80000328: 00119193 slli x3,x3,0x1
|
||||
8000032c: 0011e193 ori x3,x3,1
|
||||
80000330: 05d00893 addi x17,x0,93
|
||||
80000334: 00018513 addi x10,x3,0
|
||||
80000338: 00000073 ecall
|
||||
|
||||
000000008000033c <pass>:
|
||||
8000033c: 0ff0000f fence iorw,iorw
|
||||
80000340: 00100193 addi x3,x0,1
|
||||
80000344: 05d00893 addi x17,x0,93
|
||||
80000348: 00000513 addi x10,x0,0
|
||||
8000034c: 00000073 ecall
|
||||
|
||||
0000000080000350 <stvec_handler>:
|
||||
80000350: 00d00293 addi x5,x0,13
|
||||
80000354: 0051e663 bltu x3,x5,80000360 <stvec_handler+0x10>
|
||||
80000358: 00f00293 addi x5,x0,15
|
||||
8000035c: 0232f263 bgeu x5,x3,80000380 <privileged>
|
||||
80000360: 142022f3 csrrs x5,scause,x0
|
||||
80000364: 00800313 addi x6,x0,8
|
||||
80000368: fa629ce3 bne x5,x6,80000320 <fail>
|
||||
8000036c: 0ff0000f fence iorw,iorw
|
||||
80000370: 00100193 addi x3,x0,1
|
||||
80000374: 05d00893 addi x17,x0,93
|
||||
80000378: 00000513 addi x10,x0,0
|
||||
8000037c: 00000073 ecall
|
||||
|
||||
0000000080000380 <privileged>:
|
||||
80000380: 142022f3 csrrs x5,scause,x0
|
||||
80000384: 00200313 addi x6,x0,2
|
||||
80000388: f8629ce3 bne x5,x6,80000320 <fail>
|
||||
8000038c: 141022f3 csrrs x5,sepc,x0
|
||||
80000390: 00428293 addi x5,x5,4
|
||||
80000394: 14129073 csrrw x0,sepc,x5
|
||||
80000398: 10200073 sret
|
||||
8000039c: c0001073 unimp
|
||||
...
|
||||
@ -0,0 +1,223 @@
|
||||
|
||||
./rv64si-p-dirty: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 04c0006f jal x0,8000004c <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0a63 beq x30,x31,80000040 <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0663 beq x30,x31,80000040 <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0263 beq x30,x31,80000040 <write_tohost>
|
||||
80000020: 00000f17 auipc x30,0x0
|
||||
80000024: 268f0f13 addi x30,x30,616 # 80000288 <mtvec_handler>
|
||||
80000028: 000f0463 beq x30,x0,80000030 <trap_vector+0x2c>
|
||||
8000002c: 000f0067 jalr x0,0(x30)
|
||||
80000030: 34202f73 csrrs x30,mcause,x0
|
||||
80000034: 000f5463 bge x30,x0,8000003c <handle_exception>
|
||||
80000038: 0040006f jal x0,8000003c <handle_exception>
|
||||
|
||||
000000008000003c <handle_exception>:
|
||||
8000003c: 5391e193 ori x3,x3,1337
|
||||
|
||||
0000000080000040 <write_tohost>:
|
||||
80000040: 00001f17 auipc x30,0x1
|
||||
80000044: fc3f2023 sw x3,-64(x30) # 80001000 <tohost>
|
||||
80000048: ff9ff06f jal x0,80000040 <write_tohost>
|
||||
|
||||
000000008000004c <reset_vector>:
|
||||
8000004c: 00000093 addi x1,x0,0
|
||||
80000050: 00000113 addi x2,x0,0
|
||||
80000054: 00000193 addi x3,x0,0
|
||||
80000058: 00000213 addi x4,x0,0
|
||||
8000005c: 00000293 addi x5,x0,0
|
||||
80000060: 00000313 addi x6,x0,0
|
||||
80000064: 00000393 addi x7,x0,0
|
||||
80000068: 00000413 addi x8,x0,0
|
||||
8000006c: 00000493 addi x9,x0,0
|
||||
80000070: 00000513 addi x10,x0,0
|
||||
80000074: 00000593 addi x11,x0,0
|
||||
80000078: 00000613 addi x12,x0,0
|
||||
8000007c: 00000693 addi x13,x0,0
|
||||
80000080: 00000713 addi x14,x0,0
|
||||
80000084: 00000793 addi x15,x0,0
|
||||
80000088: 00000813 addi x16,x0,0
|
||||
8000008c: 00000893 addi x17,x0,0
|
||||
80000090: 00000913 addi x18,x0,0
|
||||
80000094: 00000993 addi x19,x0,0
|
||||
80000098: 00000a13 addi x20,x0,0
|
||||
8000009c: 00000a93 addi x21,x0,0
|
||||
800000a0: 00000b13 addi x22,x0,0
|
||||
800000a4: 00000b93 addi x23,x0,0
|
||||
800000a8: 00000c13 addi x24,x0,0
|
||||
800000ac: 00000c93 addi x25,x0,0
|
||||
800000b0: 00000d13 addi x26,x0,0
|
||||
800000b4: 00000d93 addi x27,x0,0
|
||||
800000b8: 00000e13 addi x28,x0,0
|
||||
800000bc: 00000e93 addi x29,x0,0
|
||||
800000c0: 00000f13 addi x30,x0,0
|
||||
800000c4: 00000f93 addi x31,x0,0
|
||||
800000c8: f1402573 csrrs x10,mhartid,x0
|
||||
800000cc: 00051063 bne x10,x0,800000cc <reset_vector+0x80>
|
||||
800000d0: 00000297 auipc x5,0x0
|
||||
800000d4: 01028293 addi x5,x5,16 # 800000e0 <reset_vector+0x94>
|
||||
800000d8: 30529073 csrrw x0,mtvec,x5
|
||||
800000dc: 18005073 csrrwi x0,satp,0
|
||||
800000e0: 00000297 auipc x5,0x0
|
||||
800000e4: 02428293 addi x5,x5,36 # 80000104 <reset_vector+0xb8>
|
||||
800000e8: 30529073 csrrw x0,mtvec,x5
|
||||
800000ec: 0010029b addiw x5,x0,1
|
||||
800000f0: 03529293 slli x5,x5,0x35
|
||||
800000f4: fff28293 addi x5,x5,-1
|
||||
800000f8: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000fc: 01f00293 addi x5,x0,31
|
||||
80000100: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000104: 30405073 csrrwi x0,mie,0
|
||||
80000108: 00000297 auipc x5,0x0
|
||||
8000010c: 01428293 addi x5,x5,20 # 8000011c <reset_vector+0xd0>
|
||||
80000110: 30529073 csrrw x0,mtvec,x5
|
||||
80000114: 30205073 csrrwi x0,medeleg,0
|
||||
80000118: 30305073 csrrwi x0,mideleg,0
|
||||
8000011c: 00000193 addi x3,x0,0
|
||||
80000120: 00000297 auipc x5,0x0
|
||||
80000124: ee428293 addi x5,x5,-284 # 80000004 <trap_vector>
|
||||
80000128: 30529073 csrrw x0,mtvec,x5
|
||||
8000012c: 00100513 addi x10,x0,1
|
||||
80000130: 01f51513 slli x10,x10,0x1f
|
||||
80000134: 00055c63 bge x10,x0,8000014c <reset_vector+0x100>
|
||||
80000138: 0ff0000f fence iorw,iorw
|
||||
8000013c: 00100193 addi x3,x0,1
|
||||
80000140: 05d00893 addi x17,x0,93
|
||||
80000144: 00000513 addi x10,x0,0
|
||||
80000148: 00000073 ecall
|
||||
8000014c: 00000293 addi x5,x0,0
|
||||
80000150: 00028a63 beq x5,x0,80000164 <reset_vector+0x118>
|
||||
80000154: 10529073 csrrw x0,stvec,x5
|
||||
80000158: 0000b2b7 lui x5,0xb
|
||||
8000015c: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
80000160: 30229073 csrrw x0,medeleg,x5
|
||||
80000164: 30005073 csrrwi x0,mstatus,0
|
||||
80000168: 00002537 lui x10,0x2
|
||||
8000016c: 8005051b addiw x10,x10,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000170: 30052073 csrrs x0,mstatus,x10
|
||||
80000174: 00000297 auipc x5,0x0
|
||||
80000178: 01428293 addi x5,x5,20 # 80000188 <reset_vector+0x13c>
|
||||
8000017c: 34129073 csrrw x0,mepc,x5
|
||||
80000180: f1402573 csrrs x10,mhartid,x0
|
||||
80000184: 30200073 mret
|
||||
80000188: fff0051b addiw x10,x0,-1
|
||||
8000018c: 03f51513 slli x10,x10,0x3f
|
||||
80000190: 00002597 auipc x11,0x2
|
||||
80000194: e7058593 addi x11,x11,-400 # 80002000 <begin_signature>
|
||||
80000198: 00c5d593 srli x11,x11,0xc
|
||||
8000019c: 00a5e5b3 or x11,x11,x10
|
||||
800001a0: 18059073 csrrw x0,satp,x11
|
||||
800001a4: 12000073 sfence.vma x0,x0
|
||||
800001a8: 000215b7 lui x11,0x21
|
||||
800001ac: 8005859b addiw x11,x11,-2048 # 20800 <_start-0x7ffdf800>
|
||||
800001b0: 3005a073 csrrs x0,mstatus,x11
|
||||
800001b4: 00200193 addi x3,x0,2
|
||||
800001b8: 00100393 addi x7,x0,1
|
||||
800001bc: 80002517 auipc x10,0x80002
|
||||
800001c0: e4752623 sw x7,-436(x10) # 2008 <_start-0x7fffdff8>
|
||||
800001c4: 00300193 addi x3,x0,3
|
||||
800001c8: 000415b7 lui x11,0x41
|
||||
800001cc: 8005859b addiw x11,x11,-2048 # 40800 <_start-0x7ffbf800>
|
||||
800001d0: 3005a073 csrrs x0,mstatus,x11
|
||||
800001d4: 80002297 auipc x5,0x80002
|
||||
800001d8: e342a283 lw x5,-460(x5) # 2008 <_start-0x7fffdff8>
|
||||
800001dc: 10029c63 bne x5,x0,800002f4 <die>
|
||||
800001e0: 80002517 auipc x10,0x80002
|
||||
800001e4: e2752423 sw x7,-472(x10) # 2008 <_start-0x7fffdff8>
|
||||
800001e8: 80002297 auipc x5,0x80002
|
||||
800001ec: e202a283 lw x5,-480(x5) # 2008 <_start-0x7fffdff8>
|
||||
800001f0: 10729263 bne x5,x7,800002f4 <die>
|
||||
800001f4: 000202b7 lui x5,0x20
|
||||
800001f8: 3002b073 csrrc x0,mstatus,x5
|
||||
800001fc: 00002297 auipc x5,0x2
|
||||
80000200: e042a283 lw x5,-508(x5) # 80002000 <begin_signature>
|
||||
80000204: 0c000513 addi x10,x0,192
|
||||
80000208: 00a2f2b3 and x5,x5,x10
|
||||
8000020c: 0ea29463 bne x5,x10,800002f4 <die>
|
||||
80000210: 000202b7 lui x5,0x20
|
||||
80000214: 3002a073 csrrs x0,mstatus,x5
|
||||
80000218: 00400193 addi x3,x0,4
|
||||
8000021c: 80002517 auipc x10,0x80002
|
||||
80000220: de452503 lw x10,-540(x10) # 2000 <_start-0x7fffe000>
|
||||
80000224: 40056513 ori x10,x10,1024
|
||||
80000228: 80002297 auipc x5,0x80002
|
||||
8000022c: dca2ac23 sw x10,-552(x5) # 2000 <_start-0x7fffe000>
|
||||
80000230: 12000073 sfence.vma x0,x0
|
||||
80000234: 80002297 auipc x5,0x80002
|
||||
80000238: dca2a623 sw x10,-564(x5) # 2000 <_start-0x7fffe000>
|
||||
8000023c: 0b80006f jal x0,800002f4 <die>
|
||||
80000240: 0ff0000f fence iorw,iorw
|
||||
80000244: 00100193 addi x3,x0,1
|
||||
80000248: 05d00893 addi x17,x0,93
|
||||
8000024c: 00000513 addi x10,x0,0
|
||||
80000250: 00000073 ecall
|
||||
80000254: 02301063 bne x0,x3,80000274 <pass>
|
||||
|
||||
0000000080000258 <fail>:
|
||||
80000258: 0ff0000f fence iorw,iorw
|
||||
8000025c: 00018063 beq x3,x0,8000025c <fail+0x4>
|
||||
80000260: 00119193 slli x3,x3,0x1
|
||||
80000264: 0011e193 ori x3,x3,1
|
||||
80000268: 05d00893 addi x17,x0,93
|
||||
8000026c: 00018513 addi x10,x3,0
|
||||
80000270: 00000073 ecall
|
||||
|
||||
0000000080000274 <pass>:
|
||||
80000274: 0ff0000f fence iorw,iorw
|
||||
80000278: 00100193 addi x3,x0,1
|
||||
8000027c: 05d00893 addi x17,x0,93
|
||||
80000280: 00000513 addi x10,x0,0
|
||||
80000284: 00000073 ecall
|
||||
|
||||
0000000080000288 <mtvec_handler>:
|
||||
80000288: 342022f3 csrrs x5,mcause,x0
|
||||
8000028c: ff128293 addi x5,x5,-15
|
||||
80000290: 06029263 bne x5,x0,800002f4 <die>
|
||||
80000294: 00200313 addi x6,x0,2
|
||||
80000298: 02619263 bne x3,x6,800002bc <skip+0x10>
|
||||
8000029c: 00002297 auipc x5,0x2
|
||||
800002a0: d642a283 lw x5,-668(x5) # 80002000 <begin_signature>
|
||||
800002a4: 0802f313 andi x6,x5,128
|
||||
800002a8: 04031663 bne x6,x0,800002f4 <die>
|
||||
|
||||
00000000800002ac <skip>:
|
||||
800002ac: 341022f3 csrrs x5,mepc,x0
|
||||
800002b0: 00428293 addi x5,x5,4
|
||||
800002b4: 34129073 csrrw x0,mepc,x5
|
||||
800002b8: 30200073 mret
|
||||
800002bc: 00300313 addi x6,x0,3
|
||||
800002c0: 02619463 bne x3,x6,800002e8 <skip+0x3c>
|
||||
800002c4: 00002297 auipc x5,0x2
|
||||
800002c8: d3c2a283 lw x5,-708(x5) # 80002000 <begin_signature>
|
||||
800002cc: 0802f313 andi x6,x5,128
|
||||
800002d0: 02031263 bne x6,x0,800002f4 <die>
|
||||
800002d4: 0802e293 ori x5,x5,128
|
||||
800002d8: 00002317 auipc x6,0x2
|
||||
800002dc: d2532423 sw x5,-728(x6) # 80002000 <begin_signature>
|
||||
800002e0: 12000073 sfence.vma x0,x0
|
||||
800002e4: 30200073 mret
|
||||
800002e8: 00400313 addi x6,x0,4
|
||||
800002ec: 00619463 bne x3,x6,800002f4 <die>
|
||||
800002f0: f85ff06f jal x0,80000274 <pass>
|
||||
|
||||
00000000800002f4 <die>:
|
||||
800002f4: 0ff0000f fence iorw,iorw
|
||||
800002f8: 00018063 beq x3,x0,800002f8 <die+0x4>
|
||||
800002fc: 00119193 slli x3,x3,0x1
|
||||
80000300: 0011e193 ori x3,x3,1
|
||||
80000304: 05d00893 addi x17,x0,93
|
||||
80000308: 00018513 addi x10,x3,0
|
||||
8000030c: 00000073 ecall
|
||||
80000310: c0001073 unimp
|
||||
...
|
||||
@ -0,0 +1,215 @@
|
||||
|
||||
./rv64si-p-icache-alias: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 04c0006f jal x0,8000004c <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0a63 beq x30,x31,80000040 <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0663 beq x30,x31,80000040 <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0263 beq x30,x31,80000040 <write_tohost>
|
||||
80000020: 00000f17 auipc x30,0x0
|
||||
80000024: 2d0f0f13 addi x30,x30,720 # 800002f0 <mtvec_handler>
|
||||
80000028: 000f0463 beq x30,x0,80000030 <trap_vector+0x2c>
|
||||
8000002c: 000f0067 jalr x0,0(x30)
|
||||
80000030: 34202f73 csrrs x30,mcause,x0
|
||||
80000034: 000f5463 bge x30,x0,8000003c <handle_exception>
|
||||
80000038: 0040006f jal x0,8000003c <handle_exception>
|
||||
|
||||
000000008000003c <handle_exception>:
|
||||
8000003c: 5391e193 ori x3,x3,1337
|
||||
|
||||
0000000080000040 <write_tohost>:
|
||||
80000040: 00001f17 auipc x30,0x1
|
||||
80000044: fc3f2023 sw x3,-64(x30) # 80001000 <tohost>
|
||||
80000048: ff9ff06f jal x0,80000040 <write_tohost>
|
||||
|
||||
000000008000004c <reset_vector>:
|
||||
8000004c: 00000093 addi x1,x0,0
|
||||
80000050: 00000113 addi x2,x0,0
|
||||
80000054: 00000193 addi x3,x0,0
|
||||
80000058: 00000213 addi x4,x0,0
|
||||
8000005c: 00000293 addi x5,x0,0
|
||||
80000060: 00000313 addi x6,x0,0
|
||||
80000064: 00000393 addi x7,x0,0
|
||||
80000068: 00000413 addi x8,x0,0
|
||||
8000006c: 00000493 addi x9,x0,0
|
||||
80000070: 00000513 addi x10,x0,0
|
||||
80000074: 00000593 addi x11,x0,0
|
||||
80000078: 00000613 addi x12,x0,0
|
||||
8000007c: 00000693 addi x13,x0,0
|
||||
80000080: 00000713 addi x14,x0,0
|
||||
80000084: 00000793 addi x15,x0,0
|
||||
80000088: 00000813 addi x16,x0,0
|
||||
8000008c: 00000893 addi x17,x0,0
|
||||
80000090: 00000913 addi x18,x0,0
|
||||
80000094: 00000993 addi x19,x0,0
|
||||
80000098: 00000a13 addi x20,x0,0
|
||||
8000009c: 00000a93 addi x21,x0,0
|
||||
800000a0: 00000b13 addi x22,x0,0
|
||||
800000a4: 00000b93 addi x23,x0,0
|
||||
800000a8: 00000c13 addi x24,x0,0
|
||||
800000ac: 00000c93 addi x25,x0,0
|
||||
800000b0: 00000d13 addi x26,x0,0
|
||||
800000b4: 00000d93 addi x27,x0,0
|
||||
800000b8: 00000e13 addi x28,x0,0
|
||||
800000bc: 00000e93 addi x29,x0,0
|
||||
800000c0: 00000f13 addi x30,x0,0
|
||||
800000c4: 00000f93 addi x31,x0,0
|
||||
800000c8: f1402573 csrrs x10,mhartid,x0
|
||||
800000cc: 00051063 bne x10,x0,800000cc <reset_vector+0x80>
|
||||
800000d0: 00000297 auipc x5,0x0
|
||||
800000d4: 01028293 addi x5,x5,16 # 800000e0 <reset_vector+0x94>
|
||||
800000d8: 30529073 csrrw x0,mtvec,x5
|
||||
800000dc: 18005073 csrrwi x0,satp,0
|
||||
800000e0: 00000297 auipc x5,0x0
|
||||
800000e4: 02428293 addi x5,x5,36 # 80000104 <reset_vector+0xb8>
|
||||
800000e8: 30529073 csrrw x0,mtvec,x5
|
||||
800000ec: 0010029b addiw x5,x0,1
|
||||
800000f0: 03529293 slli x5,x5,0x35
|
||||
800000f4: fff28293 addi x5,x5,-1
|
||||
800000f8: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000fc: 01f00293 addi x5,x0,31
|
||||
80000100: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000104: 30405073 csrrwi x0,mie,0
|
||||
80000108: 00000297 auipc x5,0x0
|
||||
8000010c: 01428293 addi x5,x5,20 # 8000011c <reset_vector+0xd0>
|
||||
80000110: 30529073 csrrw x0,mtvec,x5
|
||||
80000114: 30205073 csrrwi x0,medeleg,0
|
||||
80000118: 30305073 csrrwi x0,mideleg,0
|
||||
8000011c: 00000193 addi x3,x0,0
|
||||
80000120: 00000297 auipc x5,0x0
|
||||
80000124: ee428293 addi x5,x5,-284 # 80000004 <trap_vector>
|
||||
80000128: 30529073 csrrw x0,mtvec,x5
|
||||
8000012c: 00100513 addi x10,x0,1
|
||||
80000130: 01f51513 slli x10,x10,0x1f
|
||||
80000134: 00055c63 bge x10,x0,8000014c <reset_vector+0x100>
|
||||
80000138: 0ff0000f fence iorw,iorw
|
||||
8000013c: 00100193 addi x3,x0,1
|
||||
80000140: 05d00893 addi x17,x0,93
|
||||
80000144: 00000513 addi x10,x0,0
|
||||
80000148: 00000073 ecall
|
||||
8000014c: 00000293 addi x5,x0,0
|
||||
80000150: 00028a63 beq x5,x0,80000164 <reset_vector+0x118>
|
||||
80000154: 10529073 csrrw x0,stvec,x5
|
||||
80000158: 0000b2b7 lui x5,0xb
|
||||
8000015c: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
80000160: 30229073 csrrw x0,medeleg,x5
|
||||
80000164: 30005073 csrrwi x0,mstatus,0
|
||||
80000168: 00002537 lui x10,0x2
|
||||
8000016c: 8005051b addiw x10,x10,-2048 # 1800 <_start-0x7fffe800>
|
||||
80000170: 30052073 csrrs x0,mstatus,x10
|
||||
80000174: 00000297 auipc x5,0x0
|
||||
80000178: 01428293 addi x5,x5,20 # 80000188 <reset_vector+0x13c>
|
||||
8000017c: 34129073 csrrw x0,mepc,x5
|
||||
80000180: f1402573 csrrs x10,mhartid,x0
|
||||
80000184: 30200073 mret
|
||||
80000188: 00200193 addi x3,x0,2
|
||||
8000018c: 00004297 auipc x5,0x4
|
||||
80000190: e7428293 addi x5,x5,-396 # 80004000 <page_table_3>
|
||||
80000194: 0022d293 srli x5,x5,0x2
|
||||
80000198: 0012e293 ori x5,x5,1
|
||||
8000019c: 00003317 auipc x6,0x3
|
||||
800001a0: e6533223 sd x5,-412(x6) # 80003000 <page_table_2>
|
||||
800001a4: 00003297 auipc x5,0x3
|
||||
800001a8: e5c28293 addi x5,x5,-420 # 80003000 <page_table_2>
|
||||
800001ac: 0022d293 srli x5,x5,0x2
|
||||
800001b0: 0012e293 ori x5,x5,1
|
||||
800001b4: 00002317 auipc x6,0x2
|
||||
800001b8: e4533623 sd x5,-436(x6) # 80002000 <begin_signature>
|
||||
800001bc: 00006297 auipc x5,0x6
|
||||
800001c0: e4428293 addi x5,x5,-444 # 80006000 <code_page_1>
|
||||
800001c4: 0022d293 srli x5,x5,0x2
|
||||
800001c8: 0492e293 ori x5,x5,73
|
||||
800001cc: 00004317 auipc x6,0x4
|
||||
800001d0: e2533e23 sd x5,-452(x6) # 80004008 <page_table_3+0x8>
|
||||
800001d4: 00007297 auipc x5,0x7
|
||||
800001d8: e2c28293 addi x5,x5,-468 # 80007000 <code_page_2>
|
||||
800001dc: 0022d293 srli x5,x5,0x2
|
||||
800001e0: 0492e293 ori x5,x5,73
|
||||
800001e4: 00004317 auipc x6,0x4
|
||||
800001e8: e0533e23 sd x5,-484(x6) # 80004000 <page_table_3>
|
||||
800001ec: fff0051b addiw x10,x0,-1
|
||||
800001f0: 03f51513 slli x10,x10,0x3f
|
||||
800001f4: 00002597 auipc x11,0x2
|
||||
800001f8: e0c58593 addi x11,x11,-500 # 80002000 <begin_signature>
|
||||
800001fc: 00c5d593 srli x11,x11,0xc
|
||||
80000200: 00a5e5b3 or x11,x11,x10
|
||||
80000204: 18059073 csrrw x0,satp,x11
|
||||
80000208: 12000073 sfence.vma x0,x0
|
||||
8000020c: 00000617 auipc x12,0x0
|
||||
80000210: 01c60613 addi x12,x12,28 # 80000228 <reset_vector+0x1dc>
|
||||
80000214: 34105073 csrrwi x0,mepc,0
|
||||
80000218: 000015b7 lui x11,0x1
|
||||
8000021c: 8005859b addiw x11,x11,-2048 # 800 <_start-0x7ffff800>
|
||||
80000220: 3005a073 csrrs x0,mstatus,x11
|
||||
80000224: 30200073 mret
|
||||
80000228: 00200193 addi x3,x0,2
|
||||
8000022c: ebf50513 addi x10,x10,-321
|
||||
80000230: 08051863 bne x10,x0,800002c0 <fail>
|
||||
80000234: 00300193 addi x3,x0,3
|
||||
80000238: 00000617 auipc x12,0x0
|
||||
8000023c: 01460613 addi x12,x12,20 # 8000024c <reset_vector+0x200>
|
||||
80000240: 000012b7 lui x5,0x1
|
||||
80000244: 34129073 csrrw x0,mepc,x5
|
||||
80000248: 30200073 mret
|
||||
8000024c: f8550513 addi x10,x10,-123
|
||||
80000250: 06051863 bne x10,x0,800002c0 <fail>
|
||||
80000254: 00400193 addi x3,x0,4
|
||||
80000258: 00000617 auipc x12,0x0
|
||||
8000025c: 01060613 addi x12,x12,16 # 80000268 <reset_vector+0x21c>
|
||||
80000260: 34105073 csrrwi x0,mepc,0
|
||||
80000264: 30200073 mret
|
||||
80000268: ebf50513 addi x10,x10,-321
|
||||
8000026c: 04051a63 bne x10,x0,800002c0 <fail>
|
||||
80000270: 00500193 addi x3,x0,5
|
||||
80000274: 00006297 auipc x5,0x6
|
||||
80000278: d8c28293 addi x5,x5,-628 # 80006000 <code_page_1>
|
||||
8000027c: 0022d293 srli x5,x5,0x2
|
||||
80000280: 0492e293 ori x5,x5,73
|
||||
80000284: 00004317 auipc x6,0x4
|
||||
80000288: d6533e23 sd x5,-644(x6) # 80004000 <page_table_3>
|
||||
8000028c: 12000073 sfence.vma x0,x0
|
||||
80000290: 00000617 auipc x12,0x0
|
||||
80000294: 01060613 addi x12,x12,16 # 800002a0 <reset_vector+0x254>
|
||||
80000298: 34105073 csrrwi x0,mepc,0
|
||||
8000029c: 30200073 mret
|
||||
800002a0: f8550513 addi x10,x10,-123
|
||||
800002a4: 00051e63 bne x10,x0,800002c0 <fail>
|
||||
800002a8: 0ff0000f fence iorw,iorw
|
||||
800002ac: 00100193 addi x3,x0,1
|
||||
800002b0: 05d00893 addi x17,x0,93
|
||||
800002b4: 00000513 addi x10,x0,0
|
||||
800002b8: 00000073 ecall
|
||||
800002bc: 02301063 bne x0,x3,800002dc <pass>
|
||||
|
||||
00000000800002c0 <fail>:
|
||||
800002c0: 0ff0000f fence iorw,iorw
|
||||
800002c4: 00018063 beq x3,x0,800002c4 <fail+0x4>
|
||||
800002c8: 00119193 slli x3,x3,0x1
|
||||
800002cc: 0011e193 ori x3,x3,1
|
||||
800002d0: 05d00893 addi x17,x0,93
|
||||
800002d4: 00018513 addi x10,x3,0
|
||||
800002d8: 00000073 ecall
|
||||
|
||||
00000000800002dc <pass>:
|
||||
800002dc: 0ff0000f fence iorw,iorw
|
||||
800002e0: 00100193 addi x3,x0,1
|
||||
800002e4: 05d00893 addi x17,x0,93
|
||||
800002e8: 00000513 addi x10,x0,0
|
||||
800002ec: 00000073 ecall
|
||||
|
||||
00000000800002f0 <mtvec_handler>:
|
||||
800002f0: 342022f3 csrrs x5,mcause,x0
|
||||
800002f4: ff128293 addi x5,x5,-15
|
||||
800002f8: fc0294e3 bne x5,x0,800002c0 <fail>
|
||||
800002fc: 00060067 jalr x0,0(x12)
|
||||
80000300: c0001073 unimp
|
||||
...
|
||||
@ -0,0 +1,204 @@
|
||||
|
||||
./rv64si-p-ma_fetch: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 0480006f jal x0,80000048 <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0863 beq x30,x31,8000003c <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0463 beq x30,x31,8000003c <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0063 beq x30,x31,8000003c <write_tohost>
|
||||
80000020: 00000f13 addi x30,x0,0
|
||||
80000024: 000f0463 beq x30,x0,8000002c <trap_vector+0x28>
|
||||
80000028: 000f0067 jalr x0,0(x30)
|
||||
8000002c: 34202f73 csrrs x30,mcause,x0
|
||||
80000030: 000f5463 bge x30,x0,80000038 <handle_exception>
|
||||
80000034: 0040006f jal x0,80000038 <handle_exception>
|
||||
|
||||
0000000080000038 <handle_exception>:
|
||||
80000038: 5391e193 ori x3,x3,1337
|
||||
|
||||
000000008000003c <write_tohost>:
|
||||
8000003c: 00001f17 auipc x30,0x1
|
||||
80000040: fc3f2223 sw x3,-60(x30) # 80001000 <tohost>
|
||||
80000044: ff9ff06f jal x0,8000003c <write_tohost>
|
||||
|
||||
0000000080000048 <reset_vector>:
|
||||
80000048: 00000093 addi x1,x0,0
|
||||
8000004c: 00000113 addi x2,x0,0
|
||||
80000050: 00000193 addi x3,x0,0
|
||||
80000054: 00000213 addi x4,x0,0
|
||||
80000058: 00000293 addi x5,x0,0
|
||||
8000005c: 00000313 addi x6,x0,0
|
||||
80000060: 00000393 addi x7,x0,0
|
||||
80000064: 00000413 addi x8,x0,0
|
||||
80000068: 00000493 addi x9,x0,0
|
||||
8000006c: 00000513 addi x10,x0,0
|
||||
80000070: 00000593 addi x11,x0,0
|
||||
80000074: 00000613 addi x12,x0,0
|
||||
80000078: 00000693 addi x13,x0,0
|
||||
8000007c: 00000713 addi x14,x0,0
|
||||
80000080: 00000793 addi x15,x0,0
|
||||
80000084: 00000813 addi x16,x0,0
|
||||
80000088: 00000893 addi x17,x0,0
|
||||
8000008c: 00000913 addi x18,x0,0
|
||||
80000090: 00000993 addi x19,x0,0
|
||||
80000094: 00000a13 addi x20,x0,0
|
||||
80000098: 00000a93 addi x21,x0,0
|
||||
8000009c: 00000b13 addi x22,x0,0
|
||||
800000a0: 00000b93 addi x23,x0,0
|
||||
800000a4: 00000c13 addi x24,x0,0
|
||||
800000a8: 00000c93 addi x25,x0,0
|
||||
800000ac: 00000d13 addi x26,x0,0
|
||||
800000b0: 00000d93 addi x27,x0,0
|
||||
800000b4: 00000e13 addi x28,x0,0
|
||||
800000b8: 00000e93 addi x29,x0,0
|
||||
800000bc: 00000f13 addi x30,x0,0
|
||||
800000c0: 00000f93 addi x31,x0,0
|
||||
800000c4: f1402573 csrrs x10,mhartid,x0
|
||||
800000c8: 00051063 bne x10,x0,800000c8 <reset_vector+0x80>
|
||||
800000cc: 00000297 auipc x5,0x0
|
||||
800000d0: 01028293 addi x5,x5,16 # 800000dc <reset_vector+0x94>
|
||||
800000d4: 30529073 csrrw x0,mtvec,x5
|
||||
800000d8: 18005073 csrrwi x0,satp,0
|
||||
800000dc: 00000297 auipc x5,0x0
|
||||
800000e0: 02428293 addi x5,x5,36 # 80000100 <reset_vector+0xb8>
|
||||
800000e4: 30529073 csrrw x0,mtvec,x5
|
||||
800000e8: 0010029b addiw x5,x0,1
|
||||
800000ec: 03529293 slli x5,x5,0x35
|
||||
800000f0: fff28293 addi x5,x5,-1
|
||||
800000f4: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000f8: 01f00293 addi x5,x0,31
|
||||
800000fc: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000100: 30405073 csrrwi x0,mie,0
|
||||
80000104: 00000297 auipc x5,0x0
|
||||
80000108: 01428293 addi x5,x5,20 # 80000118 <reset_vector+0xd0>
|
||||
8000010c: 30529073 csrrw x0,mtvec,x5
|
||||
80000110: 30205073 csrrwi x0,medeleg,0
|
||||
80000114: 30305073 csrrwi x0,mideleg,0
|
||||
80000118: 00000193 addi x3,x0,0
|
||||
8000011c: 00000297 auipc x5,0x0
|
||||
80000120: ee828293 addi x5,x5,-280 # 80000004 <trap_vector>
|
||||
80000124: 30529073 csrrw x0,mtvec,x5
|
||||
80000128: 00100513 addi x10,x0,1
|
||||
8000012c: 01f51513 slli x10,x10,0x1f
|
||||
80000130: 00055c63 bge x10,x0,80000148 <reset_vector+0x100>
|
||||
80000134: 0ff0000f fence iorw,iorw
|
||||
80000138: 00100193 addi x3,x0,1
|
||||
8000013c: 05d00893 addi x17,x0,93
|
||||
80000140: 00000513 addi x10,x0,0
|
||||
80000144: 00000073 ecall
|
||||
80000148: 00000297 auipc x5,0x0
|
||||
8000014c: 11c28293 addi x5,x5,284 # 80000264 <stvec_handler>
|
||||
80000150: 00028a63 beq x5,x0,80000164 <reset_vector+0x11c>
|
||||
80000154: 10529073 csrrw x0,stvec,x5
|
||||
80000158: 0000b2b7 lui x5,0xb
|
||||
8000015c: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
80000160: 30229073 csrrw x0,medeleg,x5
|
||||
80000164: 30005073 csrrwi x0,mstatus,0
|
||||
80000168: 00001537 lui x10,0x1
|
||||
8000016c: 8005051b addiw x10,x10,-2048 # 800 <_start-0x7ffff800>
|
||||
80000170: 30052073 csrrs x0,mstatus,x10
|
||||
80000174: 02200513 addi x10,x0,34
|
||||
80000178: 30352073 csrrs x0,mideleg,x10
|
||||
8000017c: 00000297 auipc x5,0x0
|
||||
80000180: 01428293 addi x5,x5,20 # 80000190 <reset_vector+0x148>
|
||||
80000184: 34129073 csrrw x0,mepc,x5
|
||||
80000188: f1402573 csrrs x10,mhartid,x0
|
||||
8000018c: 30200073 mret
|
||||
80000190: 00200193 addi x3,x0,2
|
||||
80000194: 00000313 addi x6,x0,0
|
||||
80000198: 00000297 auipc x5,0x0
|
||||
8000019c: 00c28293 addi x5,x5,12 # 800001a4 <reset_vector+0x15c>
|
||||
800001a0: 00228367 jalr x6,2(x5)
|
||||
800001a4: a011 c.j 800001a8 <reset_vector+0x160>
|
||||
800001a6: a019 c.j 800001ac <reset_vector+0x164>
|
||||
800001a8: 08c0006f jal x0,80000234 <fail>
|
||||
800001ac: 00300193 addi x3,x0,3
|
||||
800001b0: 00000297 auipc x5,0x0
|
||||
800001b4: 00c28293 addi x5,x5,12 # 800001bc <reset_vector+0x174>
|
||||
800001b8: 00128367 jalr x6,1(x5)
|
||||
800001bc: 0080006f jal x0,800001c4 <reset_vector+0x17c>
|
||||
800001c0: 0740006f jal x0,80000234 <fail>
|
||||
800001c4: 00400193 addi x3,x0,4
|
||||
800001c8: 00000313 addi x6,x0,0
|
||||
800001cc: 00000297 auipc x5,0x0
|
||||
800001d0: 00c28293 addi x5,x5,12 # 800001d8 <reset_vector+0x190>
|
||||
800001d4: 00328367 jalr x6,3(x5)
|
||||
800001d8: a011 c.j 800001dc <reset_vector+0x194>
|
||||
800001da: a019 c.j 800001e0 <reset_vector+0x198>
|
||||
800001dc: 0580006f jal x0,80000234 <fail>
|
||||
800001e0: 00500193 addi x3,x0,5
|
||||
800001e4: 00000313 addi x6,x0,0
|
||||
800001e8: 00000297 auipc x5,0x0
|
||||
800001ec: 00c28293 addi x5,x5,12 # 800001f4 <reset_vector+0x1ac>
|
||||
800001f0: 0060036f jal x6,800001f6 <reset_vector+0x1ae>
|
||||
800001f4: a011 c.j 800001f8 <reset_vector+0x1b0>
|
||||
800001f6: a019 c.j 800001fc <reset_vector+0x1b4>
|
||||
800001f8: 03c0006f jal x0,80000234 <fail>
|
||||
800001fc: 00600193 addi x3,x0,6
|
||||
80000200: 00000313 addi x6,x0,0
|
||||
80000204: 00000297 auipc x5,0x0
|
||||
80000208: 00c28293 addi x5,x5,12 # 80000210 <reset_vector+0x1c8>
|
||||
8000020c: 00000363 beq x0,x0,80000212 <reset_vector+0x1ca>
|
||||
80000210: a011 c.j 80000214 <reset_vector+0x1cc>
|
||||
80000212: a019 c.j 80000218 <reset_vector+0x1d0>
|
||||
80000214: 0200006f jal x0,80000234 <fail>
|
||||
80000218: 00700193 addi x3,x0,7
|
||||
8000021c: 00001563 bne x0,x0,80000226 <reset_vector+0x1de>
|
||||
80000220: 00c0006f jal x0,8000022c <reset_vector+0x1e4>
|
||||
80000224: a009 c.j 80000226 <reset_vector+0x1de>
|
||||
80000226: a009 c.j 80000228 <reset_vector+0x1e0>
|
||||
80000228: 00c0006f jal x0,80000234 <fail>
|
||||
8000022c: 0240006f jal x0,80000250 <pass>
|
||||
80000230: 02301063 bne x0,x3,80000250 <pass>
|
||||
|
||||
0000000080000234 <fail>:
|
||||
80000234: 0ff0000f fence iorw,iorw
|
||||
80000238: 00018063 beq x3,x0,80000238 <fail+0x4>
|
||||
8000023c: 00119193 slli x3,x3,0x1
|
||||
80000240: 0011e193 ori x3,x3,1
|
||||
80000244: 05d00893 addi x17,x0,93
|
||||
80000248: 00018513 addi x10,x3,0
|
||||
8000024c: 00000073 ecall
|
||||
|
||||
0000000080000250 <pass>:
|
||||
80000250: 0ff0000f fence iorw,iorw
|
||||
80000254: 00100193 addi x3,x0,1
|
||||
80000258: 05d00893 addi x17,x0,93
|
||||
8000025c: 00000513 addi x10,x0,0
|
||||
80000260: 00000073 ecall
|
||||
|
||||
0000000080000264 <stvec_handler>:
|
||||
80000264: 00200513 addi x10,x0,2
|
||||
80000268: 02a18063 beq x3,x10,80000288 <stvec_handler+0x24>
|
||||
8000026c: 00400513 addi x10,x0,4
|
||||
80000270: 00a18c63 beq x3,x10,80000288 <stvec_handler+0x24>
|
||||
80000274: 00500513 addi x10,x0,5
|
||||
80000278: 00a18863 beq x3,x10,80000288 <stvec_handler+0x24>
|
||||
8000027c: 00600513 addi x10,x0,6
|
||||
80000280: 00a18463 beq x3,x10,80000288 <stvec_handler+0x24>
|
||||
80000284: fb1ff06f jal x0,80000234 <fail>
|
||||
80000288: fa0316e3 bne x6,x0,80000234 <fail>
|
||||
8000028c: 00000593 addi x11,x0,0
|
||||
80000290: 14202573 csrrs x10,scause,x0
|
||||
80000294: fab510e3 bne x10,x11,80000234 <fail>
|
||||
80000298: 141025f3 csrrs x11,sepc,x0
|
||||
8000029c: 00458593 addi x11,x11,4
|
||||
800002a0: f8b29ae3 bne x5,x11,80000234 <fail>
|
||||
800002a4: 14302573 csrrs x10,stval,x0
|
||||
800002a8: 00050663 beq x10,x0,800002b4 <stvec_handler+0x50>
|
||||
800002ac: ffe50513 addi x10,x10,-2
|
||||
800002b0: f85512e3 bne x10,x5,80000234 <fail>
|
||||
800002b4: 00c58593 addi x11,x11,12
|
||||
800002b8: 14159073 csrrw x0,sepc,x11
|
||||
800002bc: 10200073 sret
|
||||
800002c0: c0001073 unimp
|
||||
...
|
||||
@ -0,0 +1,155 @@
|
||||
|
||||
./rv64si-p-sbreak: file format elf64-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text.init:
|
||||
|
||||
0000000080000000 <_start>:
|
||||
80000000: 0480006f jal x0,80000048 <reset_vector>
|
||||
|
||||
0000000080000004 <trap_vector>:
|
||||
80000004: 34202f73 csrrs x30,mcause,x0
|
||||
80000008: 00800f93 addi x31,x0,8
|
||||
8000000c: 03ff0863 beq x30,x31,8000003c <write_tohost>
|
||||
80000010: 00900f93 addi x31,x0,9
|
||||
80000014: 03ff0463 beq x30,x31,8000003c <write_tohost>
|
||||
80000018: 00b00f93 addi x31,x0,11
|
||||
8000001c: 03ff0063 beq x30,x31,8000003c <write_tohost>
|
||||
80000020: 00000f13 addi x30,x0,0
|
||||
80000024: 000f0463 beq x30,x0,8000002c <trap_vector+0x28>
|
||||
80000028: 000f0067 jalr x0,0(x30)
|
||||
8000002c: 34202f73 csrrs x30,mcause,x0
|
||||
80000030: 000f5463 bge x30,x0,80000038 <handle_exception>
|
||||
80000034: 0040006f jal x0,80000038 <handle_exception>
|
||||
|
||||
0000000080000038 <handle_exception>:
|
||||
80000038: 5391e193 ori x3,x3,1337
|
||||
|
||||
000000008000003c <write_tohost>:
|
||||
8000003c: 00001f17 auipc x30,0x1
|
||||
80000040: fc3f2223 sw x3,-60(x30) # 80001000 <tohost>
|
||||
80000044: ff9ff06f jal x0,8000003c <write_tohost>
|
||||
|
||||
0000000080000048 <reset_vector>:
|
||||
80000048: 00000093 addi x1,x0,0
|
||||
8000004c: 00000113 addi x2,x0,0
|
||||
80000050: 00000193 addi x3,x0,0
|
||||
80000054: 00000213 addi x4,x0,0
|
||||
80000058: 00000293 addi x5,x0,0
|
||||
8000005c: 00000313 addi x6,x0,0
|
||||
80000060: 00000393 addi x7,x0,0
|
||||
80000064: 00000413 addi x8,x0,0
|
||||
80000068: 00000493 addi x9,x0,0
|
||||
8000006c: 00000513 addi x10,x0,0
|
||||
80000070: 00000593 addi x11,x0,0
|
||||
80000074: 00000613 addi x12,x0,0
|
||||
80000078: 00000693 addi x13,x0,0
|
||||
8000007c: 00000713 addi x14,x0,0
|
||||
80000080: 00000793 addi x15,x0,0
|
||||
80000084: 00000813 addi x16,x0,0
|
||||
80000088: 00000893 addi x17,x0,0
|
||||
8000008c: 00000913 addi x18,x0,0
|
||||
80000090: 00000993 addi x19,x0,0
|
||||
80000094: 00000a13 addi x20,x0,0
|
||||
80000098: 00000a93 addi x21,x0,0
|
||||
8000009c: 00000b13 addi x22,x0,0
|
||||
800000a0: 00000b93 addi x23,x0,0
|
||||
800000a4: 00000c13 addi x24,x0,0
|
||||
800000a8: 00000c93 addi x25,x0,0
|
||||
800000ac: 00000d13 addi x26,x0,0
|
||||
800000b0: 00000d93 addi x27,x0,0
|
||||
800000b4: 00000e13 addi x28,x0,0
|
||||
800000b8: 00000e93 addi x29,x0,0
|
||||
800000bc: 00000f13 addi x30,x0,0
|
||||
800000c0: 00000f93 addi x31,x0,0
|
||||
800000c4: f1402573 csrrs x10,mhartid,x0
|
||||
800000c8: 00051063 bne x10,x0,800000c8 <reset_vector+0x80>
|
||||
800000cc: 00000297 auipc x5,0x0
|
||||
800000d0: 01028293 addi x5,x5,16 # 800000dc <reset_vector+0x94>
|
||||
800000d4: 30529073 csrrw x0,mtvec,x5
|
||||
800000d8: 18005073 csrrwi x0,satp,0
|
||||
800000dc: 00000297 auipc x5,0x0
|
||||
800000e0: 02428293 addi x5,x5,36 # 80000100 <reset_vector+0xb8>
|
||||
800000e4: 30529073 csrrw x0,mtvec,x5
|
||||
800000e8: 0010029b addiw x5,x0,1
|
||||
800000ec: 03529293 slli x5,x5,0x35
|
||||
800000f0: fff28293 addi x5,x5,-1
|
||||
800000f4: 3b029073 csrrw x0,pmpaddr0,x5
|
||||
800000f8: 01f00293 addi x5,x0,31
|
||||
800000fc: 3a029073 csrrw x0,pmpcfg0,x5
|
||||
80000100: 30405073 csrrwi x0,mie,0
|
||||
80000104: 00000297 auipc x5,0x0
|
||||
80000108: 01428293 addi x5,x5,20 # 80000118 <reset_vector+0xd0>
|
||||
8000010c: 30529073 csrrw x0,mtvec,x5
|
||||
80000110: 30205073 csrrwi x0,medeleg,0
|
||||
80000114: 30305073 csrrwi x0,mideleg,0
|
||||
80000118: 00000193 addi x3,x0,0
|
||||
8000011c: 00000297 auipc x5,0x0
|
||||
80000120: ee828293 addi x5,x5,-280 # 80000004 <trap_vector>
|
||||
80000124: 30529073 csrrw x0,mtvec,x5
|
||||
80000128: 00100513 addi x10,x0,1
|
||||
8000012c: 01f51513 slli x10,x10,0x1f
|
||||
80000130: 00055c63 bge x10,x0,80000148 <reset_vector+0x100>
|
||||
80000134: 0ff0000f fence iorw,iorw
|
||||
80000138: 00100193 addi x3,x0,1
|
||||
8000013c: 05d00893 addi x17,x0,93
|
||||
80000140: 00000513 addi x10,x0,0
|
||||
80000144: 00000073 ecall
|
||||
80000148: 00000297 auipc x5,0x0
|
||||
8000014c: 08828293 addi x5,x5,136 # 800001d0 <stvec_handler>
|
||||
80000150: 00028a63 beq x5,x0,80000164 <reset_vector+0x11c>
|
||||
80000154: 10529073 csrrw x0,stvec,x5
|
||||
80000158: 0000b2b7 lui x5,0xb
|
||||
8000015c: 1092829b addiw x5,x5,265 # b109 <_start-0x7fff4ef7>
|
||||
80000160: 30229073 csrrw x0,medeleg,x5
|
||||
80000164: 30005073 csrrwi x0,mstatus,0
|
||||
80000168: 00001537 lui x10,0x1
|
||||
8000016c: 8005051b addiw x10,x10,-2048 # 800 <_start-0x7ffff800>
|
||||
80000170: 30052073 csrrs x0,mstatus,x10
|
||||
80000174: 02200513 addi x10,x0,34
|
||||
80000178: 30352073 csrrs x0,mideleg,x10
|
||||
8000017c: 00000297 auipc x5,0x0
|
||||
80000180: 01428293 addi x5,x5,20 # 80000190 <reset_vector+0x148>
|
||||
80000184: 34129073 csrrw x0,mepc,x5
|
||||
80000188: f1402573 csrrs x10,mhartid,x0
|
||||
8000018c: 30200073 mret
|
||||
80000190: 00200193 addi x3,x0,2
|
||||
|
||||
0000000080000194 <do_break>:
|
||||
80000194: 00100073 ebreak
|
||||
80000198: 0080006f jal x0,800001a0 <fail>
|
||||
8000019c: 02301063 bne x0,x3,800001bc <pass>
|
||||
|
||||
00000000800001a0 <fail>:
|
||||
800001a0: 0ff0000f fence iorw,iorw
|
||||
800001a4: 00018063 beq x3,x0,800001a4 <fail+0x4>
|
||||
800001a8: 00119193 slli x3,x3,0x1
|
||||
800001ac: 0011e193 ori x3,x3,1
|
||||
800001b0: 05d00893 addi x17,x0,93
|
||||
800001b4: 00018513 addi x10,x3,0
|
||||
800001b8: 00000073 ecall
|
||||
|
||||
00000000800001bc <pass>:
|
||||
800001bc: 0ff0000f fence iorw,iorw
|
||||
800001c0: 00100193 addi x3,x0,1
|
||||
800001c4: 05d00893 addi x17,x0,93
|
||||
800001c8: 00000513 addi x10,x0,0
|
||||
800001cc: 00000073 ecall
|
||||
|
||||
00000000800001d0 <stvec_handler>:
|
||||
800001d0: 00300313 addi x6,x0,3
|
||||
800001d4: 142022f3 csrrs x5,scause,x0
|
||||
800001d8: 105023f3 csrrs x7,stvec,x0
|
||||
800001dc: 0023f393 andi x7,x7,2
|
||||
800001e0: 00038463 beq x7,x0,800001e8 <skip_mask>
|
||||
800001e4: 0ff2f293 andi x5,x5,255
|
||||
|
||||
00000000800001e8 <skip_mask>:
|
||||
800001e8: fa629ce3 bne x5,x6,800001a0 <fail>
|
||||
800001ec: 00000317 auipc x6,0x0
|
||||
800001f0: fa830313 addi x6,x6,-88 # 80000194 <do_break>
|
||||
800001f4: 141022f3 csrrs x5,sepc,x0
|
||||
800001f8: fa6294e3 bne x5,x6,800001a0 <fail>
|
||||
800001fc: fc1ff06f jal x0,800001bc <pass>
|
||||
80000200: c0001073 unimp
|
||||
...
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue