⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ipc_356.il

📁 skill语言在Cadence平台二次开发中大量使用
💻 IL
📖 第 1 页 / 共 2 页
字号:
	) ; end of if

        bottom_pad_shape = bottom_pad_db-> figureName 
        if( nequal(bottom_pad_shape "NULL") then
	  if( equal(c2 "2") then
	    c58 = "X"
	    c63 = "Y"
            boundary = bottom_pad_db->bBox
	    llx = caar(boundary)
	    urx = caadr(boundary)
	    ury = cadadr(boundary)
	    lly = cadar(boundary)
	    x_bottom_dim = urx-llx
	    y_bottom_dim = ury-lly
           
	    x_bottom_dim = round(x_bottom_dim*conv_factor)
	    sprintf(c59_62 "%n" x_bottom_dim)
	    x_bottom_dim_length = strlen(c59_62)
	    if( nequal( x_bottom_dim_length 4) then
	      if( x_bottom_dim_length<4 then
	        c59_62 = strcat( substring(zero_string 1 (4-x_bottom_dim_length)) c59_62)
	      else
	        c59_62 = " ERR  "
	      ) ; end of if
	    ) ; end of if
 
            y_bottom_dim = round(y_bottom_dim*conv_factor)
	    sprintf(c64_67 "%n" y_bottom_dim)
	    y_bottom_dim_length = strlen(c64_67)
	    if( nequal( y_bottom_dim_length 4) then
	      if( y_bottom_dim_length<4 then
	        c64_67 = strcat( substring(zero_string 1 (4-y_bottom_dim_length)) c64_67)
	      else
	        c64_67 = " ERR  "
	      ) ; end of if
	    ) ; end of if
            if( rotation>0 then            /* calculates rotation - version 5 */
;    	      rotation = rotation + 1000   /* moved to sprintf in v9 */
; OE Added BD change as of 3-Apr-02 : Use angle_factor in calculation
            rotation = rotation * angle_factor	/* convert to radians as required */
 	      sprintf(rotstr "%4.0f" (rotation + 1000) )  /* use different variables for values of different type - version 6 */
	   ;  rotation = substring(rotstr 2 4) /* deleted - V9 */
	      rotstr   = substring(rotstr 2 4) /* save as the string type - V9 */
	      c68_71 = strcat( "R" rotstr )    /* Corrected the variable to get the proper rotation. */
	    else
	      c68_71 = "    "
	    ) ; end of if
 
          ) ; end of if
        ) ; end of if

	; check if soldermask is present
	; ------------------------------

	top_mask_db = axlDBGetPad(pin_db "pin/soldermask_top" "regular")
	bottom_mask_db = axlDBGetPad(pin_db "pin/soldermask_bottom" "regular")
        top_mask_shape = top_mask_db-> figureName
        if( nequal(top_mask_shape "NULL") then
	  top_mask = 0
	else
	  top_mask = 1
	) ; end of if

        bottom_mask_shape = bottom_mask_db-> figureName
        if( nequal(bottom_mask_shape "NULL") then
          bottom_mask = 0
	else
	  bottom_mask = 2
        ) ; end of if

	; generates net name
	; ------------------
	
	cond( 
		(equal(net_name nil) (net_name = "N/C           "))
		(equal(net_name "") (net_name = "N/C           "))
		(net_length = strlen(net_name)
			if( nequal( net_length 14) then
				if( net_length<14 then
					net_name = strncat( net_name null_string 14-net_length)
				else
					net_exists = long_net_table[net_name]
					if( eq(net_exists nil) then
						long_net_table[net_name] = long_net_number
						sprintf(long_net_number_string "%n" long_net_number)
						net_name = strcat("NNAME" long_net_number_string "    ")
						long_net_number = long_net_number+1
					else
						sprintf(long_net_number_string "%n" net_exists)
						net_name = strcat("NNAME" long_net_number_string "    ")
					) ; end of if
				) ; end of if
			) ; end of if
		) ; end of net not n/c
	) ; end of cond

	c4_17 = net_name

	; generates reference designator
	; ------------------------------

	cond(
		(equal(pad_type "via") (refdes = "VIA   "))
		(equal(refdes nil) (refdes = "      "))
		(refdes_length = strlen(refdes)
			if( nequal( refdes_length 6) then
				if( refdes_length<6 then
					refdes = strncat( refdes null_string 6-refdes_length)
				else
					refdes = substring(refdes refdes_length-5 6)
				) ; end of if
			) ; end of if	
		) ; end of refdes not 6
	) ; end of cond

	c21_26 = refdes

	; generates pin number
	; --------------------

	if( equal(number nil) then
		number = "    "
	else
		number_length = strlen(number)
		if( nequal( number_length 4) then
			if( number_length<4 then
				number = strncat( number null_string 4-number_length)
			else
				number = substring(number number_length-3 4)
			) ; end of if
		) ; end of if
	) ; end of if

	c28_31 = number

	; generates drill size and plating
	; --------------------------------

	if( drill>0 then    /* removed spaces for consitency */
		drill = round(drill*conv_factor)
	;	sprintf(drill "%n" drill)          /* deleted - V9 */ 
		sprintf(drillstr "%n" drill) /* use "drillstr" in following code - V9*/
		drill_length = strlen(drillstr)
		if( nequal( drill_length 4) then
			if( drill_length<4 then
				drillstr = strcat( substring(zero_string 1 (4-drill_length)) drillstr) 
			else
				drillstr = " ERR"
			) ; end of if
		) ; end of if
		c33 = "D"
		c34_37 = drillstr
	else
		c33 = " "
		c34_37 = "    "
	) ; end of if

	cond(
		(equal(c2 "2") (c38 = " "))
		(equal(plating "PLATED") (c38 = "P"))
		(t (c38 = "U"))
	) ; end of cond

	; Test point access field  ( modified in version 8 )
	; -----------------------

	if( drill>0 then  /* remove spaces for consitency - V9 */
		c40_41 = "00"                /* Through hole access from either side */
	else
		start_layer = car(layer)
		end_layer = nth(1 layer)
		top = nil
		if( equal(start_layer "ETCH/TOP") then
			top = t
		) ; end of if
		if( equal(end_layer "ETCH/TOP") then
			c40_41 = "01"                /* Access from the primary side */
		else
                  if( equal(end_layer "ETCH/BOTTOM") 
			     c40_41 = secondary      /* Access from the secondary side */
                  ) ; end if
		) ; end of if
	) ; end of if

	; generates x co-ordinate
	; -----------------------

	x = car(xy)
	if( x < 0 then
		c43 = "-"
	else
		c43 = "+"
	) ; end of if

	x = round(x*conv_factor)
	x = abs(x)
	sprintf(c44_49 "%n" x)
	x_length = strlen(c44_49)
	if( nequal( x_length 6) then
		if( x_length<6 then
			c44_49 = strcat( substring(zero_string 1 (6-x_length)) c44_49)
		else
			c44_49 = " ERR  "
		) ; end of if
	) ; end of if

	; generates y co-ordinate
	; -----------------------

    y = nth(1 xy)
    if( y < 0 then
        c51 = "-"
    else
        c51 = "+"
    ) ; end of if
 
	y = round(y*conv_factor)
	y = abs(y) 
	sprintf(c52_57 "%n" y) 
	y_length = strlen(c52_57) 
	if( nequal( y_length 6) then
		if( y_length<6 then
			c52_57 = strcat( substring(zero_string 1 (6-y_length)) c52_57)
		else 
			c52_57 = " ERR  " 
		) ; end of if    
	) ; end of if  

	; generates solder mask information
	; ---------------------------------

	c74 = top_mask+bottom_mask
	
	sprintf(c74 "%n" c74)

	; adds all data to output string
	; ------------------------------

	out = strcat( c1 c2 c3 c4_17 c18_20 c21_26 c27 c28_31 c32 \
	c33 c34_37 c38 c39 c40_41 c42 c43 c44_49 c50 c51 c52_57 \
	c58 c59_62 c63 c64_67 c68_71 c72 c73 c74 c75_80)

	; adds data to file
	; -----------------

	fprintf(outport , "%s\n", out)
		
) ; end of foreach

; creates a list of shortened nets
; --------------------------------
 
foreach( long_net long_net_table
	shortened_net = list( long_net_table[ long_net ] long_net )
	shortened_net_list = cons(shortened_net shortened_net_list)
) ; end of foreach

shortened_net_list = sortcar(shortened_net_list 'lessp)

if( neq(shortened_net_list nil) then

	outport2 = outfile("ipc_356.log")

	fprintf(outport2, "\n%s\n", "The IPC-D-356 format only allows netnames")
	fprintf(outport2, "%s\n", "up to 14 characters long. The following")
	fprintf(outport2, "%s\n\n", "netnames have therefore been changed.")
	fprintf(outport2, "%s\n", "This list has been added to the end of")
	fprintf(outport2, "%s\n\n", "the netlist for reference.")
	fprintf(outport2, "%s\n", "To:          From:")
 
	foreach(shortened_net shortened_net_list
		number = car(shortened_net)
		net = nth(1 shortened_net)
		fprintf(outport, "%s%n%s%s\n", "P  NNAME", number, " ", net)
		fprintf(outport2, "%s%n%s%s\n", " NNAME", number, "   ", net) 
	) ; end of foreach

	close(outport2)

	axlUIViewFileCreate("ipc_356.log" "IPC-D-356 Log File" t 50:30)

) ; end of if

; end of file marker
; ------------------
 
fprintf(outport , "%s\n", "999")

close(outport)

printf("\n%s%s%s\n" , "The file " boardname ".ipc has been created.")


) ; end of ipc

; registers command with allegro
; ------------------------------

axlCmdRegister( "ipc_356" `ipc_356)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -