lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Copyright lowRISC contributors. |
| 4 | # Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| 5 | # SPDX-License-Identifier: Apache-2.0 |
| 6 | |
| 7 | # This script runs LEC (logical equivalence checking) between 2 RTL |
| 8 | # files using Cadence Conformal LEC |
| 9 | # |
| 10 | # Usaage: To compare e.g. ../ip/foo/rtl/module.sv with |
| 11 | # ../ip/rtl/foo/module_new.sv, type: |
| 12 | # diff_rtl ../ip/foo/rtl/module.sv ../ip/foo/rtl/module_new.sv |
| 13 | |
| 14 | # pass golden and revised to LEC script "rtl_diff.do" via env variables |
| 15 | export LEC_GOLDEN=../../../${1} |
| 16 | export LEC_REVISED=../../../${2} |
| 17 | |
| 18 | #------------------------------------------------------------------------- |
| 19 | # use fusesoc to generate file list |
| 20 | #------------------------------------------------------------------------- |
| 21 | \rm -Rf build rtl_diff.log |
Tobias Wölfel | 93043d0 | 2019-10-22 14:53:29 +0200 | [diff] [blame] | 22 | fusesoc --cores-root .. run --target=sim --setup --build formal > /dev/null 2>&1 |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 23 | |
| 24 | #------------------------------------------------------------------------- |
| 25 | # run Conformal LEC |
| 26 | #------------------------------------------------------------------------- |
| 27 | cd build/formal_*/sim-icarus |
| 28 | |
| 29 | lec -xl -nogui -nobanner \ |
| 30 | -dofile ../../../rtl_diff.do \ |
| 31 | -logfile ../../../rtl_diff.log \ |
| 32 | <<< "exit -force" |
| 33 | |
| 34 | cd - |