mirror of https://github.com/lnis-uofu/SOFA.git
[Action] Integrated MPW prechecker
This commit is contained in:
parent
40c131983a
commit
10cab93799
|
@ -53,11 +53,16 @@ jobs:
|
||||||
path: open_mpw_precheck
|
path: open_mpw_precheck
|
||||||
|
|
||||||
- name: Perform checks with open_mpw_precheck
|
- name: Perform checks with open_mpw_precheck
|
||||||
uses: addnab/docker-run-action@v1
|
uses: ganeshgore/docker-run-action@1cd63ec
|
||||||
with:
|
with:
|
||||||
image: goreganesh/open_mpw_prechecker
|
image: goreganesh/open_mpw_prechecker
|
||||||
options: -v ${{github.workspace}}:/usr/local/workspace -w /usr/local/workspace
|
options: >
|
||||||
run: bash ./SOFA-Chips/.github/workflows/perform_precheck.sh
|
-v ${{github.workspace}}/open_mpw_precheck:/usr/local/bin
|
||||||
|
-v ${{github.workspace}}:/usr/local/workspace
|
||||||
|
-e DEST_DIR=$DEST_DIR
|
||||||
|
-e SCAN_DIRECTORY=$SCAN_DIRECTORY
|
||||||
|
--workdir /usr/local/workspace
|
||||||
|
run: pwd && cd /usr/local/workspace && ls && bash ./SOFA-Chips/.github/workflows/perform_precheck.sh
|
||||||
|
|
||||||
- name: Deploy files
|
- name: Deploy files
|
||||||
run: bash ./SOFA-Chips/.github/workflows/sync_repo.sh
|
run: bash ./SOFA-Chips/.github/workflows/sync_repo.sh
|
||||||
|
|
|
@ -16,6 +16,7 @@ on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- '.github/**'
|
- '.github/**'
|
||||||
|
- 'SynRepoConfig/**'
|
||||||
- '$SCAN_DIRECTORY'
|
- '$SCAN_DIRECTORY'
|
||||||
pull_request:
|
pull_request:
|
||||||
types: closed
|
types: closed
|
||||||
|
@ -41,11 +42,13 @@ jobs:
|
||||||
repository: efabless/open_mpw_precheck
|
repository: efabless/open_mpw_precheck
|
||||||
path: open_mpw_precheck
|
path: open_mpw_precheck
|
||||||
- name: Perform checks with open_mpw_precheck
|
- name: Perform checks with open_mpw_precheck
|
||||||
uses: addnab/docker-run-action@v1
|
uses: ganeshgore/docker-run-action@1cd63ec
|
||||||
with:
|
with:
|
||||||
image: goreganesh/open_mpw_prechecker
|
image: goreganesh/open_mpw_prechecker
|
||||||
options: -v ${{github.workspace}}:/usr/local/workspace -w /usr/local/workspace
|
options: >
|
||||||
run: bash ./SOFA-Chips/.github/workflows/perform_precheck.sh
|
-v ${{github.workspace}}/open_mpw_precheck:/usr/local/bin -v ${{github.workspace}}:/usr/local/workspace -e DEST_DIR=$DEST_DIR -e SCAN_DIRECTORY=$SCAN_DIRECTORY --workdir /usr/local/workspace
|
||||||
|
|
||||||
|
run: pwd && cd /usr/local/workspace && ls && bash ./SOFA-Chips/.github/workflows/perform_precheck.sh
|
||||||
- name: Deploy files
|
- name: Deploy files
|
||||||
run: bash ./SOFA-Chips/.github/workflows/sync_repo.sh
|
run: bash ./SOFA-Chips/.github/workflows/sync_repo.sh
|
||||||
- name: Deploy Changes
|
- name: Deploy Changes
|
||||||
|
|
|
@ -4,16 +4,41 @@
|
||||||
# Original repo is places ../SOFA-Chips
|
# Original repo is places ../SOFA-Chips
|
||||||
# for conditional file copy use PROJ_SUFFIX (example SOFA_HD)
|
# for conditional file copy use PROJ_SUFFIX (example SOFA_HD)
|
||||||
|
|
||||||
echo "============================================="
|
printenv
|
||||||
echo " Not Implemented yet "
|
|
||||||
echo "============================================="
|
|
||||||
pwd
|
|
||||||
ls
|
|
||||||
ls */*
|
|
||||||
|
|
||||||
# MAGTYPE=mag magic -rcfile ${PDK_ROOT}/sky130A/libs.tech/magic/current/sky130A.magicrc -noc -dnull merge.tcl
|
cd ./${DEST_DIR}
|
||||||
|
echo "Running in directory ${pwd}"
|
||||||
|
|
||||||
|
cp ../SOFA-Chips/${SCAN_DIRECTORY}/fpga_top_icv_in_design.gds.gz ./gds/
|
||||||
|
make uncompress
|
||||||
|
echo "[Info] All files are uncompressed"
|
||||||
|
|
||||||
# use fpga_top fpga_top_uut
|
# = = = = = = = = = = = = Modify Merge Scripts = = = = = = = = = = = = = = = =
|
||||||
# transform 1 0 0 0 1 0
|
AddLine="use fpga_top fpga_top_uut\n"\
|
||||||
# box 0 0 2500 3000
|
"transform 1 0 0 0 1 0\n"\
|
||||||
|
"box 0 0 2500 3000"
|
||||||
|
sed -i "s/<< properties >>/${AddLine}\n<< properties >>/" ./mag/user_project_wrapper.mag
|
||||||
|
# Running magic to merge fpga_top
|
||||||
|
MAGTYPE=mag \
|
||||||
|
magic -rcfile ${PDK_ROOT}/sky130A/libs.tech/magic/current/sky130A.magicrc \
|
||||||
|
-noconsole -dnull \
|
||||||
|
../SOFA-Chips/SCRIPT/merge_fpga_top.tcl </dev/null | tee magic_drc.log
|
||||||
|
echo "[Info] merge fpga-top"
|
||||||
|
|
||||||
|
# = = = = = = = = = = = = = Build Caravel = = = = = = = = = = = = = = = = = = =
|
||||||
|
make ship
|
||||||
|
echo "[Info] Finished shiping chip"
|
||||||
|
rm -f gds/caravel.old.gds
|
||||||
|
|
||||||
|
# = = = = = = = = = = = = = Perform Open MPW Checks = = = = = = = = = = = = = =
|
||||||
|
python3 /usr/local/bin/open_mpw_prechecker.py \
|
||||||
|
--target_path /usr/local/workspace/${DEST_DIR} \
|
||||||
|
--pdk_root $PDK_ROOT
|
||||||
|
echo "[Info] Finished MPW Prechecker"
|
||||||
|
|
||||||
|
# = = = = = = = Convert DRC Errors to RDB = = = = = = = = = = = = = = = = = = =
|
||||||
|
if test -f "./checks/caravel.magic.drc"; then
|
||||||
|
python3 ../SOFA-Chips/SCRIPT/magic_drc_to_rdb.py \
|
||||||
|
-magic_drc_in ./checks/caravel.magic.drc
|
||||||
|
-rdb_out ./checks/caravel.magic.rdb
|
||||||
|
fi
|
|
@ -0,0 +1,62 @@
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import re
|
||||||
|
import shutil
|
||||||
|
import argparse
|
||||||
|
import math
|
||||||
|
|
||||||
|
|
||||||
|
def formatter(prog): return argparse.HelpFormatter(prog, max_help_position=60)
|
||||||
|
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(formatter_class=formatter)
|
||||||
|
|
||||||
|
# Mandatory arguments
|
||||||
|
parser.add_argument('--magic_drc_in', type=str, default="./checks/caravel.magic.drc")
|
||||||
|
parser.add_argument('--rdb_out', type=str, default="./checks/caravel.magic.rdb")
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
data, drc = True, False
|
||||||
|
def main():
|
||||||
|
try:
|
||||||
|
fp = open(args.magic_drc_in)
|
||||||
|
lineType = data
|
||||||
|
drcRule = ""
|
||||||
|
with open(args.rdb_out,"w") as fpw:
|
||||||
|
for line in fp.readlines():
|
||||||
|
if ("[INFO]" in line) or (len(line.strip())==0):
|
||||||
|
continue
|
||||||
|
elif ("caravel" in line):
|
||||||
|
fpw.write("caravel 100\n")
|
||||||
|
elif "------" in line:
|
||||||
|
lineType = not lineType
|
||||||
|
elif (lineType==drc):
|
||||||
|
drcRule = line.strip().split("(")
|
||||||
|
drcRule = [drcRule,"UnknownRule"] if len(drcRule) <2 else drcRule
|
||||||
|
fpw.write(f"r_0_{drcRule[1][:-1]}\n")
|
||||||
|
fpw.write(f"500 500 2 Nov 29 03:26:39 2020\n")
|
||||||
|
fpw.write(f"Rule File Pathname: {args.magic_drc_in}\n")
|
||||||
|
fpw.write(f"{drcRule[1][:-1]}: {drcRule[0]}\n")
|
||||||
|
drcNumber = 1
|
||||||
|
elif (lineType==data):
|
||||||
|
cord = [int(float(i))*100 for i in line.strip().split(" ")]
|
||||||
|
fpw.write(f"p {drcNumber} 4\n")
|
||||||
|
fpw.write(f"{cord[0]} {cord[1]}\n")
|
||||||
|
fpw.write(f"{cord[2]} {cord[1]}\n")
|
||||||
|
fpw.write(f"{cord[2]} {cord[3]}\n")
|
||||||
|
fpw.write(f"{cord[0]} {cord[3]}\n")
|
||||||
|
drcNumber+=1
|
||||||
|
print(f"Generated RDB at {args.rdb_out}")
|
||||||
|
|
||||||
|
|
||||||
|
except IOError:
|
||||||
|
print("Magic DRC Error file not found {args.magic_drc_in}")
|
||||||
|
except:
|
||||||
|
print("Failed to generate RDB file")
|
||||||
|
finally:
|
||||||
|
fp.close()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
|
@ -0,0 +1,14 @@
|
||||||
|
drc off
|
||||||
|
gds readonly true
|
||||||
|
gds rescale false
|
||||||
|
gds merge yes
|
||||||
|
|
||||||
|
gds read ./gds/fpga_top_icv_in_design.gds
|
||||||
|
load ./mag/user_project_wrapper.mag
|
||||||
|
|
||||||
|
save user_project_wrapper
|
||||||
|
|
||||||
|
select top cell
|
||||||
|
gds write ./gds/user_project_wrapper.gds
|
||||||
|
|
||||||
|
exit
|
Loading…
Reference in New Issue