blob: c6784089ee841053134ad24a43660c39366b823a [file] [log] [blame]
Pirmin Vogelbf708182021-04-27 17:26:11 +02001#!/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.
10export LR_SYNTH_IP_NAME=aes
11export LR_SYNTH_TOP_MODULE=aes
12
13# Setup module parameters.
14export LR_SYNTH_AES_192_ENABLE=1
15export LR_SYNTH_MASKING=1
16export 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
22if [ -z "$LR_SYNTH_CELL_LIBRARY_PATH" ]; then
23 echo >&2 "You forgot to set LR_SYNTH_CELL_LIBRARY_PATH!";
24 exit 1;
25fi
26if [ -z "$LR_SYNTH_CELL_LIBRARY_NAME" ]; then
27 echo >&2 "You forgot to set LR_SYNTH_CELL_LIBRARY_NAME!";
28 exit 1;
29fi
30
31# Control synthesis flow.
32export LR_SYNTH_TIMING_RUN=0
33export LR_SYNTH_FLATTEN=1
34
35# For timing runs, hierarchy flattening is needed.
36if [[ $LR_SYNTH_TIMING_RUN == 1 ]] && [[ $LR_SYNTH_FLATTEN == 0 ]]; then
37 echo >&2 "LR_SYNTH_TIMING_RUN requires LR_SYNTH_FLATTEN!";
38 exit 1;
39fi
40
41# Output directory
42if [ $# -eq 1 ]; then
43 export LR_SYNTH_OUT_DIR=$1
44elif [ $# -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")
47else
48 echo "Usage $0 [synth_out_dir]"
49 exit 1
50fi