https://github.com/codewars/riscv
Container image for RISC-V
https://github.com/codewars/riscv
code-runner code-runner-image
Last synced: 3 months ago
JSON representation
Container image for RISC-V
- Host: GitHub
- URL: https://github.com/codewars/riscv
- Owner: codewars
- License: mit
- Created: 2022-07-28T14:03:57.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-15T22:47:08.000Z (over 2 years ago)
- Last Synced: 2025-01-10T05:35:59.974Z (4 months ago)
- Topics: code-runner, code-runner-image
- Language: C
- Homepage:
- Size: 29.3 KB
- Stars: 5
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# codewars-riscv64
Container image for RISCV64 assembly used by CodeRunner.
## Prerequisites
The container host must support [QEMU user-mode emulation](https://www.qemu.org/docs/master/user/main.html). Install the statically linked binaries for QEMU user-mode emulation **on the container host**, e.g. on Ubuntu 22.04:
```bash
$ sudo apt update && sudo apt install qemu-user-static
```## Usage
```bash
$ ./bin/run
```Specify a container engine (default: `docker`) with environment variable `CONTAINER_ENGINE`. E.g. with Podman:
```bash
$ 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/`:
```bash
$ ./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
```bash
$ docker build --platform linux/riscv64 -t ghcr.io/codewars/riscv:latest .
```## License
[MIT](./LICENSE)