blob: 6989f3b6b679b042879adb2f1ecc35fd7f6077c4 [file] [log] [blame]
lowRISC Contributors802543a2019-08-31 12:12:56 +01001#!/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
15export LEC_GOLDEN=../../../${1}
16export LEC_REVISED=../../../${2}
17
18#-------------------------------------------------------------------------
19# use fusesoc to generate file list
20#-------------------------------------------------------------------------
21\rm -Rf build rtl_diff.log
Tobias Wölfel93043d02019-10-22 14:53:29 +020022fusesoc --cores-root .. run --target=sim --setup --build formal > /dev/null 2>&1
lowRISC Contributors802543a2019-08-31 12:12:56 +010023
24#-------------------------------------------------------------------------
25# run Conformal LEC
26#-------------------------------------------------------------------------
27cd build/formal_*/sim-icarus
28
29lec -xl -nogui -nobanner \
30 -dofile ../../../rtl_diff.do \
31 -logfile ../../../rtl_diff.log \
32 <<< "exit -force"
33
34cd -