Skip to content

Commit 69b2d3f

Browse files
authored
Merge pull request #107 from d-m-bailey/enhanced-oeb
Enhanced oeb checks for caravel/caravan/openframe
2 parents 6520dca + e73b067 commit 69b2d3f

13 files changed

Lines changed: 672 additions & 126 deletions

File tree

.github/workflows/precheck_test.yml

Lines changed: 54 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,30 @@ jobs:
2222
fail-fast: false
2323

2424
steps:
25+
- name: Checkout current repo
26+
uses: actions/checkout@v4
27+
2528
- name: Checkout mpw_precheck
2629
uses: actions/checkout@v4
2730
with:
2831
repository: chipfoundry/mpw_precheck
2932
path: mpw_precheck
3033

3134
- name: Checkout ${{ matrix.repo }}
35+
if: matrix.repo != 'openframe_user_project'
3236
uses: actions/checkout@v4
3337
with:
3438
repository: chipfoundry/${{ matrix.repo }}
3539
path: ${{ matrix.repo }}
3640

41+
- name: Checkout ${{ matrix.repo }} using development branch to pass OEB check
42+
if: matrix.repo == 'openframe_user_project'
43+
uses: actions/checkout@v4
44+
with:
45+
repository: d-m-bailey/openframe_user_project-cf
46+
path: ${{ matrix.repo }}
47+
ref: CF_gpio_config
48+
3749
- name: Set up Docker Buildx
3850
uses: docker/setup-buildx-action@v2
3951

@@ -53,8 +65,8 @@ jobs:
5365
--cache-to=type=local,dest=/tmp/.buildx-cache-new,mode=max \
5466
--output type=docker \
5567
--tag mpw_precheck:latest \
56-
mpw_precheck/dependencies
57-
timeout-minutes: 30
68+
${{ github.workspace }}/dependencies
69+
timeout-minutes: 45
5870

5971
- name: Move cache
6072
run: |
@@ -66,13 +78,34 @@ jobs:
6678
uses: actions/cache@v4
6779
with:
6880
path: ${{ github.workspace }}/pdk
69-
key: ${{ runner.os }}-pdk-${{ hashFiles('**/volare.toml') }}
81+
key: ${{ runner.os }}-pdk-${{ hashFiles('**/ciel.toml') }}
82+
83+
- name: Temporarily update caravan gpio definitions to pass OEB check
84+
if: matrix.repo == 'caravel_user_project_analog'
85+
run: |
86+
gawk -i inplace '\
87+
/USER_CONFIG_GPIO_11_/ {sub(/INVALID/, "USER_STD_OUTPUT"); print; next} \
88+
/USER_CONFIG_GPIO_12_/ {sub(/INVALID/, "USER_STD_OUTPUT"); print; next} \
89+
/USER_CONFIG_GPIO_26_/ {sub(/INVALID/, "USER_STD_OUTPUT"); print; next} \
90+
/USER_CONFIG_GPIO_27_/ {sub(/INVALID/, "USER_STD_OUTPUT"); print; next} \
91+
{sub(/INVALID/, "MGMT_STD_ANALOG"); print}' caravel_user_project_analog/verilog/rtl/user_defines.v
92+
cat caravel_user_project_analog/verilog/rtl/user_defines.v
93+
94+
- name: Temporarily update caravel gpio definitions to pass OEB check
95+
if: matrix.repo == 'caravel_user_project'
96+
run: |
97+
gawk -i inplace '\
98+
/USER_CONFIG_GPIO_[567]_/ {sub(/INVALID/, "USER_STD_OUTPUT"); print; next} \
99+
/USER_CONFIG_GPIO_3._/ {sub(/INVALID/, "USER_STD_OUTPUT"); print; next} \
100+
{sub(/INVALID/, "MGMT_STD_ANALOG"); print}' caravel_user_project/verilog/rtl/user_defines.v
101+
cat caravel_user_project/verilog/rtl/user_defines.v
70102
71-
- name: Install Volare and PDK
103+
- name: Install ciel and PDK
72104
if: steps.cache-pdk.outputs.cache-hit != 'true'
73105
run: |
74-
python3 -m pip install --upgrade --no-cache-dir volare
75-
volare enable 6d4d11780c40b20ee63cc98e645307a9bf2b2ab8 --pdk-root ${{ github.workspace }}/pdk
106+
python3 -m pip install --upgrade --no-cache-dir ciel
107+
export CIEL_DATA_SOURCE=static-web:https://chipfoundry.github.io/ciel-releases
108+
ciel enable 3e0e31dcce8519a7dbb82590346db16d91b7244f --pdk-root ${{ github.workspace }}/pdk --pdk sky130A
76109
env:
77110
PDK_ROOT: ${{ github.workspace }}/pdk
78111

@@ -88,16 +121,24 @@ jobs:
88121
SKIP_ARGS="--skip-checks ${{ matrix.skip_checks }}"
89122
fi
90123
91-
docker run \
124+
docker run --rm \
92125
-v "$INPUT_DIR":"$INPUT_DIR" \
93126
-v "$PDK_ROOT":"$PDK_ROOT" \
127+
-v ${{ github.workspace }}:/work/cf-precheck \
128+
-e PDK_ROOT="$PDK_ROOT" \
129+
-e PDK_PATH="$PDK_PATH" \
130+
-e PDKPATH="$PDK_PATH" \
131+
-e PYTHONPATH=/work/cf-precheck/src \
94132
mpw_precheck:latest \
95-
cf-precheck \
96-
-i "$INPUT_DIR" \
97-
-p "$PDK_PATH" \
98-
-c /opt/caravel \
99-
-o "$OUTPUT_DIR" \
100-
$SKIP_ARGS
133+
bash -lc "
134+
python3 -c \"import cf_precheck; print(cf_precheck.__file__)\"
135+
python3 -m cf_precheck \
136+
-i \"$INPUT_DIR\" \
137+
-p \"$PDK_PATH\" \
138+
-c /opt/caravel \
139+
-o \"$OUTPUT_DIR\" \
140+
$SKIP_ARGS
141+
"
101142
102143
- name: Upload Precheck results
103144
uses: actions/upload-artifact@v4

dependencies/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ FROM rockylinux:9.3 as build
2222
RUN dnf -y update
2323
RUN dnf -y groupinstall "Development Tools"
2424

25-
RUN dnf -y install cairo-devel csh gperf && \
25+
RUN dnf -y install cairo-devel csh gperf libcurl-devel expat-devel zlib-devel && \
2626
dnf -y install mesa-libGLU mesa-libGLU-devel ncurses-devel python3-devel python3-tkinter && \
2727
dnf -y install readline-devel tcl-devel time.x86_64 tk tk-devel wget Xvfb && \
2828
dnf -y --enablerepo=crb install epel-release nasm && \
@@ -67,7 +67,7 @@ RUN ./configure --prefix=/build && make -j4 && make install
6767
# Clone cvc
6868
RUN dnf -y --enablerepo=crb install libstdc++-static
6969
ENV CVC_ROOT=./cvc_rv
70-
RUN git clone --depth=1 --branch v1.1.5 https://github.com/d-m-bailey/cvc.git ${CVC_ROOT}
70+
RUN git clone --depth=1 --branch v1.1.7 https://github.com/d-m-bailey/cvc.git ${CVC_ROOT}
7171
WORKDIR $CVC_ROOT
7272
RUN autoreconf -vif && ./configure --disable-nls --prefix=/build && sed -i 's/api.parser.class/parser_class_name/' src/cdlParser.yy && make -j4 && make install
7373

src/cf_precheck/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.1.0"
1+
__version__ = "1.2.0"

src/cf_precheck/be_checks/README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,11 @@ Optional variable lists: `*` may be used as a wild card character.
147147
- If the log file shows errors, look for details in the error file.
148148
- Error device locations can be found in the respective `precheck_results/<tag>/tmp/ext/*.ext` files. (coordinates should be divided by 200).
149149

150-
5. OEB check. Check for user oeb signal output to gpio cells.
151-
The following conditions are errors.
152-
- gpio with both digital (io_in/io_out) and analog (analog_io/gpio_analog) connections
153-
- gpio with analog (analog_io/gpio_analog) and oeb not high
154-
- gpio with only input (io_in) but oeb not high
155-
- gpio with output (io_out) but oeb never low
156-
The following condition is a warning.
157-
- gpio with both input (io_in) and output (io_out) and oeb always low
150+
5. OEB check. Check user connections to gpio against configuration.
151+
See [Chipfoundry gpio configuration checks](https://docs.google.com/spreadsheets/d/1nYYAiqxi1V9ZBvW9GzFHaRDODuWXLOA9Znsbq4re1Ek/edit?usp=sharing) for a table of ERRORS and warnings.
158152

159153
Output:
160-
- `precheck_results/<tag>/tmp/ext/<top_layout>.cdl.gz`: CDL file converted from extracted spice file.
161-
- `precheck_results/<tag>/tmp/cvc.oeb.error.gz`: Detailed errors results.
154+
- `precheck_results/<tag>/tmp_oeb/<top_layout>.cdl.gz`: CDL file converted from extracted spice file.
155+
- `precheck_results/<tag>/tmp_oeb/cvc.oeb.error.gz`: Detailed errors results.
162156
- `precheck_results/<tag>/logs/cvc.oeb.log`: Log file with error summary.
163157
- `precheck_results/<tag>/outputs/reports/cvc.oeb.report`: List of each gpio, connection counts, and errors

src/cf_precheck/be_checks/run_be_checks

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ SKIP_OEB=no
3232
while [[ "$1" == "--"* ]]; do
3333
if [[ "$1" == "--noextract" ]]; then
3434
export EXTRACT_LAYOUT=no
35+
extract_option="--noextract"
3536
shift
3637
elif [[ "$1" == "--nooeb" ]]; then
3738
SKIP_OEB=yes
@@ -106,15 +107,17 @@ start_time=$SECONDS
106107
$LVS_ROOT/run_hier_check $TOP_SOURCE "$(echo $LVS_VERILOG_FILES | sed 's/#[^ ]*//g')" $TOP_LAYOUT $LAYOUT_FILE "${PDK%?}_([^/_]*_)*_"
107108
hier_status=$?
108109

109-
if [[ $EXTRACT_LAYOUT == yes ]]; then
110-
$LVS_ROOT/run_scheck
110+
# Default is to not run softcheck - only run softcheck if RUN_SOFTCHECK is set to 1.
111+
# If softcheck is run, subsequent extractions are not needed.
112+
if [[ "$RUN_SOFTCHECK" == 1 ]]; then
113+
$LVS_ROOT/run_scheck $extract_option
111114
scheck_status=$?
115+
extract_option="--noextract"
112116
else
113-
$LVS_ROOT/run_scheck --noextract
114-
scheck_status=$?
117+
scheck_status=""
115118
fi
116119

117-
$LVS_ROOT/run_full_lvs --noextract
120+
$LVS_ROOT/run_full_lvs $extract_option
118121
lvs_status=$?
119122

120123
if [[ -f $LVS_ROOT/tech/$PDK/cvc.power.$TOP_SOURCE || -f ${CONFIG_FILE%/*}/cvc.power.$TOP_SOURCE ]]; then
@@ -130,15 +133,17 @@ if [[ $TOP_SOURCE == *user_*project* && $SKIP_OEB == no ]]; then
130133
oeb_status=$?
131134
fi
132135

133-
echo "
136+
if [[ -f $LOG_ROOT/soft.log ]]; then
137+
echo "
134138
Soft check result:"
135-
tail -n 20 $LOG_ROOT/soft.log | awk '/Final result/,/Logging/' | grep -v ^Logging
136-
if [[ $scheck_status -ne 0 ]]; then
137-
echo "Soft check problem: check the following files
139+
tail -n 20 $LOG_ROOT/soft.log | awk '/Final result/,/Logging/' | grep -v ^Logging
140+
if [[ $scheck_status -ne 0 ]]; then
141+
echo "Soft check problem: check the following files
138142
$LOG_ROOT/ext.log
139143
$LOG_ROOT/nowell.ext.log
140144
$LOG_ROOT/soft.log
141145
$SIGNOFF_ROOT/soft.report"
146+
fi
142147
fi
143148

144149
echo "
@@ -172,23 +177,19 @@ printf "\nRuntime: %d:%02d:%02d (hh:mm:ss)\n" $hours $minutes $seconds
172177

173178
# If any of the checks had an error, set return code.
174179
# NOTE: ignores hierarchy check errors
175-
# NOTE: cvc_status and oeb_status ignored if not run
176-
if [[ $scheck_status -eq 0 && $lvs_status -eq 0 && ${cvc_status:=0} -eq 0 && ${oeb_status:=0} -eq 0 ]]; then
180+
# NOTE: scheck_status, cvc_status and oeb_status ignored if not run
181+
if [[ ${scheck_status:-0} -eq 0 && $lvs_status -eq 0 && ${cvc_status:-0} -eq 0 && ${oeb_status:-0} -eq 0 ]]; then
177182
echo "
178183
No errors detected"
179184
exit 0
180185

181-
elif [[ $scheck_status -eq 0 && $lvs_status -eq 0 && ${cvc_status:=0} -eq 4 && ${oeb_status:=0} -eq 0 ]]; then
186+
elif [[ ${scheck_status:-0} -eq 0 && $lvs_status -eq 0 && ${cvc_status:-0} -ne 0 && ${oeb_status:-0} -eq 0 ]]; then
182187
echo "
183188
WARNING: possible errors CVC $cvc_status"
184189
exit 4
185190

186-
elif [[ $SKIP_OEB == no ]]; then
187-
echo "
188-
WARNING: possible errors SOFT $scheck_status LVS $lvs_status CVC $cvc_status OEB $oeb_status"
189-
exit 1
190191
else
191192
echo "
192-
WARNING: possible errors SOFT $scheck_status LVS $lvs_status CVC $cvc_status"
193+
WARNING: possible errors SOFT ${scheck_status:--} LVS $lvs_status CVC ${cvc_status:--} OEB ${oeb_status:--}"
193194
exit 1
194195
fi

src/cf_precheck/be_checks/run_extract

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,32 @@ fi
6565
echo "LOG FILE: $LOG_ROOT/${LOG_FILE:=ext.log}"
6666
rm -f $LOG_ROOT/$LOG_FILE $WORK_ROOT/$LOG_FILE
6767

68-
if cmp -s $PDK_ROOT/$PDK/libs.tech/magic/$PDK.tech $LVS_ROOT/tech/$PDK/$PDK.tech; then
69-
awk 'NF > 1 && /version/' $LVS_ROOT/tech/$PDK/$PDK.tech
68+
# Add subcut output to tech file, if needed
69+
if grep -q '^style subcutout' $PDK_ROOT/$PDK/libs.tech/magic/${PDK}.tech; then
70+
echo "Tech file already contains subcutout style. Patch not necessary."
71+
cp $PDK_ROOT/$PDK/libs.tech/magic/${PDK}.tech $WORK_ROOT/.
7072
else
71-
echo "Tech files do not match:"
72-
grep version $PDK_ROOT/$PDK/libs.tech/magic/$PDK.tech $LVS_ROOT/tech/$PDK/$PDK.tech |
73-
awk 'NF > 2 && ! /^ *#/'
74-
echo "Results may be incorrect. Contact efabless to update the soft connection rules."
75-
#exit 1
73+
echo "Adding subcutout style to tech file."
74+
awk '
75+
/^cifoutput/ {searching=1}
76+
searching && /^end$/ {
77+
print BLOCK
78+
searching=0
79+
}
80+
{print}
81+
' BLOCK="$(cat $LVS_ROOT/tech/$PDK/subcutout.txt)" $PDK_ROOT/$PDK/libs.tech/magic/$PDK.tech >$WORK_ROOT/$PDK.tech
82+
fi
83+
84+
grep -H version $PDK_ROOT/$PDK/libs.tech/magic/$PDK.tech |
85+
awk 'NF > 2 && ! /^ *#/'
86+
if [[ "${EXTRACT_STYLE:-}" == "nowell" ]]; then
87+
if ! cmp -s $PDK_ROOT/$PDK/libs.tech/magic/$PDK.tech $LVS_ROOT/tech/$PDK/$PDK.tech; then
88+
grep -H version $LVS_ROOT/tech/$PDK/$PDK.tech |
89+
awk 'NF > 2 && ! /^ *#/'
90+
echo "Tech files do not match:"
91+
echo "Results may be incorrect. Contact support to update the soft connection rules."
92+
#exit 1
93+
fi
7694
fi
7795

7896
if [[ ! -f $WORK_ROOT/layout.cells ]]; then

0 commit comments

Comments
 (0)