Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d4a1fb1
Add notification
mkosunen Apr 20, 2025
0af0d24
Add interface and example control/do-file or Cadence Xcelium
Jul 18, 2025
86edf38
Add Xcelium support to common rtl files
Jul 18, 2025
079c0e8
Remove unused variable
Jul 18, 2025
53d318a
Add LSF submission string infront of rtlcmd when running in non inter…
Aug 5, 2025
38566c5
Add master project update to CI
mkosunen Aug 23, 2025
d9cfce0
Partially generalize submodule path in CI
mkosunen Aug 23, 2025
01c4f83
Add pre-commit hooks
mkosunen Sep 4, 2025
af5fd84
Reformat pythonfiles with black -l 80
mkosunen Sep 4, 2025
f062d6a
Bugfix: set default sim opts as empty list
Roenski Oct 29, 2025
c25cdbc
Add vlogsimargs to xcelium command
Roenski Oct 29, 2025
3cace98
Reformat .py files also from docs
mkosunen Dec 23, 2025
6c39811
Set default sim_opt_dicts as empty arrays
Roenski May 27, 2026
4d509ba
Add vlogsimargs and vlogcompargs to the simulation command
Roenski May 27, 2026
4382f3c
Stuff
Roenski Jun 11, 2026
749446c
Revert "Stuff"
Roenski Jun 11, 2026
725bc6b
Parallelize init_submodules.sh
mkosunen Jun 12, 2026
cce7d40
Merge branch 'ak/verilator-args' into v1.14_RC
mkosunen Jun 12, 2026
ea51afe
Fix icarus backend when vloglibfilemodules is provided
Jun 16, 2026
07dd765
Merge remote-tracking branch 'origin/v1.14_RC' into xcelium-dev
Aug 5, 2026
9774a79
Merge pull request #107 from TheSystemDevelopmentKit/xcelium-dev
chiplet Aug 5, 2026
3214635
Fix rogue Questa simulations left behind by Ctrl+C
Aug 5, 2026
05a3893
Merge pull request #112 from TheSystemDevelopmentKit/dev/vhirvone/fix…
chiplet Aug 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Get a list of all Python files that are staged for commit
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep '\.py$' | xargs)
CMD="black -l 80"

# If there are Python files staged for commit, run black on them
if [ -n "$STAGED_FILES" ]; then
echo "Running black on staged Python files..."

# Run black in check mode (it won't modify files, just checks for formatting issues)
$CMD --check -q $STAGED_FILES

# If black returns a non-zero exit code (i.e., files aren't formatted correctly), exit with an error
if [ "$?" != "0" ]; then
echo "ERROR: Some Python files are not formatted correctly. Please run 'black'"
echo "To check:"
echo " $CMD --check --diff --color ${STAGED_FILES}"
echo "To correct:"
echo " $CMD ${STAGED_FILES}"
exit 1
fi
fi

exit 0

74 changes: 74 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
on:
push:
branches:
- master
- v1.14_RC

jobs:
#doc_build_job:
# runs-on: ubuntu-latest
# # This project MUST be given permission to use the image blow. at
# # Package settings-> Manage action access of the project hosting the
# # package
# container: 'ghcr.io/thesystemdevelopmentkit/thesdktestimage:latest'
# name: Build documentation
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Documentation builder action
# run: ./CI-helpers/build_docs.sh -c -t ${{ secrets.THESYDEKICK_TOKEN }}

thesdk_update_job:
runs-on: ubuntu-latest
# This project MUST be given permission to use the image blow. at
# Package settings-> Manage action access of the project hosting the
# package
container: 'ghcr.io/thesystemdevelopmentkit/thesdktestimage:latest'
name: Update and test submodules
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Test and release action
id: tests
run: ./CI-helpers/thesdk-template-update.sh -r"Entities/${GITHUB_WORKSPACE##*/}" -c -b ${GITHUB_REF##*/} -w ${GITHUB_WORKSPACE} -t ${{ secrets.THESYDEKICK_TOKEN }}
- name: Variable definition
if: steps.tests.outcome =='success'
run: |
MESSAGE_TEXT="Update on $GITHUB_REPOSITORY \n
Branch: ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} \n
Commit message: \n
${{ github.event.head_commit.message }} "
echo "MESSAGE<<EOF" >> $GITHUB_ENV
# here we can place the command that will generate multi-line text
echo $MESSAGE_TEXT >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Notification
if: steps.tests.outcome =='success'
run: >
curl -X POST --data-urlencode type=stream
--data-urlencode "content=${{ env.MESSAGE }}"
--data-urlencode 'to="Update notifications"'
--data-urlencode "topic=${{ github.event.repository.name }}"
${{ secrets.ZULIPWEBHOOK }} || exit 1

## This is an example how to run a image pull if needed.
# image_pull:
# runs-on: ubuntu-latest
# name: Pull docker image
# steps:
# - name: Login to Github Packages
# uses: docker/login-action@v1
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN}}
#
# - name: Pull image
# uses: docker/login-action@v1
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN}}
# - name: Pull Docker image
# run: docker pull 'ghcr.io/thesystemdevelopmentkit/thesdktestimage:latest'

218 changes: 218 additions & 0 deletions CI-helpers/thesdk-template-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
#!/usr/bin/env bash
#############################################################################
# Update TheSyDeKick thesdk_template with submodule push
# Intended operation: When pushed to the latest release-candidate branch
# Module is automatically updated in thesdk_template and the operation
# is tested by running the inverter selftest (probably other tests in the future)
# If the tests are passed, the resulting updated thesdk_template module is pushed to
# the latest development branch.
#
# Written by Marko Kosunen, marko.kosunen@aalto.fi, 18.9.2022
#############################################################################

help_f()
{
cat << EOF
test_and_release Release 1.0 (18.09.2022)
For testing and releasing TheSyDeKick releases
Written by Marko Pikkis Kosunen

SYNOPSIS
test_and_release.sh [OPTIONS]
DESCRIPTION
Defines and runs tests for the submodules of thesdk_template

OPTIONS
-b
Branch of thesdk_template to operate on
Commit and push to that branch after testing.

-c Run in CI/CD with this option

-t
STRING : Access token
-r
STRING : Relative path from main project root
-h
Show this help.
EOF
}


# Token we use for push is given as the first argument
CICD="0"
TOKEN=""
BRANCH=""
while getopts b:ct:r:w:h opt
do
case "$opt" in
b) BRANCH="$OPTARG";;
c) CICD="1";;
t) TOKEN="$OPTARG";;
r) RELATIVEPATH="$OPTARG";;
w) WORKSPACE="$OPTARG";;
h) help_f; exit 0;;
\?) help_f;;
esac
done

#NAME="$(git remote -v | sed -n '/fetch/p' | sed -n 's/\(^.*[://]\)\(.*\)\(\.git.*$\)/\2/p')"
#echo "${WORKSPACE}"
#NAME="thesdk"
if [ ${CICD} == "1" ]; then
git config --global user.name "ecdbot"
git config --global user.email "${GITHUB_ACTOR}@noreply.github.com"
git config --global --add safe.directory ${WORKSPACE}
fi

if [ -z "${BRANCH}" ]; then
echo "Branch not given"
exit 1
fi

if [ -z "$TOKEN" ] && [ ${CICD} == "1" ]; then
echo "Token must be provided for CI/CD"
exit 1
fi

PID="$$"
#Get the current hash
HASH="$(git rev-parse --verify HEAD)"
if [ -z "${HASH}" ]; then
echo "Error in getting current commit hash"
exit 1
fi

MESSAGE="$(git log -1 --pretty=%B | head -n 1)"
WORKDIR="$(pwd)"

#Submodule can not know where it is and how it is called
UNDERDEVEL_CANDIDATE="$RELATIVEPATH"
if [ ${CICD} == "1" ]; then
git clone https://x-access-token:${TOKEN}@github.com/TheSystemDevelopmentKit/thesdk_template.git ./thesdk_template_${PID}
else
git clone git@github.com:TheSystemDevelopmentKit/thesdk_template.git ./thesdk_template_${PID}
fi
cd ./thesdk_template_${PID}
TEMPLATEDIR="$(pwd)"

# Operate on given branch of thesdk_template
git checkout "$BRANCH" 2> /dev/null
if [ "$?" == "0" ]; then
echo "Updating ${BRANCH} of thesdk_template"
git pull
else
echo "Branch ${BRANCH} not exist in thesdk_template. Update request rejected."
cd ${WORKDIR} && rm -rf ./thesdk_template_${PID}
exit 1
fi


#git config --global --add safe.directory /__w/thesdk_template/thesdk_template

PYTHONPATH="$(pwd)/Entities"
export PYTHONPATH

# For local pip-installations to follow the dependencies of the main program
mkdir -p ${HOME}/.local/bin
PATH="${PATH}:${HOME}./local:${HOME}/.local/bin"

# Normal workflow
./configure
# change ssh submodule urls to git
if [ "$CICD" == "1" ]; then
find ./ -name .gitmodules -exec sed -i 's#\(url = \)\(git@\)\(.*\)\(:\)\(.*$\)#\1https://\3/\5#g' {} \;
fi
#Init the submodules as user would
#Currently fails on ssh cloned subsubmodules
#Must initialize other means
if [ "$CICD" == "1" ]; then
git submodule update --init
find ./ -name .gitmodules -exec sed -i 's#\(url = \)\(git@\)\(.*\)\(:\)\(.*$\)#\1https://\3/\5#g' {} \;
git submodule update --init --recursive
find ./ -name .gitmodules -exec sed -i 's#\(url = \)\(git@\)\(.*\)\(:\)\(.*$\)#\1https://\3/\5#g' {} \;
else
${TEMPLATEDIR}/init_submodules.sh
fi


# Test the dependency installation
# These are already in the buildimage
#./pip3userinstall.sh

SUBMODULES="$(sed -n '/\[submodule/p' .gitmodules | sed -n 's/.* \"\(.*\)\"]/\1/p' | grep "$UNDERDEVEL_CANDIDATE")"
if [ -z "$SUBMODULES" ]; then
echo "Submodule $UNDERDEVEL_CANDIDATE not found"
exit 1
else
echo "Submodule $UNDERDEVEL_CANDIDATE found, proceeding."
fi

cd "${TEMPLATEDIR}/${UNDERDEVEL_CANDIDATE}"
echo "In ${TEMPLATEDIR}/${UNDERDEVEL_CANDIDATE}):"
CURRENT="$(git rev-parse HEAD)"
git checkout ${HASH} 2> /dev/null
if [ "$?" == "0" ]; then
if [ "${CURRENT}" != "${HASH}" ]; then
UNDERDEVEL="${UNDERDEVEL_CANDIDATE}"
else
echo "Submodule ${UNDERDEVEL_CANDIDATE} already up to date. No need for update"
exit 0
fi
else
echo "Commit ${HASH} does not exist for submodule ${UNDERDEVEL_CANDIDATE}. No changes made."
exit 0
fi

echo "Changing to ${TEMPLATEDIR}."

cd ${TEMPLATEDIR}

# Let's perform the test(s)
cd ${TEMPLATEDIR}/doc && git remote -v | grep \(fetch\) | sed -n 's#\(.*[://]\)\(.*\)\(\.git.*$\)#\2#p'& make html
DOCSTAT=$?
DOCSTAT="0"

for entity in inverter myentity inverter_tests; do
cd ${TEMPLATEDIR}/Entities/${entity} && ./configure && make sim
SIMSTAT=$?
if [ "$SIMSTAT" != "0" ] \
|| [ "$DOCSTAT" != "0" ]; then
STATUS="1"
echo "Tests failed in ${entity}"
exit 1
else
STATUS="0"
echo "Tests OK in ${entity}, proceeding"
fi
done

# This is copy of the structure used in thesdk_template.
# Works for all entities
if [ "$STATUS" == "0" ]; then
cd ${TEMPLATEDIR}
for entity in ${UNDERDEVEL}; do
echo "Staging $entity"
git add ${entity}
done

echo "Committing changes"
MSG=""
COMMITMESSAGE="$(
cat << EOF
Auto update entities

$(for entity in ${UNDERDEVEL}; do
echo $entity
done)
EOF
)"
echo "$COMMITMESSAGE"
git commit -m"$COMMITMESSAGE"
git push
STATUS=$?
fi

cd ${WORKDIR} && rm -rf ./thesdk_template_${PID}
exit $STATUS

Loading
Loading