Skip to content

Commit

Permalink
Merge pull request #134 from tum-ei-eda/openasip-3
Browse files Browse the repository at this point in the history
Merge recent changes
  • Loading branch information
PhilippvK authored Nov 4, 2024
2 parents 771606c + 585f9ca commit 0ea714e
Show file tree
Hide file tree
Showing 147 changed files with 3,830 additions and 377 deletions.
62 changes: 59 additions & 3 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,73 @@ jobs:
run: |
source .venv/bin/activate
VERBOSE=${{ github.event.inputs.verbose }} PROGRESS=${{ github.event.inputs.progress }} CCACHE=${{ matrix.ccache }} CLONE_DEPTH=${{ github.event.inputs.clone_depth }} BUILD_CONFIG=${{ github.event.inputs.build_config }} IGNORE_ERROR=${{ github.event.inputs.ignore_error }} TEST=${{ github.event.inputs.test }} INSTALL=${{ github.event.inputs.install }} DEPLOY=${{ github.event.inputs.deploy }} EXPORT=${{ github.event.inputs.export }} DEST=/tmp/seal5_llvm ${{ steps.ctx.outputs.program }} examples/${{ github.event.inputs.script }}
- uses: actions/upload-artifact@v4
- name: Generate Reports
run: |
source .venv/bin/activate
mkdir reports/
# Properties
python3 -m seal5.backends.report.properties.writer /tmp/seal5_llvm/.seal5/models/*.seal5model --output reports/properties.csv
python3 -m seal5.backends.report.properties.writer /tmp/seal5_llvm/.seal5/models/*.seal5model --output reports/properties.md
echo "### Properties" >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
cat reports/properties.md >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
# Status
python3 -m seal5.backends.report.status.writer /tmp/seal5_llvm/.seal5/models/*.seal5model --yaml /tmp/seal5_llvm/.seal5/settings.yml --cols2rows --output reports/status.csv
python3 -m seal5.backends.report.status.writer /tmp/seal5_llvm/.seal5/models/*.seal5model --yaml /tmp/seal5_llvm/.seal5/settings.yml --cols2rows --output reports/status.md
echo "### Status" >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
cat reports/status.md >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
# Test Results
python3 -m seal5.backends.report.test_results.writer /tmp/seal5_llvm/.seal5/models/*.seal5model --yaml /tmp/seal5_llvm/.seal5/settings.yml --output reports/test_results.csv
python3 -m seal5.backends.report.test_results.writer /tmp/seal5_llvm/.seal5/models/*.seal5model --yaml /tmp/seal5_llvm/.seal5/settings.yml --output reports/test_results.md
echo "### Test Results" >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
cat reports/test_results.md >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
# Diff
python3 -m seal5.backends.report.diff.writer --yaml /tmp/seal5_llvm/.seal5/settings.yml --output reports/diff.csv
python3 -m seal5.backends.report.diff.writer --yaml /tmp/seal5_llvm/.seal5/settings.yml --output reports/diff.md
echo "### Diff" >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
cat reports/diff.md >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
# Stage Times
python3 -m seal5.backends.report.times.writer --yaml /tmp/seal5_llvm/.seal5/settings.yml --pass-times --output reports/stage_times.csv
python3 -m seal5.backends.report.times.writer --yaml /tmp/seal5_llvm/.seal5/settings.yml --pass-times --output reports/stage_times.md
python3 -m seal5.backends.report.times.writer --yaml /tmp/seal5_llvm/.seal5/settings.yml --pass-times --output reports/stage_times.mermaid
echo "### Stage/Pass Times" >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
cat reports/stage_times.md >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
echo "\`\`\`mermaid" >> $GITHUB_STEP_SUMMARY
cat reports/stage_times.mermaid >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
- name: Upload Seal5 Reports
uses: actions/upload-artifact@v4
with:
name: demo-reports
path: reports/
- name: Upload Seal5 Metadata
uses: actions/upload-artifact@v4
if: "${{ github.event.inputs.export == '1' }}"
with:
name: demo-export
path: /tmp/seal5_llvm.tar.gz
- uses: actions/upload-artifact@v4
- name: Upload Seal5 LLVM Installation
uses: actions/upload-artifact@v4
if: "${{ github.event.inputs.install == '1' }}"
with:
name: demo-install
path: /tmp/seal5_llvm/.seal5/install/${{ github.event.inputs.build_config }}
- uses: actions/upload-artifact@v4
- name: Upload Seal5 LLVM Sources
uses: actions/upload-artifact@v4
if: "${{ github.event.inputs.deploy == '1' }}"
with:
name: demo-source
Expand Down
62 changes: 59 additions & 3 deletions .github/workflows/demo_weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,73 @@ jobs:
run: |
source .venv/bin/activate
VERBOSE=${{ matrix.verbose }} PROGRESS=${{ matrix.progress }} CCACHE=${{ matrix.ccache }} CLONE_DEPTH=${{ matrix.clone_depth }} BUILD_CONFIG=${{ matrix.build_config }} IGNORE_ERROR=${{ matrix.ignore_error }} TEST=${{ matrix.test }} INSTALL=${{ matrix.install }} DEPLOY=${{ matrix.deploy }} EXPORT=${{ matrix.export }} DEST=/tmp/seal5_llvm ${{ steps.ctx.outputs.program }} examples/${{ matrix.script }}
- uses: actions/upload-artifact@v4
- name: Generate Reports
run: |
source .venv/bin/activate
mkdir reports/
# Properties
python3 -m seal5.backends.report.properties.writer /tmp/seal5_llvm/.seal5/models/*.seal5model --output reports/properties.csv
python3 -m seal5.backends.report.properties.writer /tmp/seal5_llvm/.seal5/models/*.seal5model --output reports/properties.md
echo "### Properties" >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
cat reports/properties.md >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
# Status
python3 -m seal5.backends.report.status.writer /tmp/seal5_llvm/.seal5/models/*.seal5model --yaml /tmp/seal5_llvm/.seal5/settings.yml --cols2rows --output reports/status.csv
python3 -m seal5.backends.report.status.writer /tmp/seal5_llvm/.seal5/models/*.seal5model --yaml /tmp/seal5_llvm/.seal5/settings.yml --cols2rows --output reports/status.md
echo "### Status" >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
cat reports/status.md >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
# Test Results
python3 -m seal5.backends.report.test_results.writer /tmp/seal5_llvm/.seal5/models/*.seal5model --yaml /tmp/seal5_llvm/.seal5/settings.yml --output reports/test_results.csv
python3 -m seal5.backends.report.test_results.writer /tmp/seal5_llvm/.seal5/models/*.seal5model --yaml /tmp/seal5_llvm/.seal5/settings.yml --output reports/test_results.md
echo "### Test Results" >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
cat reports/test_results.md >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
# Diff
python3 -m seal5.backends.report.diff.writer --yaml /tmp/seal5_llvm/.seal5/settings.yml --output reports/diff.csv
python3 -m seal5.backends.report.diff.writer --yaml /tmp/seal5_llvm/.seal5/settings.yml --output reports/diff.md
echo "### Diff" >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
cat reports/diff.md >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
# Stage Times
python3 -m seal5.backends.report.times.writer --yaml /tmp/seal5_llvm/.seal5/settings.yml --pass-times --output reports/stage_times.csv
python3 -m seal5.backends.report.times.writer --yaml /tmp/seal5_llvm/.seal5/settings.yml --pass-times --output reports/stage_times.md
python3 -m seal5.backends.report.times.writer --yaml /tmp/seal5_llvm/.seal5/settings.yml --pass-times --output reports/stage_times.mermaid
echo "### Stage/Pass Times" >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
cat reports/stage_times.md >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
echo "\`\`\`mermaid" >> $GITHUB_STEP_SUMMARY
cat reports/stage_times.mermaid >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
- name: Upload Seal5 Reports
uses: actions/upload-artifact@v4
with:
name: demo-${{ steps.ctx.outputs.name }}-reports
path: reports/
- name: Upload Seal5 Metadata
uses: actions/upload-artifact@v4
if: "${{ matrix.export == '1' }}"
with:
name: demo-${{ steps.ctx.outputs.name }}-export
path: /tmp/seal5_llvm.tar.gz
- uses: actions/upload-artifact@v4
- name: Upload Seal5 LLVM Installation
uses: actions/upload-artifact@v4
if: "${{ matrix.install == '1' }}"
with:
name: demo-${{ steps.ctx.outputs.name }}-install
path: /tmp/seal5_llvm/.seal5/install/${{ matrix.build_config }}
- uses: actions/upload-artifact@v4
- name: Upload Seal5 LLVM Sources
uses: actions/upload-artifact@v4
if: "${{ matrix.deploy == '1' }}"
with:
name: demo-${{ steps.ctx.outputs.name }}-source
Expand Down
22 changes: 17 additions & 5 deletions COMPATIBILITY.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# Seal5 Supported Instructions
# Compatibility

## Core-V Extensions
## Supported LLVM Versions

### Legend
| **Seal5** | **LLVM 17** | **LLVM 18** | **LLVM 19** | **Comment** |
|-----------------------|---------------------------------------|-------------------------------------------|---------------------------------------|------------------|
| `v0.1.0` | :white_check_mark: (`llvmorg-17.0.6`) | :x: | :x: | Limited support! |
| `v0.1.1` ... `v0.1.4` | :question: | :white_check_mark: (`llvmorg-18.1.0-rc3`) | :x: | |
| `TODO` | :question: | :question: | :white_check_mark: (`llvmorg-19.1.3`) | To be released! |

_(Last updated: 30.10.2024)_

## Supported Instructions

### Core-V Extensions

**Legend**

```
y: yes
Expand All @@ -13,15 +25,15 @@ f: filtered/excluded
?: unknown
```

### Notes
**Notes**

```
^1: commented out
^2: not planned/too specific
^3: due to tablegen freeze
```

### Table
**Table**

| Mnemonic | Extension | Group | Sub-Group | CDSL written? | Assembly support | Intrinsics support | Patterns support | Assembly tests | Intrinsics tests | Codegen tests |
|----------------------------------|------------|-------------------------|-----------------------------------------------|---------------|------------------|--------------------|------------------|----------------|------------------|---------------|
Expand Down
4 changes: 2 additions & 2 deletions examples/cdsl/rv_example/ExampleRV64.core_desc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import "../rv_base/RV64I.core_desc"

// InstructionSet XExample extends RISCVBase {
InstructionSet XExample extends RV64I {
InstructionSet XExample64 extends RV64I {
instructions {
// TODO: remove/replace prefix
CV_SUBINCACC {
encoding: 7'b0101000 :: rs2[4:0] :: rs1[4:0] :: 3'b011 :: rd[4:0] :: 7'b0101011;
assembly: {"xexample.subincacc", "{name(rd)}, {name(rs1)}, {name(rs2)}"};
assembly: {"xexample64.subincacc", "{name(rd)}, {name(rs1)}, {name(rs2)}"};
behavior: {
if (rd != 0) {
X[rd] += X[rs1] - X[rs2] + 1;
Expand Down
2 changes: 1 addition & 1 deletion examples/cdsl/rv_openasip
2 changes: 1 addition & 1 deletion examples/cdsl/rv_xcorev
Submodule rv_xcorev updated 1 files
+48 −48 XCoreVMac.core_desc
8 changes: 8 additions & 0 deletions examples/cfg/example/XExample.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
extensions:
XExample:
feature: XExample
arch: xexample
version: "1.0"
experimental: false
vendor: true
8 changes: 8 additions & 0 deletions examples/cfg/example/XExample64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
extensions:
XExample64:
feature: XExample
arch: xexample
version: "1.0"
experimental: false
vendor: true
2 changes: 1 addition & 1 deletion examples/cfg/example/intrinsics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ intrinsics:
arg_type: i32
- arg_name: rs2
arg_type: i32
instr_name: xexample.subincacc
instr_name: CV_SUBINCACC
intrinsic_name: subincacc
ret_type: i32
13 changes: 13 additions & 0 deletions examples/cfg/example/intrinsics64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
intrinsics:
intrinsics:
- args:
- arg_name: rd
arg_type: i64
- arg_name: rs1
arg_type: i64
- arg_name: rs2
arg_type: i64
instr_name: CV_SUBINCACC
intrinsic_name: subincacc
ret_type: i64
11 changes: 11 additions & 0 deletions examples/cfg/openasip/OpenASIP_base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
extensions:
OpenASIP_base:
version: "1.0"
# experimental: true
experimental: false
vendor: true
passes:
per_model:
OpenASIP_base:
overrides: {}
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
extensions:
XISE:
OpenASIP_paper:
version: "1.0"
experimental: true
# experimental: true
experimental: false
vendor: true
passes:
per_model:
OpenASIP_:
OpenASIP_paper:
overrides:
convert_models:
prefix: "SEAL5_"
12 changes: 12 additions & 0 deletions examples/cfg/openasip/intrinsics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
intrinsics:
intrinsics:
- args:
- arg_name: rs1
arg_type: i32
- arg_name: rs2
arg_type: i32
set_name: OpenASIP_base # TODO: change hierarchy
instr_name: openasip_base_max
intrinsic_name: openasip_base_max
ret_type: i32
2 changes: 1 addition & 1 deletion examples/cfg/passes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ passes:
behav_to_pat:
parallel: true
convert_models: &a
use_subprocess: false
use_subprocess: true
log_level: "warning"
filter_models: *a
drop_unused: *a
Expand Down
6 changes: 3 additions & 3 deletions examples/cfg/s4e/s4e-mac.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
extensions:
s4e-mac:
feature: s4emac
X_S4E_MAC:
feature: XS4EMAC
arch: xs4emac
version: "1.0"
experimental: true
# experimental: true
vendor: true
# patches: []
11 changes: 11 additions & 0 deletions examples/cfg/tumeda/intrinsics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
intrinsics:
intrinsics:
- args:
- arg_name: rd
arg_type: i32
- arg_name: rs1
arg_type: i32
instr_name: CV_NAND_BITWISE
intrinsic_name: xcv_nand_bitwise
ret_type: i32
7 changes: 3 additions & 4 deletions examples/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@

# Load test inputs
test_files = [
EXAMPLES_DIR / "tests" / "example" / "xexample32.test.s",
EXAMPLES_DIR / "tests" / "example" / "xexample32.test-invalid.s",
EXAMPLES_DIR / "tests" / "example" / "xexample32.test-codegen.ll",
EXAMPLES_DIR / "tests" / "example" / "test_subincacc.c",
EXAMPLES_DIR / "tests" / "xexample" / "xexample-*.s",
EXAMPLES_DIR / "tests" / "xexample" / "xexample-*.ll",
EXAMPLES_DIR / "tests" / "xexample" / "xexample-*.c",
]
seal5_flow.load(test_files, verbose=VERBOSE, overwrite=True)

Expand Down
14 changes: 11 additions & 3 deletions examples/openasip_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,25 @@

# Load CoreDSL inputs
cdsl_files = [
EXAMPLES_DIR / "cdsl" / "rv_openasip" / "OpenASIP_.core_desc",
EXAMPLES_DIR / "cdsl" / "rv_openasip" / "OpenASIP_base.core_desc",
EXAMPLES_DIR / "cdsl" / "rv_openasip" / "OpenASIP_paper.core_desc",
]
seal5_flow.load(cdsl_files, verbose=VERBOSE, overwrite=True)

# Load test inputs
test_files = [] # TODO
test_files = [
EXAMPLES_DIR / "tests" / "xopenasip" / "base" / "*.c",
EXAMPLES_DIR / "tests" / "xopenasip" / "base" / "*.s",
EXAMPLES_DIR / "tests" / "xopenasip" / "base" / "*.ll",
EXAMPLES_DIR / "tests" / "xopenasip" / "base" / "*.mir",
]
seal5_flow.load(test_files, verbose=VERBOSE, overwrite=True)

# Load YAML inputs
cfg_files = [
EXAMPLES_DIR / "cfg" / "openasip" / "OpenASIP.yml", # TODO: move to other dir
EXAMPLES_DIR / "cfg" / "openasip" / "OpenASIP_paper.yml",
EXAMPLES_DIR / "cfg" / "openasip" / "OpenASIP_base.yml",
EXAMPLES_DIR / "cfg" / "openasip" / "intrinsics.yml",
EXAMPLES_DIR / "cfg" / "llvm.yml",
EXAMPLES_DIR / "cfg" / "filter.yml",
EXAMPLES_DIR / "cfg" / "patches.yml",
Expand Down
8 changes: 5 additions & 3 deletions examples/rv64_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@

# Load test inputs
test_files = [
EXAMPLES_DIR / "tests" / "example" / "xexample64.test.s",
EXAMPLES_DIR / "tests" / "example" / "xexample64.test-invalid.s",
EXAMPLES_DIR / "tests" / "example" / "xexample64.test-codegen.ll",
EXAMPLES_DIR / "tests" / "xexample" / "xexample64-*.s",
EXAMPLES_DIR / "tests" / "xexample" / "xexample64-*.ll",
EXAMPLES_DIR / "tests" / "xexample" / "xexample64-*.c",
]
seal5_flow.load(test_files, verbose=VERBOSE, overwrite=True)

Expand All @@ -94,6 +94,8 @@
EXAMPLES_DIR / "cfg" / "tests.yml",
EXAMPLES_DIR / "cfg" / "passes.yml",
EXAMPLES_DIR / "cfg" / "git.yml",
EXAMPLES_DIR / "cfg" / "example/XExample64.yml",
EXAMPLES_DIR / "cfg" / "example/intrinsics64.yml",
]
seal5_flow.load(cfg_files, verbose=VERBOSE, overwrite=False)

Expand Down
Loading

0 comments on commit 0ea714e

Please sign in to comment.