首页 > 其他分享 >INNOVUS批量摆放cell array的脚本

INNOVUS批量摆放cell array的脚本

时间:2023-07-26 23:57:09浏览次数:31  
标签:set string insts INNOVUS cell prefix inst dbGet array

说明:invs_place_cell_array -prefix $prefix -libcell $libcell -hornum $hornum -vernum $vernum -startX $startX -startY $startY -spaceX $spaceX -spaceY $spaceY -orientation $orientation, 类似于ICC2中create_cell_array的用法

proc invs_place_cell_array { args } {
  parse_proc_arguments -args $args ARGS
  set prefix $ARGS(-prefix)
  set libcell $ARGS(-libcell)
  set hornum $ARGS(-hornum)
  set vernum $ARGS(-vernum)
  set startX $ARGS(-startX)
  set startY $ARGS(-startY)
  set spaceX $ARGS(-spaceX)
  set spaceY $ARGS(-spaceY)
  set orientation $ARGS(-orientation)
  set n 0
  set x $startX
  set y $startY
  if { ($hornum != 0) && ($vernum != 0) } {
    for { set i 1 } { $i <= $hornum } { incr i } {
      for { set j 1 } { $j <= $vernum } { incr j } {
        addInst -inst ${prefix}_${i}_${j} -cell $libcell
        set insts [dbGet top.insts.name ${prefix}_*]
        set instX [dbGet [dbGet top.insts.name [lindex $insts 0] -p].box_sizex]
        set instY [dbGet [dbGet top.insts.name [lindex $insts 0] -p].box_sizey]
        set x [expr $x + ($i - 1) * $instX + ($i - 1) * $spaceX]
        set y [expr $y + ($j - 1) * $instY + ($j - 1) * $spaceY]
        placeInstance ${prefix}_${i}_${j} $x $y -fixed $orientation
        set x $startX
        set y $startY
      }
    }
  } elseif {($hornum == 0) && ($vernum != 0)} {
    for { set i 1 } { $i <= $vernum } { incr i } {
      addInst -inst ${prefix}_${i} -cell $libcell
    }
    set insts [dbGet top.insts.name ${prefix}_*]
    set instX [dbGet [dbGet top.insts.name [lindex $insts 0] -p].box_sizex]
    set instY [dbGet [dbGet top.insts.name [lindex $insts 0] -p].box_sizey]
    foreach inst $insts {
      placeInstance $inst $x $y -fixed $orientation
      incr n
      if { $n % $vernum == 0} {
        set x $startX
        set y $startY
      } else {
        set x $startX
        set y [expr $y + $instX + $spaceY]
      }
    }
  } elseif {($hornum != 0) && ($vernum == 0)} {
    for { set i 1 } { $i <= $hornum } { incr i } {
      addInst -inst ${prefix}_${i} -cell $libcell
    }
    set insts [dbGet top.insts.name ${prefix}_*]
    set instX [dbGet [dbGet top.insts.name [lindex $insts 0] -p].box_sizex]
    set instY [dbGet [dbGet top.insts.name [lindex $insts 0] -p].box_sizey]
    foreach inst $insts {
      placeInstance $inst $x $y $orientation -fixed
      incr n
      if { $n % $hornum == 0 } {
        set x $startX
        set y $startY
      } else {
        set x [expr $x + $instX + $spaceX]
        set y $startY
      }
    }
  } else {
    puts "impossible case!"
  }
}

define_proc_arguments batch_place_inst \
  -info "batch place array cells" \
  -define_args {
    {-prefix "create inst name prefix." string string required}
    {-libcell "lib cell to be created." string string required}
    {-hornum "horizontal lib cell numbers." string string required}
    {-vernum "vertical lib cell numbers." string string required}
    {-startX "first placed inst horizontal coordinate." string string required}
    {-startY "first placed inst horizontal coordinate." string string required}
    {-spaceX "spacing between two adjacent horizontally placed insts." string string required}
    {-spaceY "spacing between two adjacent vertically placed insts." string string required}
    {-orientation "orientation of first placed inst." string string required}
}

标签:set,string,insts,INNOVUS,cell,prefix,inst,dbGet,array
From: https://www.cnblogs.com/siligence/p/17583835.html

相关文章

  • Python使用 - array
    常用操作 常见用法arr1=array.array("i",[1,2])#元素的字节数print(arr1.itemsize)#4print(len(arr1))#2#添加元素arr1.append(3)arr1.append(4)print(len(arr1))#4print(arr1)#array('i',[1,2,3,4])#修改元素arr1[0]=10print(arr1)#......
  • QDataStream 读取与写入QByteArray
    问题:QDataStream中写入的数据比QByteArray多了4个byte。仔细看了下,这个4个byte表示的是QByteArray的数据长度。转载官方文档:https://doc.qt.io/qt-6/qdatastream.htmlQDataStream &QDataStream::readBytes(char *&s, uint &l)Readsthebuffer s fromthestreamandr......
  • 918. Maximum Sum Circular Subarray (Medium)
    Description918.MaximumSumCircularSubarray(Medium)Givenacircularintegerarraynumsoflengthn,returnthemaximumpossiblesumofanon-emptysubarrayofnums.Acirculararraymeanstheendofthearrayconnectstothebeginningofthearray.F......
  • php array_map
    1、php里面怎么新建数组?2、PHP中要使用数组的话必须先定义一个变量为“array()”的代码吗?_百度...3、如何运用PHP函数arrayphp里面怎么新建数组?1、php里面新建数据可以通过两种方式phparray,一种是通过array函数来创建phparray,另一种就是通过赋值[]来创建。2、在PHP中创......
  • 【题解】Imbalanced Arrays - Codeforces 1852B
    出处:CodeforcesRound887链接:https://codeforces.com/problemset/problem/1852/B题目大意:给定一个包含\(n\)个非负整数的频次序列\(f\)。构造任意一个等长的整数序列\(b\),要求①\(b\in[-n,n]\)but$b\neq0$②\(b\)中不存在相反数③对于每个坐标\(i\)......
  • 数组(Array)和链表(List)
    推荐https://cloud.tencent.com/developer/article/2304343引言在Java编程中,数组(Array)和链表(List)是常用的数据结构,用于在内存中存储和组织数据。两者都有各自的特点和适用场景,本文将深入比较数组与链表的区别,并结合代码示例进行详细解释。数组(Array)定义和特点数组是一种固定......
  • Array.from使用以及与[...obj]的区别
    一、Array.from使用通常Array都用于数组去重。下面是Array的详细用法:1.将类似组转化为真正的数组 函数参数转化为数组 dom转化为数组这里强调一下,必须有length属性,否则返回的是空数组。索引必须是字符串数字,否则返回的是[undefined,undefined,undefined,undefined]......
  • matlab的cell如何用python表示
    使用Python表示Matlab的cell在Matlab中,cell是一种数据类型,用于存储不同类型的数据,类似于Python中的列表。在Python中,我们可以使用列表、字典或者NumPy数组来模拟Matlab的cell。本文将介绍使用列表和字典来表示Matlab的cell的方法,并给出相应的代码示例。1.使用列表表示Matlab的ce......
  • python如何新建array
    Python如何新建array在Python中,可以使用array模块来创建和操作数组。array模块提供了一种高效的存储和操作数值数据的方式,它可以在内存中创建一个连续的数组,并且支持各种数值类型,如整数、浮点数等。问题描述假设我们面临的问题是需要存储一系列数字,并对这些数字进行一些计算和操......
  • 112.STL中的array
    112.STL中的array1.array介绍在C++标准库中,array是固定大小的序列容器,array中包含特定个数并且严格按照线性序列排序的元素。因此array允许对元素进行随机访问,指向某一元素的指针可以通过偏移访问其他元素。在array内部,它只保存自己包含的元素,其他任何信息都不保存,包括自身的大......