diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-01-24 15:43:42 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-01-24 15:43:42 +0100 |
commit | d8300d1fb8a0c2643b1a3c5b7df3bae0f7a08701 (patch) | |
tree | 392c9940f961fe0063cef5a5eaf78f0ab6a1f7e9 /verilog2btor.sh | |
parent | 0b47d907d36842e0971dd038b5fb6093ca303a8a (diff) | |
parent | 761b8f99d71128fbcf193ded7b59184811199324 (diff) | |
download | yosys-d8300d1fb8a0c2643b1a3c5b7df3bae0f7a08701.tar.gz yosys-d8300d1fb8a0c2643b1a3c5b7df3bae0f7a08701.tar.bz2 yosys-d8300d1fb8a0c2643b1a3c5b7df3bae0f7a08701.zip |
Merge branch 'btor' of https://github.com/ahmedirfan1983/yosys into btor
Diffstat (limited to 'verilog2btor.sh')
-rwxr-xr-x | verilog2btor.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/verilog2btor.sh b/verilog2btor.sh new file mode 100755 index 000000000..ef0134e07 --- /dev/null +++ b/verilog2btor.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +# +# Script to writing btor from verilog design +# + +if [ "$#" -ne 3 ]; then + echo "Usage: $0 input.v output.btor top-module-name" >&2 + exit 1 +fi +if ! [ -e "$1" ]; then + echo "$1 not found" >&2 + exit 1 +fi + +FULL_PATH=$(readlink -f $1) +DIR=$(dirname $FULL_PATH) + +./yosys -q -p " +read_verilog $1; +hierarchy -top $3; +hierarchy -libdir $DIR; +hierarchy -check; +proc; +opt; opt_const -mux_undef; opt; +rename -hide;;; +techmap -map $YOSYS_HOME/techlibs/common/pmux2mux.v;; +memory -nomap;; +flatten;; +memory_unpack; +splitnets -driver; +setundef -zero -undriven; +opt;;; +write_btor $2;" + |