Skip to content

Commit 9f09b3e

Browse files
Clo91eafunlsycn
authored andcommitted
[nix] add formal nix
1 parent 5a61f5b commit 9f09b3e

File tree

5 files changed

+53
-11
lines changed

5 files changed

+53
-11
lines changed

templates/chisel/nix/gcd/default.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ in
5858
formal-mlirbc =
5959
scope.callPackage ./mlirbc.nix { elaborate = scope.formal-elaborate; };
6060
formal-rtl = scope.callPackage ./rtl.nix { mlirbc = scope.formal-mlirbc; };
61+
formal = scope.callPackage ./formal.nix {
62+
rtl = scope.formal-rtl.override {
63+
enable-layers =
64+
[ "Verification" "Verification.Assert" "Verification.Cover" ];
65+
};
66+
};
6167

6268
# TODO: designConfig should be read from OM
6369
tbConfig = with builtins;

templates/chisel/nix/gcd/formal.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-FileCopyrightText: 2024 Jiuyang Liu <[email protected]>
3+
4+
{ lib, stdenv, rtl }

templates/chisel/nix/pkgs/cds-fhs-env.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ lockedPkgs.buildFHSEnv {
2121
profile = ''
2222
[ ! -e "${jasperHome}" ] && echo "env JASPER_HOME not set" && exit 1
2323
[ ! -d "${jasperHome}" ] && echo "JASPER_HOME not accessible" && exit 1
24-
[ -z "${cdsLicenseFile}" ] && echo "env CDS LICENSE not set" && exit 1
24+
[ -z "${cdsLicenseFile}" ] && echo "env CDS_LIC_FILE not set" && exit 1
2525
export JASPER_HOME=${jasperHome}
2626
export PATH=$JASPER_HOME/bin:$PATH
2727
export _oldCdsEnvPath="$PATH"

templates/chisel/report.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
==============================================================
3+
JasperGold Verification Results
4+
==============================================================
5+
2020.03 FCS 64 bits for Linux64 2.6.32-431.11.2.el6.x86_64
6+
Host Name: Clo91eaf.
7+
User Name: clo91eaf
8+
Printed on: Saturday, Sep21, 2024 10:47:48 PM CST
9+
Working Directory: /home/clo91eaf/Project/Plct/chisel-nix/templates/chisel
10+
11+
12+
==============================================================
13+
RESULTS
14+
==============================================================
15+
16+
-------------------------------------------------------------------------------------------------------------------
17+
Name | Result | Engine | Bound | Time
18+
-------------------------------------------------------------------------------------------------------------------
19+
20+
---[ <embedded> ]--------------------------------------------------------------------------------------------------
21+
[1] GCDFormal.GCD_ASSUMPTION_INPUT_NOT_VALID temporary ? 0.000 s
22+
[2] GCDFormal.GCD_ASSUMPTION_INPUT_NOT_VALID:precondition1 covered Hp 1 0.008 s
23+
[3] GCDFormal.GCD_ASSUMPTION_INPUT_4_6 temporary ? 0.000 s
24+
[4] GCDFormal.GCD_ALWAYS_RESPONSE cex Hp 1 0.010 s
25+
[5] GCDFormal.GCD_ALWAYS_RESPONSE:precondition1 covered Hp 1 0.010 s
26+
[6] GCDFormal.GCD_NO_DOUBLE_FIRE proven N (12) 0.001 s
27+
[7] GCDFormal.GCD_NO_DOUBLE_FIRE:precondition1 covered Hp 1 0.010 s
28+
[8] GCDFormal.GCD_RESULT_IS_CORRECT proven N Infinite 0.027 s
29+
[9] GCDFormal.GCD_RESULT_IS_CORRECT:precondition1 covered Hp 5 0.014 s
30+
[10] GCDFormal.GCD_COVER_BACK_PRESSURE covered Hp 1 0.008 s

templates/chisel/scripts/formal/FPV.tcl

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ 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-
}
32+
# Set exit code for ci, should only in batch mode
33+
34+
# report -file report.txt
35+
# set failed_properties [get_property_list -include {status {cex unreachable}}]
36+
# set length [llength $failed_properties]
37+
# if { $length > 0 } {
38+
# puts "There are $length failed properties!"
39+
# exit 1
40+
# } else {
41+
# puts "All properties passed!"
42+
# exit 0
43+
# }

0 commit comments

Comments
 (0)