File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,31 @@ jobs:
184184 cmake --build build -j$(nproc)
185185 cp build/butterscotch build/butterscotch.elf
186186
187+ - name : Check executeLoop I-Cache fit
188+ run : |
189+ # Extract executeLoop function size from the ELF symbol table
190+ # nm -S prints: address size type name
191+ echo "Getting executeLoop size from ELF symbol table..."
192+ SYMBOL_LINE=$(mips64r5900el-ps2-elf-nm -S build/butterscotch.elf | grep ' executeLoop$' || true)
193+ if [ -z "$SYMBOL_LINE" ]; then
194+ echo "::error::Could not find executeLoop symbol in ELF (is it stripped?)"
195+ exit 1
196+ fi
197+ # Size is the second hex field
198+ SIZE_HEX=$(echo "$SYMBOL_LINE" | awk '{print $2}')
199+ SIZE_DEC=$((16#$SIZE_HEX))
200+ LIMIT=16384
201+ if [ "$SIZE_DEC" -gt "$LIMIT" ]; then
202+ echo "::error::executeLoop is $SIZE_DEC bytes, exceeding the PS2 16 KB I-Cache ($LIMIT bytes) by $((SIZE_DEC - LIMIT)) bytes"
203+ echo "| Function | Size | Limit | Status |" >> $GITHUB_STEP_SUMMARY
204+ echo "|----------|------|-------|--------|" >> $GITHUB_STEP_SUMMARY
205+ echo "| \`executeLoop\` | $SIZE_DEC bytes | $LIMIT bytes (16 KB) | **EXCEEDED** by $((SIZE_DEC - LIMIT)) bytes |" >> $GITHUB_STEP_SUMMARY
206+ exit 1
207+ fi
208+ echo "| Function | Size | Limit | Status |" >> $GITHUB_STEP_SUMMARY
209+ echo "|----------|------|-------|--------|" >> $GITHUB_STEP_SUMMARY
210+ echo "| \`executeLoop\` | $SIZE_DEC bytes | $LIMIT bytes (16 KB) | $((LIMIT - SIZE_DEC)) bytes remaining |" >> $GITHUB_STEP_SUMMARY
211+
187212 - name : Upload artifact
188213 uses : actions/upload-artifact@v4
189214 with :
You can’t perform that action at this time.
0 commit comments