Skip to content
Snippets Groups Projects
Commit 341995f2 authored by David Mapstone's avatar David Mapstone
Browse files

SOC1-124: Updated set_env script

parent f3387635
No related branches found
No related tags found
No related merge requests found
...@@ -15,4 +15,4 @@ DEFAULT_SIMULATOR="ivlog" ...@@ -15,4 +15,4 @@ DEFAULT_SIMULATOR="ivlog"
if [[ -z "${SIMULATOR}" ]]; then if [[ -z "${SIMULATOR}" ]]; then
SIMULATOR=$DEFAULT_SIMULATOR SIMULATOR=$DEFAULT_SIMULATOR
fi fi
$SOC_TOP"/flow/simulators/"$SIMULATOR"_sim.sh" $@ $SOC_TOP_DIR"/flow/simulators/"$SIMULATOR"_sim.sh" $@
...@@ -188,15 +188,15 @@ def stimulus_generation(stim_file, ref_file, input_start_address, input_size, ou ...@@ -188,15 +188,15 @@ def stimulus_generation(stim_file, ref_file, input_start_address, input_size, ou
# Generate ADP Command File with Write Transactions # Generate ADP Command File with Write Transactions
adp_file = os.environ["WRAP_ACC_DIR"] + "/simulate/stimulus/" + "adp_hash_stim.cmd" adp_file = os.environ["ACC_WRAPPER_DIR"] + "/simulate/stimulus/" + "adp_hash_stim.cmd"
adp_output(adp_file, output_word_list) adp_output(adp_file, output_word_list)
# Generate FRI File with Write Transactions # Generate FRI File with Write Transactions
fri_file = os.environ["WRAP_ACC_DIR"] + "/simulate/stimulus/" + "ahb_input_hash_stim.fri" fri_file = os.environ["ACC_WRAPPER_DIR"] + "/simulate/stimulus/" + "ahb_input_hash_stim.fri"
fri_output(fri_file, output_word_list) fri_output(fri_file, output_word_list)
# Call fm2conv.pl script # Call fm2conv.pl script
m2d_file = os.environ["WRAP_ACC_DIR"] + "/simulate/stimulus/" + "ahb_input_hash_stim.m2d" m2d_file = os.environ["ACC_WRAPPER_DIR"] + "/simulate/stimulus/" + "ahb_input_hash_stim.m2d"
os.system(f"fm2conv.pl -busWidth=32 -infile={fri_file} -outfile={m2d_file}") os.system(f"fm2conv.pl -busWidth=32 -infile={fri_file} -outfile={m2d_file}")
......
...@@ -10,27 +10,32 @@ ...@@ -10,27 +10,32 @@
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
#!/bin/bash #!/bin/bash
# Get Root Location of Repository # Get Root Location of Design Structure
if [ -z $DESIGN_ROOT ]; then if [ -z $DESIGN_ROOT ]; then
# If $DESIGN_ROOT hasn't been set yet # If $DESIGN_ROOT hasn't been set yet
DESIGN_ROOT=`git rev-parse --show-superproject-working-tree` DESIGN_ROOT=`git rev-parse --show-superproject-working-tree`
if [ -z $DESIGN_ROOT ]; then if [ -z $DESIGN_ROOT ]; then
# If not in a submodule # If not in a submodule - at root
DESIGN_ROOT=`git rev-parse --show-toplevel` DESIGN_ROOT=`git rev-parse --show-toplevel`
fi fi
fi
# Source Top-Level Sourceme
source $DESIGN_ROOT/set_env.sh
else
# Set Environment Variable for this Repository # Set Environment Variable for this Repository
export WRAP_ACC_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" export ACC_WRAPPER_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
# If this Repo is root of workspace # If this Repo is root of workspace
if [ $WRAP_ACC_DIR = $DESIGN_ROOT ]; then if [ $ACC_WRAPPER_DIR = $DESIGN_ROOT ]; then
echo "Design Workspace: $WRAP_ACC_DIR" echo "Design Workspace: $DESIGN_ROOT"
export $DESIGN_ROOT export DESIGN_ROOT
# Set Default Simulator
export SIMULATOR="ivlog"
fi fi
# Source environment variables for all submodules # Source environment variables for all submodules
for d in $WRAP_ACC_DIR/* ; do for d in $ACC_WRAPPER_DIR/* ; do
if [ -f "$d/.git" ]; then if [ -f "$d/.git" ]; then
if [ -f "$d/set_env.sh" ]; then if [ -f "$d/set_env.sh" ]; then
# If .git file exists - submodule # If .git file exists - submodule
...@@ -39,5 +44,7 @@ for d in $WRAP_ACC_DIR/* ; do ...@@ -39,5 +44,7 @@ for d in $WRAP_ACC_DIR/* ; do
fi fi
done done
# Add Flow directory to Path # Add Scripts to Path
export PATH="$PATH:/$WRAP_ACC_DIR/flow" export PATH="$PATH:/$ACC_WRAPPER_DIR/flow"
\ No newline at end of file fi
...@@ -11,25 +11,25 @@ ...@@ -11,25 +11,25 @@
#!/usr/bin/env bash #!/usr/bin/env bash
if [ -z "$WRAP_ACC_DIR" ]; then if [ -z "$ACC_WRAPPER_DIR" ]; then
# Set environment Variables for Repository # Set environment Variables for Repository
export WRAP_ACC_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" export ACC_WRAPPER_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
if [ -z "$SOC_ENV_SET" ]; then if [ -z "$SOC_ENV_SET" ]; then
# Add flow directory to Path # Add flow directory to Path
export PATH=$PATH:$WRAP_ACC_DIR/flow export PATH=$PATH:$ACC_WRAPPER_DIR/flow
# Set Default Simulator # Set Default Simulator
export SIMULATOR="ivlog" export SIMULATOR="ivlog"
# Set Top-level Directory # Set Top-level Directory
export SOC_TOP=$WRAP_ACC_DIR export SOC_TOP=$ACC_WRAPPER_DIR
# Set flag to say this is top level repo # Set flag to say this is top level repo
export SOC_ENV_SET="True" export SOC_ENV_SET="True"
# Source Top-level sourceme # Source Top-level sourceme
for d in $WRAP_ACC_DIR/../* ; do for d in $ACC_WRAPPER_DIR/../* ; do
if [ -d "$d" ]; then if [ -d "$d" ]; then
if test -f "$d/sourceme"; then if test -f "$d/sourceme"; then
source $d/sourceme source $d/sourceme
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment