Skip to content

Commit

Permalink
banshee: Add zeromemory and bootrom (pulp-platform/snitch#344)
Browse files Browse the repository at this point in the history
* banshee: add zeromemory peripheral

* banshee: allow to set num-cores, num-clusters and base-core-id-offset with configuration file

* banshee: cleanup zeromemory peripheral

* banshee: add bootrom

* banshee: initialize a0 with hartid value

* banshee: fix configurability - take config file values unless not set

* banshee: set default architecture configuration to 0

* banshee: fix bootrom configuration and formatting

* snRuntime tests: reorganize startup files for rtl, banshee general, banshee snitch and make necessary cmake adaptations

* ci: run banshee test for general configuration and for snitch configuration

* banshee: make bootrom atomic

* ci: fix linting

* ci: fix ci runs for banshee

* ci: fix ci flow for banshee snitch tests

* ci: fix typo

* fix yml linting

* snRuntime: remove snRuntime-banshee-general and all empty startup files

* snRuntime-tests: update team_global test to snitch_cluster configuration

* ci: update ci banshee tests

* snRuntime: merge _snrt_cluster_barrier from rtl and banshee startup

* snRuntime-banshee: update banshee startup

* banshee: overwrite configuration file with handed over paramters

* ci: fix linting

* banshee/snRuntime: change scratch_reg address

* banshee: fix bootrom

* banshee: fix formatting

* ci: fix linting

* banshee: fix format

* update ci to new master after rebase

* ci: change application tests to use snitch_cluster configuration
  • Loading branch information
GiannaP authored Feb 25, 2022
1 parent 549b8d5 commit 3f8ab4a
Show file tree
Hide file tree
Showing 20 changed files with 304 additions and 349 deletions.
10 changes: 5 additions & 5 deletions sw/applications/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ if (CMAKE_C_COMPILER_ID STREQUAL "Clang")

set(SNITCH_TEST_PREFIX snApplications-)

add_snitch_raw_test_args(batchnorm batchnorm --num-cores=9)
add_snitch_raw_test_args(maxpool maxpool --num-cores=9)
add_snitch_raw_test_args(conv2d conv2d --num-cores=9)
add_snitch_raw_test_args(gemm gemm --num-cores=9)
add_snitch_raw_test_args(fusedconv fusedconv --num-cores=9)
add_snitch_raw_test_args(batchnorm batchnorm --configuration ${CMAKE_CURRENT_SOURCE_DIR}/../banshee/config/snitch_cluster.yaml)
add_snitch_raw_test_args(maxpool maxpool --configuration ${CMAKE_CURRENT_SOURCE_DIR}/../banshee/config/snitch_cluster.yaml)
add_snitch_raw_test_args(conv2d conv2d --configuration ${CMAKE_CURRENT_SOURCE_DIR}/../banshee/config/snitch_cluster.yaml)
add_snitch_raw_test_args(gemm gemm --configuration ${CMAKE_CURRENT_SOURCE_DIR}/../banshee/config/snitch_cluster.yaml)
add_snitch_raw_test_args(fusedconv fusedconv --configuration ${CMAKE_CURRENT_SOURCE_DIR}/../banshee/config/snitch_cluster.yaml)

endif()
8 changes: 3 additions & 5 deletions sw/cmake/SnitchUtilities.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ macro(add_snitch_executable name)
DEPENDS $<TARGET_FILE:${name}>)
endif()
# Run target for RTL simulator
if (SNITCH_SIMULATOR AND NOT SNITCH_RUNTIME STREQUAL "snRuntime-banshee")
if (SNITCH_SIMULATOR AND SNITCH_RUNTIME STREQUAL "snRuntime-cluster")
add_custom_target( run-rtl-${name}
COMMAND ${SNITCH_SIMULATOR} $<TARGET_FILE:${name}>
COMMAND for f in logs/trace_hart_*.dasm\; do ${SPIKE_DASM} < $$f | ${PYTHON} ${SNRUNTIME_SRC_DIR}/../../util/gen_trace.py > $$\(echo $$f | sed 's/\\.dasm/\\.txt/'\)\; done
Expand Down Expand Up @@ -81,7 +81,7 @@ macro(add_snitch_test_args executable_name test_name)
endmacro()

macro(add_snitch_raw_test_rtl test_name target_name)
if (NOT SNITCH_RUNTIME STREQUAL "snRuntime-banshee" AND BUILD_TESTS)
if ((NOT SNITCH_RUNTIME STREQUAL "snRuntime-banshee") AND BUILD_TESTS)
add_test(NAME ${SNITCH_TEST_PREFIX}rtl-${test_name} COMMAND ${SNITCH_SIMULATOR} $<TARGET_FILE:${target_name}>)
set_property(TEST ${SNITCH_TEST_PREFIX}rtl-${test_name}
PROPERTY LABELS ${SNITCH_TEST_PREFIX})
Expand All @@ -100,9 +100,7 @@ macro(add_snitch_test name)
message(STATUS "Adding test: ${name}")
add_snitch_test_executable(${ARGV})
if (SNITCH_RUNTIME STREQUAL "snRuntime-banshee")
add_snitch_test_args(${name} ${name}-core --base-hartid=3)
add_snitch_test_args(${name} ${name}-cluster --base-hartid=3 --num-cores=8)
add_snitch_test_args(${name} ${name}-system --base-hartid=3 --num-cores=8 --num-clusters=4)
add_snitch_test_args(${name} ${name}-snitch --configuration ${CMAKE_CURRENT_SOURCE_DIR}/../banshee/config/snitch_cluster.yaml)
elseif (SNITCH_SIMULATOR)
add_snitch_test_rtl(${name})
endif()
Expand Down
218 changes: 109 additions & 109 deletions sw/snRuntime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ set(sources
src/perf_cnt.c
)

# platform specific sources
set(banshee_snitch_sources
src/platforms/banshee/start_snitch.S
src/platforms/banshee/putchar.c
)
set(rtl_snitch_sources
src/platforms/rtl/start_snitch.S
src/platforms/rtl/putchar.c
)

# Sources only compatible with the LLVM toolchain
if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(sources
Expand All @@ -93,31 +103,20 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
add_snitch_library(snRuntime src/start.S ${sources} src/ssr_v2.c)

# Bare Runtimes (with startup code)
add_snitch_library(snRuntime-banshee src/start_banshee.S src/start_banshee.c ${sources} src/ssr_v1.c)
add_snitch_library(snRuntime-cluster src/start_cluster.S src/start_cluster.c ${sources} src/ssr_v2.c)
add_snitch_library(snRuntime-billywig src/start_billywig.S ${sources} src/ssr_v1.c)
add_snitch_library(snRuntime-bowtruckle src/start_bowtruckle.S ${sources} src/ssr_v1.c)
add_snitch_library(snRuntime-lethifold src/start_lethifold.S ${sources} src/ssr_v1.c)
add_snitch_library(snRuntime-thestral src/start_thestral.S ${sources} src/ssr_v1.c)
add_snitch_library(snRuntime-banshee src/platforms/shared/start.c ${banshee_snitch_sources} ${sources} src/ssr_v1.c)
add_snitch_library(snRuntime-cluster src/platforms/shared/start.c ${rtl_snitch_sources} ${sources} src/ssr_v2.c)


else()
# snRuntime is added externally, only build required runtime
if(SNITCH_RUNTIME STREQUAL "snRuntime")
# Generic Runtime (requiring bootloader/OS)
add_snitch_library(snRuntime src/start.S ${sources} src/ssr_v2.c)
add_snitch_library(snRuntime src/platforms/shared/start.c src/start.S ${sources} src/ssr_v2.c)
# Bare Runtimes (with startup code)
elseif(SNITCH_RUNTIME STREQUAL "snRuntime-banshee")
add_snitch_library(snRuntime-banshee src/start_banshee.S src/start_banshee.c ${sources} src/ssr_v1.c)
add_snitch_library(snRuntime-banshee src/platforms/shared/start.c ${banshee_snitch_sources} ${sources} src/ssr_v1.c)
elseif(SNITCH_RUNTIME STREQUAL "snRuntime-cluster")
add_snitch_library(snRuntime-cluster src/start_cluster.S src/start_cluster.c ${sources} src/ssr_v2.c)
elseif(SNITCH_RUNTIME STREQUAL "snRuntime-billywig")
add_snitch_library(snRuntime-billywig src/start_billywig.S ${sources} src/ssr_v1.c)
elseif(SNITCH_RUNTIME STREQUAL "snRuntime-bowtruckle")
add_snitch_library(snRuntime-bowtruckle src/start_bowtruckle.S ${sources} src/ssr_v1.c)
elseif(SNITCH_RUNTIME STREQUAL "snRuntime-lethifold")
add_snitch_library(snRuntime-lethifold src/start_lethifold.S ${sources} src/ssr_v1.c)
elseif(SNITCH_RUNTIME STREQUAL "snRuntime-thestral")
add_snitch_library(snRuntime-thestral src/start_thestral.S ${sources} src/ssr_v1.c)
add_snitch_library(snRuntime-cluster src/platforms/shared/start.c ${rtl_snitch_sources} ${sources} src/ssr_v2.c)
else()
message(FATAL_ERROR "Requested runtime not implemented: ${SNITCH_RUNTIME}")
endif()
Expand All @@ -126,6 +125,8 @@ endif()
# Tests
enable_testing()
set(SNITCH_TEST_PREFIX snRuntime-)

# General snRuntime tests
add_snitch_test(tls tests/tls.c)
add_snitch_test(simple tests/simple.c)
add_snitch_test(varargs_1 tests/varargs_1.c)
Expand All @@ -135,97 +136,96 @@ add_snitch_test(fence_i tests/fence_i.c)
add_snitch_test(lto tests/lto.c tests/lto_a.c)
add_snitch_test(interrupt tests/interrupt.c)
add_snitch_test(interrupt-local tests/interrupt-local.c)
add_snitch_test(printf_fmtint tests/printf_fmtint.c)
add_snitch_test(printf_simple tests/printf_simple.c)
add_snitch_test(zero_mem tests/zero_mem.c)
add_snitch_test(team_global tests/team_global.c)

add_snitch_test_executable(dma_simple tests/dma_simple.c)
add_snitch_test_executable(printf_simple tests/printf_simple.c)
add_snitch_test_executable(printf_fmtint tests/printf_fmtint.c)
add_snitch_test_executable(multi_cluster tests/multi_cluster.c)
add_snitch_test_executable(perf_cnt tests/perf_cnt.c)
add_snitch_test_executable(zero_mem tests/zero_mem.c)
add_snitch_test_rtl(dma_simple)
add_snitch_test_rtl(printf_simple)
add_snitch_test_rtl(printf_fmtint)
add_snitch_test_args(printf_simple printf_simple --no-opt-llvm --base-hartid=3)
add_snitch_test_args(printf_fmtint printf_fmtint-core --no-opt-llvm --base-hartid=3)
add_snitch_test_args(printf_fmtint printf_fmtint-cluster --no-opt-llvm --base-hartid=3 --num-cores=8)
add_snitch_test_args(printf_fmtint printf_fmtint-system --no-opt-llvm --base-hartid=3 --num-cores=8 --num-clusters=4)
add_snitch_test_rtl(zero_mem)

add_snitch_test_executable(team_global tests/team_global.c)
add_snitch_test_args(team_global team_global --base-hartid=3 --num-cores=4 --num-clusters=2)

# Tests exclusive to LLVM
if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_snitch_test_executable(data_mover tests/data_mover.c)
add_snitch_test_rtl(data_mover)
add_snitch_test_args(data_mover data_mover --base-hartid=3 --num-cores=9 --num-clusters=1)

add_snitch_test_executable(event_unit tests/event_unit.c)
add_snitch_test_rtl(event_unit)
add_snitch_test_args(event_unit event_unit --base-hartid=3 --num-cores=9 --num-clusters=1)
add_snitch_test_executable(openmp tests/openmp.c)
add_snitch_test_rtl(openmp)
add_snitch_test_args(openmp openmp --base-hartid=3 --num-cores=9 --num-clusters=1)

# FP8 tests
add_snitch_test_executable(fp8_comparison_vector tests/fp8_comparison_vector.c)
add_snitch_test_executable(fp8_comparison_scalar tests/fp8_comparison_scalar.c)
add_snitch_test_executable(fp8_computation_scalar tests/fp8_computation_scalar.c)
add_snitch_test_executable(fp8_computation_vector tests/fp8_computation_vector.c)

add_snitch_test_rtl(fp8_comparison_vector tests/fp8_comparison_vector.c)
add_snitch_test_rtl(fp8_comparison_scalar tests/fp8_comparison_scalar.c)
add_snitch_test_rtl(fp8_computation_scalar tests/fp8_computation_scalar.c)
add_snitch_test_rtl(fp8_computation_vector tests/fp8_computation_vector.c)

# FP8ALT tests
add_snitch_test_executable(fp8alt_comparison_vector tests/fp8alt_comparison_vector.c)
add_snitch_test_executable(fp8alt_comparison_scalar tests/fp8alt_comparison_scalar.c)
add_snitch_test_executable(fp8alt_computation_scalar tests/fp8alt_computation_scalar.c)
add_snitch_test_executable(fp8alt_computation_vector tests/fp8alt_computation_vector.c)

add_snitch_test_rtl(fp8alt_comparison_vector tests/fp8alt_comparison_vector.c)
add_snitch_test_rtl(fp8alt_comparison_scalar tests/fp8alt_comparison_scalar.c)
add_snitch_test_rtl(fp8alt_computation_scalar tests/fp8alt_computation_scalar.c)
add_snitch_test_rtl(fp8alt_computation_vector tests/fp8alt_computation_vector.c)

# FP16 tests
add_snitch_test_executable(fp16_comparison_vector tests/fp16_comparison_vector.c)
add_snitch_test_executable(fp16_comparison_scalar tests/fp16_comparison_scalar.c)
add_snitch_test_executable(fp16_computation_scalar tests/fp16_computation_scalar.c)
add_snitch_test_executable(fp16_computation_vector tests/fp16_computation_vector.c)

add_snitch_test_rtl(fp16_comparison_vector tests/fp16_comparison_vector.c)
add_snitch_test_rtl(fp16_comparison_scalar tests/fp16_comparison_scalar.c)
add_snitch_test_rtl(fp16_computation_scalar tests/fp16_computation_scalar.c)
add_snitch_test_rtl(fp16_computation_vector tests/fp16_computation_vector.c)

# FP16ALT tests
add_snitch_test_executable(fp16alt_comparison_vector tests/fp16alt_comparison_vector.c)
add_snitch_test_executable(fp16alt_comparison_scalar tests/fp16alt_comparison_scalar.c)
add_snitch_test_executable(fp16alt_computation_scalar tests/fp16alt_computation_scalar.c)
add_snitch_test_executable(fp16alt_computation_vector tests/fp16alt_computation_vector.c)

add_snitch_test_rtl(fp16alt_comparison_vector tests/fp16alt_comparison_vector.c)
add_snitch_test_rtl(fp16alt_comparison_scalar tests/fp16alt_comparison_scalar.c)
add_snitch_test_rtl(fp16alt_computation_scalar tests/fp16alt_computation_scalar.c)
add_snitch_test_rtl(fp16alt_computation_vector tests/fp16alt_computation_vector.c)

# FP32 tests
add_snitch_test_executable(fp32_comparison_vector tests/fp32_comparison_vector.c)
add_snitch_test_executable(fp32_comparison_scalar tests/fp32_comparison_scalar.c)
add_snitch_test_executable(fp32_computation_scalar tests/fp32_computation_scalar.c)
add_snitch_test_executable(fp32_computation_vector tests/fp32_computation_vector.c)

add_snitch_test_rtl(fp32_comparison_vector tests/fp32_comparison_vector.c)
add_snitch_test_rtl(fp32_comparison_scalar tests/fp32_comparison_scalar.c)
add_snitch_test_rtl(fp32_computation_scalar tests/fp32_computation_scalar.c)
add_snitch_test_rtl(fp32_computation_vector tests/fp32_computation_vector.c)

# FP conversion tests
add_snitch_test_executable(fp32_conversions_scalar tests/fp32_conversions_scalar.c)
add_snitch_test_executable(fp64_conversions_scalar tests/fp64_conversions_scalar.c)

add_snitch_test_rtl(fp32_conversions_scalar tests/fp32_conversions_scalar.c)
add_snitch_test_rtl(fp64_conversions_scalar tests/fp64_conversions_scalar.c)
# RTL only tests
if(SNITCH_RUNTIME STREQUAL "snRuntime-cluster")

add_snitch_test_executable(dma_simple tests/dma_simple.c)
add_snitch_test_rtl(dma_simple)

add_snitch_test_executable(perf_cnt tests/perf_cnt.c)
add_snitch_test_rtl(perf_cnt)

add_snitch_test_executable(multi_cluster tests/multi_cluster.c)
add_snitch_test_rtl(multi_cluster)

# Tests exclusive to LLVM
if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_snitch_test_executable(data_mover tests/data_mover.c)
add_snitch_test_rtl(data_mover)
add_snitch_test_args(data_mover data_mover --base-hartid=3 --num-cores=9 --num-clusters=1)

add_snitch_test_executable(event_unit tests/event_unit.c)
add_snitch_test_rtl(event_unit)
add_snitch_test_args(event_unit event_unit --base-hartid=3 --num-cores=9 --num-clusters=1)
add_snitch_test_executable(openmp tests/openmp.c)
add_snitch_test_rtl(openmp)
add_snitch_test_args(openmp openmp --base-hartid=3 --num-cores=9 --num-clusters=1)

# FP8 tests
add_snitch_test_executable(fp8_comparison_vector tests/fp8_comparison_vector.c)
add_snitch_test_executable(fp8_comparison_scalar tests/fp8_comparison_scalar.c)
add_snitch_test_executable(fp8_computation_scalar tests/fp8_computation_scalar.c)
add_snitch_test_executable(fp8_computation_vector tests/fp8_computation_vector.c)

add_snitch_test_rtl(fp8_comparison_vector tests/fp8_comparison_vector.c)
add_snitch_test_rtl(fp8_comparison_scalar tests/fp8_comparison_scalar.c)
add_snitch_test_rtl(fp8_computation_scalar tests/fp8_computation_scalar.c)
add_snitch_test_rtl(fp8_computation_vector tests/fp8_computation_vector.c)

# FP8ALT tests
add_snitch_test_executable(fp8alt_comparison_vector tests/fp8alt_comparison_vector.c)
add_snitch_test_executable(fp8alt_comparison_scalar tests/fp8alt_comparison_scalar.c)
add_snitch_test_executable(fp8alt_computation_scalar tests/fp8alt_computation_scalar.c)
add_snitch_test_executable(fp8alt_computation_vector tests/fp8alt_computation_vector.c)

add_snitch_test_rtl(fp8alt_comparison_vector tests/fp8alt_comparison_vector.c)
add_snitch_test_rtl(fp8alt_comparison_scalar tests/fp8alt_comparison_scalar.c)
add_snitch_test_rtl(fp8alt_computation_scalar tests/fp8alt_computation_scalar.c)
add_snitch_test_rtl(fp8alt_computation_vector tests/fp8alt_computation_vector.c)

# FP16 tests
add_snitch_test_executable(fp16_comparison_vector tests/fp16_comparison_vector.c)
add_snitch_test_executable(fp16_comparison_scalar tests/fp16_comparison_scalar.c)
add_snitch_test_executable(fp16_computation_scalar tests/fp16_computation_scalar.c)
add_snitch_test_executable(fp16_computation_vector tests/fp16_computation_vector.c)

add_snitch_test_rtl(fp16_comparison_vector tests/fp16_comparison_vector.c)
add_snitch_test_rtl(fp16_comparison_scalar tests/fp16_comparison_scalar.c)
add_snitch_test_rtl(fp16_computation_scalar tests/fp16_computation_scalar.c)
add_snitch_test_rtl(fp16_computation_vector tests/fp16_computation_vector.c)

# FP16ALT tests
add_snitch_test_executable(fp16alt_comparison_vector tests/fp16alt_comparison_vector.c)
add_snitch_test_executable(fp16alt_comparison_scalar tests/fp16alt_comparison_scalar.c)
add_snitch_test_executable(fp16alt_computation_scalar tests/fp16alt_computation_scalar.c)
add_snitch_test_executable(fp16alt_computation_vector tests/fp16alt_computation_vector.c)

add_snitch_test_rtl(fp16alt_comparison_vector tests/fp16alt_comparison_vector.c)
add_snitch_test_rtl(fp16alt_comparison_scalar tests/fp16alt_comparison_scalar.c)
add_snitch_test_rtl(fp16alt_computation_scalar tests/fp16alt_computation_scalar.c)
add_snitch_test_rtl(fp16alt_computation_vector tests/fp16alt_computation_vector.c)

# FP32 tests
add_snitch_test_executable(fp32_comparison_vector tests/fp32_comparison_vector.c)
add_snitch_test_executable(fp32_comparison_scalar tests/fp32_comparison_scalar.c)
add_snitch_test_executable(fp32_computation_scalar tests/fp32_computation_scalar.c)
add_snitch_test_executable(fp32_computation_vector tests/fp32_computation_vector.c)

add_snitch_test_rtl(fp32_comparison_vector tests/fp32_comparison_vector.c)
add_snitch_test_rtl(fp32_comparison_scalar tests/fp32_comparison_scalar.c)
add_snitch_test_rtl(fp32_computation_scalar tests/fp32_computation_scalar.c)
add_snitch_test_rtl(fp32_computation_vector tests/fp32_computation_vector.c)

# FP conversion tests
add_snitch_test_executable(fp32_conversions_scalar tests/fp32_conversions_scalar.c)
add_snitch_test_executable(fp64_conversions_scalar tests/fp64_conversions_scalar.c)

add_snitch_test_rtl(fp32_conversions_scalar tests/fp32_conversions_scalar.c)
add_snitch_test_rtl(fp64_conversions_scalar tests/fp64_conversions_scalar.c)
endif()
endif()
3 changes: 3 additions & 0 deletions sw/snRuntime/include/snrt.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ extern int snrt_is_compute_core();
extern int snrt_is_dm_core();
extern void snrt_wakeup(uint32_t mask);

/// get pointer to barrier register
extern uint32_t _snrt_barrier_reg_ptr();

/// get start address of global memory
extern snrt_slice_t snrt_global_memory();
/// get start address of the cluster's tcdm memory
Expand Down
2 changes: 0 additions & 2 deletions sw/snRuntime/src/barrier.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#include "snrt.h"
#include "team.h"

extern void _snrt_cluster_barrier();

/// Synchronize cores in a cluster with a hardware barrier
void snrt_cluster_hw_barrier() { _snrt_cluster_barrier(); }

Expand Down
11 changes: 11 additions & 0 deletions sw/snRuntime/src/platforms/banshee/putchar.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright 2020 ETH Zurich and University of Bologna.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#include "snrt.h"

extern const uint32_t wakeup_reg;

// Provide an implementation for putchar.
void snrt_putchar(char character) {
*(volatile uint32_t *)0xF00B8000 = character;
}
34 changes: 34 additions & 0 deletions sw/snRuntime/src/platforms/banshee/start_snitch.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2020 ETH Zurich and University of Bologna.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

#include "../shared/start_snitch.S"

# Function to terminate execution.
#
# Expecting:
# - a0: exit code
# - a1: device tree ptr
_snrt_exit:
.globl _snrt_exit
# Determine global core index.
addi sp, sp, -8
sw a0, 0(sp)
sw ra, 4(sp)
call snrt_global_core_idx
# reload exit code into t0
lw t0, 0(sp)
lw ra, 4(sp)
addi sp, sp, 8

# Only first core triggers exit.
# - a0: global core index
# - t0: exit code
bnez a0, 1f
slli t0, t0, 1
ori t0, t0, 1
la t1, scratch_reg
sw t0, 0(t1)
1: ret

.set scratch_reg, 0x02000014 # used as exit code location
Loading

0 comments on commit 3f8ab4a

Please sign in to comment.