Skip to content

Commit 5a61f5b

Browse files
Clo91eafunlsycn
authored andcommitted
[ci] add formal ci
1 parent d845cdd commit 5a61f5b

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

.github/workflows/main.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,25 @@ jobs:
7373
- name: "Run verilator"
7474
run: |
7575
nix run '.#gcd.verilated'
76+
77+
run-formal-verification:
78+
name: "Run Formal Verification"
79+
strategy:
80+
fail-fast: false
81+
runs-on: [self-hosted, linux, nixos]
82+
defaults:
83+
run:
84+
working-directory: ./templates/chisel
85+
steps:
86+
- uses: actions/checkout@v4
87+
with:
88+
ref: ${{ github.event.pull_request.head.sha }}
89+
- name: "Build formal rtl"
90+
run: |
91+
nix run '.#gcd.formal-rtl'
92+
- name: "Build formal environment"
93+
run: |
94+
nix run '.#cds-fhs-env' --impure
95+
- name: "Run formal verification"
96+
run: |
97+
jg -batch ./scripts/formal/FPV.tcl

templates/chisel/scripts/formal/FPV.tcl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,13 @@ prove -all
2929
# Report proof results
3030
report
3131

32+
# Set exit code for ci
33+
set failed_properties [get_property_list -include {status {cex unreachable}}]
34+
set length [llength $failed_properties]
35+
if { $length > 0 } {
36+
puts "There are $length failed properties!"
37+
exit 1
38+
} else {
39+
puts "All properties passed!"
40+
exit 0
41+
}

0 commit comments

Comments
 (0)