# global parameters
set check         # checks intermediate networks
#set checkfio      # prints warnings when fanins/fanouts are duplicated
#unset checkread   # does not check new networks after reading from file
#set backup        # saves backup networks retrived by "undo" and "recall"
#set savesteps 1   # sets the maximum number of backup networks to save 
#set progressbar   # display the progress bar

# program names for internal calls
set dotwin dot.exe
set dotunix dot
set gsviewwin gsview32.exe
set gsviewunix gv
set siswin sis.exe
set sisunix sis
set mvsiswin mvsis.exe
set mvsisunix mvsis
set capowin MetaPl-Capo10.1-Win32.exe
set capounix MetaPl-Capo10.1
set gnuplotwin wgnuplot.exe
set gnuplotunix gnuplot

# Niklas Een's commands
load_plugin C:\_projects\abc\_TEST\bip\bip_2011-06-27.exe "BIP"

# standard aliases
alias b balance
alias cg clockgate
alias cl cleanup
alias clp collapse
alias cs care_set
alias esd ext_seq_dcs
alias f fraig
alias fs fraig_sweep
alias fsto fraig_store
alias fres fraig_restore
alias fr fretime
alias ft fraig_trust
alias ic indcut
alias lp lutpack
alias pcon print_cone
alias pd print_dsd
alias pex print_exdc -d
alias pf print_factor
alias pfan print_fanio
alias pg print_gates
alias pl print_level
alias plat print_latch
alias pio print_io
alias pk print_kmap
alias pm print_miter
alias ps print_stats 
alias psb print_stats -b
alias psu print_supp
alias psy print_symm
alias pun print_unate
alias q quit
alias r read
alias ra read_aiger
alias r3 retime -M 3
alias r3f retime -M 3 -f
alias r3b retime -M 3 -b
alias ren renode
alias rh read_hie
alias ri read_init
alias rl read_blif
alias rb read_bench
alias ret retime
alias dret dretime
alias rp read_pla
alias rt read_truth
alias rv read_verilog
alias rvl read_verlib
alias rsup read_super mcnc5_old.super
alias rlib read_library
alias rlibc read_library cadence.genlib
alias rty read_liberty
alias rlut read_lut
alias rw rewrite
alias rwz rewrite -z
alias rf refactor
alias rfz refactor -z
alias re restructure
alias rez restructure -z
alias rs resub
alias rsz resub -z
alias sa set autoexec ps
alias scl scleanup
alias sif if -s
alias so source -x
alias st strash
alias sw sweep
alias ssw ssweep
alias tr0 trace_start
alias tr1 trace_check
alias trt "r c.blif; st; tr0; b; tr1"
alias u undo
alias w write
alias wa write_aiger
alias wb write_bench
alias wc write_cnf
alias wh write_hie
alias wl write_blif
alias wp write_pla
alias wv write_verilog

# standard scripts
alias resyn       "b; rw; rwz; b; rwz; b"
alias resyn2      "b; rw; rf; b; rw; rwz; b; rfz; rwz; b"
alias resyn2a     "b; rw; b; rw; rwz; b; rwz; b"
alias resyn3      "b; rs; rs -K 6; b; rsz; rsz -K 6; b; rsz -K 5; b"
alias compress    "b -l; rw -l; rwz -l; b -l; rwz -l; b -l"
alias compress2   "b -l; rw -l; rf -l; b -l; rw -l; rwz -l; b -l; rfz -l; rwz -l; b -l"
alias choice      "fraig_store; resyn; fraig_store; resyn2; fraig_store; fraig_restore"
alias choice2     "fraig_store; balance; fraig_store; resyn; fraig_store; resyn2; fraig_store; resyn2; fraig_store; fraig_restore"
alias rwsat       "st; rw -l; b -l; rw -l; rf -l"
alias drwsat2     "st; drw; b -l; drw; drf; ifraig -C 20; drw; b -l; drw; drf"
alias share       "st; multi -m; fx; resyn2"

# resubstitution scripts for the IWLS paper
alias src_rw      "st; rw -l; rwz -l; rwz -l" 
alias src_rs      "st; rs -K 6 -N 2 -l; rs -K 9 -N 2 -l; rs -K 12 -N 2 -l" 
alias src_rws     "st; rw -l; rs -K 6 -N 2 -l; rwz -l; rs -K 9 -N 2 -l; rwz -l; rs -K 12 -N 2 -l" 
alias resyn2rs    "b; rs -K 6; rw; rs -K 6 -N 2; rf; rs -K 8; b; rs -K 8 -N 2; rw; rs -K 10; rwz; rs -K 10 -N 2; b; rs -K 12; rfz; rs -K 12 -N 2; rwz; b"
alias compress2rs "b -l; rs -K 6 -l; rw -l; rs -K 6 -N 2 -l; rf -l; rs -K 8 -l; b -l; rs -K 8 -N 2 -l; rw -l; rs -K 10 -l; rwz -l; rs -K 10 -N 2 -l; b -l; rs -K 12 -l; rfz -l; rs -K 12 -N 2 -l; rwz -l; b -l"

# experimental implementation of don't-cares
alias resyn2rsdc    "b; rs -K 6 -F 2; rw; rs -K 6 -N 2 -F 2; rf; rs -K 8 -F 2; b; rs -K 8 -N 2 -F 2; rw; rs -K 10 -F 2; rwz; rs -K 10 -N 2 -F 2; b; rs -K 12 -F 2; rfz; rs -K 12 -N 2 -F 2; rwz; b"
alias compress2rsdc "b -l; rs -K 6 -F 2 -l; rw -l; rs -K 6 -N 2 -F 2 -l; rf -l; rs -K 8 -F 2 -l; b -l; rs -K 8 -N 2 -F 2 -l; rw -l; rs -K 10 -F 2 -l; rwz -l; rs -K 10 -N 2 -F 2 -l; b -l; rs -K 12 -F 2 -l; rfz -l; rs -K 12 -N 2 -F 2 -l; rwz -l; b -l"

# temporaries
alias reachable "st; ps; compress2; ps; qrel; ps; compress2; ps; qreach -v; ps"
alias chnew     "st; haig_start; resyn2; haig_use"
alias chnewrs   "st; haig_start; resyn2rs; haig_use"
alias stdsd     "r test/6in.blif; st; ps; u; bdd; dsd -g; st; ps"
alias trec      "rec_start; r c.blif; st; rec_add; rec_use"
alias trec4     "rec_start -K 4; r i10.blif; st; rec_add; rec_use"
alias bmcf      "frames -i -F 10; orpos; iprove"

alias pjsolve   "scl; dc2; fr; dc2; ic; ic -t; if -a; cs tacas/005_care.aig; mfs; lp; st; ic"

alias t0        "r test/mc1.blif; st; test"
alias t1        "r s27mc2.blif; st; test"
alias t2        "r i/intel_001.aig; ps; indcut -v"
#alias t         "r c\s\0\000.aig; int"
#alias t         "r test/interpol.blif; st; int"
alias t         "&r s444.aig; &ps; &era -v"


alias spec "&r 1.aig;&srm -s;r gsrm.aig; bmc2 -F 1000 -C 10000; &resim; &w 1.aig; &ps "
alias spech "&r 1.aig;&srm -s;r gsrm.aig;scl;ps; bmc2 -F 1000 -C 25000; &resim; &w 1.aig; &ps "
alias spechx "&r 1.aig;&srm ;r gsrm.aig;smp;bmc2 -F 5000 -C 75000; &resim; &w 1.aig; &ps "
alias specb "&r 1.aig;&srm ;r gsrm.aig;smp;ps; reach -o -B 1000000 -F 2000; &resim; &w 1.aig; &ps "
alias specp "&r 1.aig;&srm ;r gsrm.aig;scorr -F 2;ps; simpk ; &resim; &w 1.aig; &ps "
alias sprb "ua; &get; eclassh; specb"
alias sprh "ua; &get; eclassh; spech"

alias eclass "&equiv -smf -W 255 -F 1000; &w 1.aig"
alias transfer "w 1.aig; &r 1.aig"
alias &ua "set autoexec "
alias scr "&get; &scorr; &put"
alias lcr "&get; &lcorr; &put"
alias trm "logic;trim;st;ps"
alias inth "int -rv -C 25000"

alias spr "ua; &get; eclass; spech"
alias reachx "reach -o -B 1000000000 -F 5000"
alias dc2rs "ua; compress2rs; ps"
alias simp "dprove -vrcbju -C 5000 -V 1"
alias simpk "dprove -vrcbkmfiu -B 10 -D 1000"
alias indh "ind -v -F 50 -C 10000"

alias eclassh "&equiv -smf -W 512 -F 2000; &w 1.aig"
alias ffx "ps;orpos;qua_ffix"
alias bfx "ps;orpos;qua_bfix"
alias smp "ua;ps;scl;rw;dr;lcorr;rw;dr;scorr;fraig;dc2;dr;scorr -F 2;dc2rs;w temp.aig"

alias s "w temp.aig"

alias absh "abs -se -D 25000"
alias absr "abs -ser -G 2000"
alias absp "abs -sep -G 2000"

alias spechi "ua; &get; &equiv -smf -W 512 -F 2000; &ps; &speci; &srm; r gsrm.aig;&ps;&w 1.aig"
alias spechis "ua; &get; &equiv -s -W 512 -F 2000; &ps; &speci; &srm -s; r gsrm.aig; &ps; &w 1.aig"
alias absh1 "absh -R 1"
alias simpkh "simpk -D 25000"

alias spechisf "ua; &get; &equiv -smf -W 512 -F 2000; &ps; &semi -R 5; &srm; r gsrm.aig;&ps;&w 1.aig"
alias spechissf "ua; &get; &equiv -s -W 512 -F 2000; &ps; &semi; &srm -s; r gsrm.aig; &ps; &w 1.aig"


