Skip to content

Commit

Permalink
Fixed single.go for the new magic insn
Browse files Browse the repository at this point in the history
  • Loading branch information
ksco committed Nov 20, 2023
1 parent 8c491ec commit a6ae039
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Options:

For example, to generate `isa=rv32gcv varch=vlen:128,elen:32 mode=machine` tests, use `make -e VLEN=128 XLEN=32 MODE=machine -j$(nproc)`.

> Note: [single/single.go](single/single.go) generates tests directly from stage 1, suitable for targets with co-simulators.
### Nix package

This repository also provides a nix derivation with the following output provided:
Expand Down
4 changes: 3 additions & 1 deletion single/single.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/ksco/riscv-vector-tests/generator"
"os"
"path/filepath"
"regexp"
)

func fatalIf(err error) {
Expand Down Expand Up @@ -44,7 +45,8 @@ func main() {
insn, err := generator.ReadInsnFromToml(contents, option)
fatalIf(err)

writeTo(*outputFileF, insn.Generate(-1)[0])
r := regexp.MustCompile(".word 0x.+")
writeTo(*outputFileF, r.ReplaceAllString(insn.Generate(-1)[0], ""))
}

func writeTo(path string, contents string) {
Expand Down

0 comments on commit a6ae039

Please sign in to comment.