Skip to content

codewars/riscv

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
 
 
 
 
 
 
 
 
 
 
 
 

codewars-riscv64

Container image for RISCV64 assembly used by CodeRunner.

Prerequisites

The container host must support QEMU user-mode emulation. Install the statically linked binaries for QEMU user-mode emulation on the container host, e.g. on Ubuntu 22.04:

$ sudo apt update && sudo apt install qemu-user-static

Usage

$ ./bin/run

Specify a container engine (default: docker) with environment variable CONTAINER_ENGINE. E.g. with Podman:

$ CONTAINER_ENGINE=podman ./bin/run

Specify an example under the examples/ directory to run (default: multiply) by passing a command-line argument. E.g. to run the example under examples/multiply-failing/:

$ ./bin/run multiply-failing

Examples

  • multiply (default): Example of multiply function with fixed and random tests
  • multiply-failing: Like multiply, but with a failing implementation
  • syntax-error: An assembly program with syntax errors. Also demonstrates that it shouldn't be possible to cheat by replacing assembly with C
  • invalid-regname: An assembly program with an invalid register name t7 (RISCV64 temporaries only range from t0 to t6)

Building

$ docker build --platform linux/riscv64 -t ghcr.io/codewars/riscv:latest .

License

MIT