Pirmin Vogel | bf70818 | 2021-04-27 17:26:11 +0200 | [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 | # Setup IP name and top module. |
| 8 | # When changing the top module, some parameters might not exist and |
| 9 | # tcl/yosys_run_synth.tcl might need to be adjusted accordingly. |
| 10 | export LR_SYNTH_IP_NAME=aes |
| 11 | export LR_SYNTH_TOP_MODULE=aes |
| 12 | |
| 13 | # Setup module parameters. |
| 14 | export LR_SYNTH_AES_192_ENABLE=1 |
| 15 | export LR_SYNTH_MASKING=1 |
| 16 | export LR_SYNTH_S_BOX_IMPL=4 |
| 17 | |
| 18 | # Setup cell library path. |
| 19 | # Uncomment the lines below and set the path to an appropriate .lib file |
| 20 | # export LR_SYNTH_CELL_LIBRARY_PATH=/path/to/NangateOpenCellLibrary_typical.lib |
| 21 | # export LR_SYNTH_CELL_LIBRARY_NAME=nangate |
| 22 | if [ -z "$LR_SYNTH_CELL_LIBRARY_PATH" ]; then |
| 23 | echo >&2 "You forgot to set LR_SYNTH_CELL_LIBRARY_PATH!"; |
| 24 | exit 1; |
| 25 | fi |
| 26 | if [ -z "$LR_SYNTH_CELL_LIBRARY_NAME" ]; then |
| 27 | echo >&2 "You forgot to set LR_SYNTH_CELL_LIBRARY_NAME!"; |
| 28 | exit 1; |
| 29 | fi |
| 30 | |
| 31 | # Control synthesis flow. |
| 32 | export LR_SYNTH_TIMING_RUN=0 |
| 33 | export LR_SYNTH_FLATTEN=1 |
| 34 | |
| 35 | # For timing runs, hierarchy flattening is needed. |
| 36 | if [[ $LR_SYNTH_TIMING_RUN == 1 ]] && [[ $LR_SYNTH_FLATTEN == 0 ]]; then |
| 37 | echo >&2 "LR_SYNTH_TIMING_RUN requires LR_SYNTH_FLATTEN!"; |
| 38 | exit 1; |
| 39 | fi |
| 40 | |
| 41 | # Output directory |
| 42 | if [ $# -eq 1 ]; then |
| 43 | export LR_SYNTH_OUT_DIR=$1 |
| 44 | elif [ $# -eq 0 ]; then |
| 45 | export LR_SYNTH_OUT_DIR_PREFIX="syn_out/${LR_SYNTH_TOP_MODULE}" |
| 46 | export LR_SYNTH_OUT_DIR=$(date +"${LR_SYNTH_OUT_DIR_PREFIX}_%Y_%m_%d_%H_%M_%S") |
| 47 | else |
| 48 | echo "Usage $0 [synth_out_dir]" |
| 49 | exit 1 |
| 50 | fi |