1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
###############################################################################
# Copyright (c) 2011-2024 by Altair Engineering, Inc.
# All rights reserved.
#
# Altair Engineering, Inc. makes this software available as part of the Vision
# tool platform.  As long as you are a licensee of the Vision tool platform
# you may make copies of the software and modify it to be used within the
# Vision tool platform, but you must include all of this notice on any copy.
# Redistribution without written permission to any third party, with or
# without modification, is not permitted.
# Altair Engineering, Inc. does not warrant that this software is error free
# or fit for any purpose.  Altair Engineering, Inc. disclaims any liability for
# all claims, expenses, losses, damages and costs any user may incur as a
# result of using, copying or modifying the software.
# =============================================================================
#   @userware
#       Pattern for Gate Recognition
#   @section
#       Miscellaneous Userware Examples
#   @description
#       Add more patterns to the gate recognition code.
#   @files
#       recognizeGate.tcl
#       recognizeGate.sp
#   @tag
#       zdb spice
###############################################################################


set db [zdb new]

##
# Add some more inverters.
#
$db oper gateadd G "V(+1,P(-1,-1))"                      "INV" "21"  ""
$db oper gateadd G "V(+1,P(-1,I(+2)))"                   "INV" "22"  ""
$db oper gateadd G "V(P(+1,+1),-1)"                      "INV" "23"  ""
$db oper gateadd G "V(P(+1,+1,+1),-1)"                   "INV" "24"  ""
$db oper gateadd G "V(+1,S(-1,-1,-1))"                   "INV" "13s" ""
$db oper gateadd G "V(+1,P(-1,-1,-1))"                   "INV" "13p" ""
$db oper gateadd G "V(P(+1,S(+1,+1),S(+1,+1)),S(-1,-1))" "INV" "221" ""

##
# Add more NAND/NOR gates.
#
set    nand_1 "V(P(+1,+2),P(S(-1,-2),S(-1,-2),S(-1,-2),S(-1,-2)))"
set    nand_2 "V(P(+1,+2),P(S(-1,-2),S(-1,-2),S(-1,-2),S(-1,-2),S(-1,-2)))"
set    nand_3 "V(P(+1,+2,+3),P(S(-1,-2,-3),S(-1,-2,-3),S(-1,-2,-3)))"
set    nor_1  "V(P(S(+1,+2,+3,+4),S(+1,+2,+3,+4),S(+1,+2,+3,+4),S(+1,+2,+3,+4))"
append nor_1  ",P(-1,-2,-3,-4))"
$db oper gateadd G $nand_1 "NAND" "242"  ""
$db oper gateadd G $nand_2 "NAND" "252"  ""
$db oper gateadd G $nand_3 "NAND" "333"  ""
$db oper gateadd G $nor_1  "NOR"  "4x4x" ""

##
# Add more combi-gates.
#
set    aoi_1  "V(P(S(+1,+2),S(+1,+2),S(+3,+4),S(+3,+4)),P(S(-1,-4),S(-1,-4)"
append aoi_1  ",S(-2,-3),S(-2,-3)))"
set    aoi_2  "V(P(S(+1,+2),S(+3,+4)),P(S(-1,-4),S(-2,-3)))"
set    aoi_3  "V(P(S(+1,+4),S(+1,+4),S(+2,+3),S(+2,+3)),P(S(-1,-2),S(-3,-4)))"
set    aoi_4  "V(S(P(+3,+4),P(S(+1,+2),S(+1,+2),S(+1,+2))),P(-1,-2,S(-3,-4)"
append aoi_4  ",S(-3,-4)))"
set    aoi_5  "V(S(+1,P(+2,+3),P(+4,+5)),P(-1,S(-2,-3),S(-2,-3),S(-4,-5)"
append aoi_5  ",S(-4,-5)))"
set    aoi_6  "V(S(+1,P(+2,+3,+4)),P(-1,S(-2,-3,-4),S(-2,-3,-4),S(-2,-3,-4)))"
set    oai_1  "V(P(+1,S(+2,+3,+4),S(+2,+3,+4),S(+2,+3,+4)),S(-1,P(-2,-3,-4)))"
set    oai_2  "V(P(+1,+2,S(+3,+4),S(+3,+4)),S(P(-3,-4),P(S(-1,-2),S(-1,-2)"
append oai_2  ",S(-1,-2))))"
$db oper gateadd G $aoi_1  "AOI(22)"   "2x2"  "1423"
$db oper gateadd G $aoi_2  "AOI(22)"   "A"    "1423"
$db oper gateadd G $aoi_3  "AOI(22)"   "B"    "1234"
$db oper gateadd G $aoi_4  "AOI(211)"  "A"    "3412"
$db oper gateadd G $aoi_5  "AOI(122)"  ""     "12345"
$db oper gateadd G $aoi_6  "AOI(31)"   ""     "2341"
$db oper gateadd G $oai_1  "OAI(13)"   "A"    "1234"
$db oper gateadd G $oai_2  "OAI(112)"  "A"    "1234"

$db close

##
# The added pattern can be cleared with the following command:
#
# $db oper gateadd -clear
#