Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SoCTools Flow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SoCLabs
SoCTools Flow
Commits
5a4de6fe
Commit
5a4de6fe
authored
1 year ago
by
dam1n19
Browse files
Options
Downloads
Patches
Plain Diff
Moved set_env script into soctools
parent
8ac6b154
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/project_setup.sh
+81
-0
81 additions, 0 deletions
bin/project_setup.sh
with
81 additions
and
0 deletions
bin/project_setup.sh
0 → 100755
+
81
−
0
View file @
5a4de6fe
#-----------------------------------------------------------------------------
# SoC Labs Environment Setup Script
# A joint work commissioned on behalf of SoC Labs, under Arm Academic Access license.
#
# Contributors
#
# David Mapstone (d.a.mapstone@soton.ac.uk)
#
# Copyright 2023, SoC Labs (www.soclabs.org)
#-----------------------------------------------------------------------------
#!/bin/bash
# Get Root Location of Design Structure
if
[
-z
$SOCLABS_DESIGN_ROOT
]
;
then
# If $SOCLABS_DESIGN_ROOT hasn't been set yet
SOCLABS_DESIGN_ROOT
=
`
git rev-parse
--show-superproject-working-tree
`
if
[
-z
$SOCLABS_DESIGN_ROOT
]
;
then
# If not in a submodule - at root
SOCLABS_DESIGN_ROOT
=
`
git rev-parse
--show-toplevel
`
fi
# Source Top-Level Sourceme
source
$SOCLABS_DESIGN_ROOT
/set_env.sh
else
# Set Environment Variable for Project Dir
SEARCH_DIR
=
`
pwd
`
while
true
do
if
[[
-f
$SEARCH_DIR
"/.slprojroot"
]]
;
then
export
SOCLABS_PROJECT_DIR
=
$SEARCH_DIR
break
else
SEARCH_DIR
=
$SEARCH_DIR
/..
fi
done
# If this Repo is root of workspace
if
[
$SOCLABS_PROJECT_DIR
=
$SOCLABS_DESIGN_ROOT
]
;
then
echo
"Design Workspace:
$SOCLABS_DESIGN_ROOT
"
export
SOCLABS_DESIGN_ROOT
fi
# Add in location for socsim scripts
export
SOCLABS_SOCSIM_PATH
=
$SOCLABS_PROJECT_DIR
/simulate/socsim
# Source dependency environment variable script
source
$SOCLABS_PROJECT_DIR
/env/dependency_env.sh
# Add Scripts to Path
# "TECH_DIR"
while
read
line
;
do
eval
PATH
=
"
$PATH
:
\$
${
line
}
/flow"
done
<<<
"
$(
awk
'BEGIN{for(v in ENVIRON) print v}'
|
grep
TECH_DIR
)
"
# "FLOW_DIR"
while
read
line
;
do
eval
PATH
=
"
$PATH
:
\$
${
line
}
/tools"
done
<<<
"
$(
awk
'BEGIN{for(v in ENVIRON) print v}'
|
grep
FLOW_DIR
)
"
# "SOCLABS_PROJECT_DIR"
while
read
line
;
do
eval
PATH
=
"
$PATH
:
\$
${
line
}
/flow"
done
<<<
"
$(
awk
'BEGIN{for(v in ENVIRON) print v}'
|
grep
SOCLABS_PROJECT_DIR
)
"
export
PATH
fi
# Check cloned repository has been initialised
if
[
!
-f
$SOCLABS_PROJECT_DIR
/.socinit
]
;
then
echo
"Running First Time Repository Initialisation"
# Source environment variables for all submodules
cd
$SOCLABS_DESIGN_ROOT
echo
$SOCLABS_DESIGN_ROOT
git submodule update
--recursive
python3
$SOCLABS_SOCTOOLS_FLOW_DIR
/bin/subrepo_checkout.py
-b
projbranch
-t
$SOCLABS_DESIGN_ROOT
git restore
$SOCLABS_DESIGN_ROOT
/.gitmodules
touch
$SOCLABS_PROJECT_DIR
/.socinit
echo
"SoC Labs File Initialisation file: This file has been created to show that the project has been initialised"
>
$SOCLABS_PROJECT_DIR
/.socinit
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment