Code Monkey home page Code Monkey logo

riscv-check's Introduction

RISC-V Check

linting: pylint Checked with mypy

Description

Simple script for testing RISC-V codegeneration of RISC-V extensions (currently bitmanip only)

Quick start:

git clone https://github.com/SpinSpinSugar/riscv-check

Setup venv:

python3 -m venv .env
source .env/bin/activate
pip install -r requirements.txt

Example (gcc):

python3 riscv_check.py riscv64-unknown-linux-gnu-gcc rv64gv_zba_zbb_zbc_zbs lp64d 3
python3 riscv_check.py --format="csv" riscv64-unknown-linux-gnu-gcc rv64gv_zba_zbb_zbc_zbs lp64d 3

Example (clang):

python3 riscv_check.py --params="--target=riscv64" clang rv64gv_zba_zbb_zbc_zbs lp64d 3
python3 riscv_check.py --params="--target=riscv64" --format=csv clang rv64gv_zba_zbb_zbc_zbs lp64d 3 

How to add your test

cd tests
# for example zba
mkdir %YOUR RISC-V EXTENSION NAME%
cd %YOUR RISC-V EXTENSION NAME%
# for example andn
mkdir %INSTRUCTION_NAME%
# for example andn64.c
touch %TEST_NAME%.c

File format (function name is important!!!):

#include <stdint.h>
int64_t test(args...) {
	//your code that you expect compiler to convert to INSTRUCTION_NAME assembly line
}

Bitmanip march for testing:

  • rv64id_zba_zbb_zbc_zbs

riscv-check's People

Contributors

spinspinsugar avatar

Stargazers

 avatar

Watchers

 avatar

riscv-check's Issues

Doubt on logic to test the intructions

this is more into the question instead an issue.
im not sure in understanding the logic
1.there will be the c program for each instruction and using it ASM is generated
2.if the instruction name is found in that asm ,then the test is passed

but dont you think there is need of randomisation in testing asm by giving extreme ranges of bit values which it can hold?
or is the current one enough?i need little explanation please

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.