margots的个人空间 https://blog.eetop.cn/?1778234 [收藏] [复制] [分享] [RSS]

日志

dgs layer compare

已有 146 次阅读| 2025-8-28 16:27 |系统分类:芯片设计

1,准备好3个文件

   (1)compare.sh

   (2)gdsA.pipo  (summery文件中,layer部分)

   (3)gdsB.pipo (summery文件中,layer部分)

2,打开terminal,键入

      ./compare.sh ./gdsA.pipo ./gdsB.pipo


3,生成比较页面,可查看哪些layer出现了变动


附,compare.sh:

#!/bin/bash

# Script Name: compare_sorted_first4cols.sh
# Description: Extract first 4 columns from two text files, sort them, save sorted files, and compare using vimdiff
# Usage: ./compare_sorted_first4cols.sh file1.txt file2.txt

# Check if exactly two arguments are provided
if [ $# -ne 2 ]; then
    echo "Error: Exactly two filenames are required as arguments"
    echo "Usage: $0 file1.txt file2.txt"
    exit 1
fi

# Get input filenames
FILE1="$1"
FILE2="$2"

# Check if files exist
if [ ! -f "$FILE1" ]; then
    echo "Error: File '$FILE1' does not exist"
    exit 1
fi

if [ ! -f "$FILE2" ]; then
    echo "Error: File '$FILE2' does not exist"
    exit 1
fi

# Create temporary files
TMP1=$(mktemp /tmp/file1_cols.XXXXXX)
TMP2=$(mktemp /tmp/file2_cols.XXXXXX)

# Extract first 4 columns to temporary files
echo "Extracting first 4 columns from $FILE1..."
awk '{print $1, $2, $3, $4}' "$FILE1" > "$TMP1"

echo "Extracting first 4 columns from $FILE2..."
awk '{print $1, $2, $3, $4}' "$FILE2" > "$TMP2"

# Create sorted output filenames in current directory
SORTED1="$(basename "$FILE1" .txt)_sorted_first4.txt"
SORTED2="$(basename "$FILE2" .txt)_sorted_first4.txt"

# Sort the extracted columns and save to current directory
echo "Sorting extracted columns and saving to current directory..."
sort "$TMP1" > "$SORTED1"
sort "$TMP2" > "$SORTED2"

echo "Sorted files created:"
echo "  - $SORTED1"
echo "  - $SORTED2"

echo "Comparing sorted results using vimdiff..."
echo "Press ESC and then type :qa to exit vimdiff"

# Compare using vimdiff
vimdiff "$SORTED1" "$SORTED2"

# Clean up temporary files
rm -f "$TMP1" "$TMP2"

echo "Comparison completed, temporary files removed"
echo "Sorted files preserved in current directory: $SORTED1, $SORTED2"


点赞

全部作者的其他最新日志

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 0

    粉丝
  • 1

    好友
  • 1

    获赞
  • 0

    评论
  • 4

    访问数
关闭

站长推荐 上一条 /1 下一条


手机版| 小黑屋| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-9-13 19:36 , Processed in 0.012049 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部