Skip to content
Snippets Groups Projects
Commit 78e5c225 authored by dam1n19's avatar dam1n19
Browse files

SOC1-169: Added basic cleaning functionality to socsim

parent 550534f9
No related branches found
No related tags found
No related merge requests found
...@@ -6,19 +6,42 @@ ...@@ -6,19 +6,42 @@
# #
# David Mapstone (d.a.mapstone@soton.ac.uk) # David Mapstone (d.a.mapstone@soton.ac.uk)
# #
# Copyright 2022, SoC Labs (www.soclabs.org) # Copyright 2023, SoC Labs (www.soclabs.org)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
#!/usr/bin/env bash #!/usr/bin/env bash
DEFAULT_SIMULATOR="ivlog" # Check arguments passed to SoCSim
if [[ -z "${SIMULATOR}" ]]; then if [ $# -eq 0 ]
SIMULATOR=$DEFAULT_SIMULATOR then
fi echo "No arguments supplied"
# $PROJECT_DIR"/flow/simulators/"$SIMULATOR"_sim.sh" $@ else
# Find a simulation script in the SoCSim environments of all subrepos # If clean command passed in clean a specific directory or all
simscript=$(find ${SOCSIM_PATH//:/\ } -name "${1}.sh") if [ ${1} == "clean" ]; then
if [ $# -eq 1 ]; then
echo "No clean arguments supplied"
else
if [ ${2} == "all" ]; then
# Clean all simualation directories
echo "Cleaning all Project Simulation Directories"
rm -rf $PROJECT_DIR/simulate/sim
mkdir -p $PROJECT_DIR/simulate/sim
else
# Remove specific simulaiton directory
SIM_DIR=$PROJECT_DIR/simulate/sim/${2}
if [ -d "$SIM_DIR" ]; then
rm -rf $SIM_DIR
else
echo "Simulation Directory '${2}' doesn't exist"
fi
fi
fi
fi
# Run Script if Found # Find a simulation script in the SoCSim environments of all subrepos
$simscript $@ simscript=$(find ${SOCSIM_PATH//:/\ } -name "${1}.sh")
\ No newline at end of file
# Run Script if Found
$simscript $@
fi
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment