'makepart'
Other sections of this tutorial have described the vendor-supplied methods
for creating new symbols, cells, and parts. The subject of this section is
a locally-developed shortcut known as 'makepart'
. By using
this shortcut it becomes quite easy to build a new part from scratch in
a single step. If the required cell is not available in the
central library it must first be made. In such cases part creation
actually requires two steps.
The 'makepart'
process associates an existing package footprint (i.e.
a "cell") with a new user-specified symbol by reading an ASCII file with the
file extension .mkpart
. Everything needed for the
makepart
process is contained in this single input file.
The output of makepart
is an importable DXD symbol and an
importable part specification. More detail on how to use these outputs
later.
The makepart
input syntax is described below.
With the exception of comment lines (which start with a "#" character)
the input consists of 6 header lines, an optional global net section,
and an optional no-connect section, all followed by a set of pin declaration lines
(this section begins with the SIGNALS
keyword).
The parts of the mkpart
file (and their relative order) are
depicted below.
_____________________________________ | Header section _____________________________________ | Global Nets section (optional) _____________________________________ | No-connects section (optional) |____________________________________ |SIGNALS <--- keyword | Pin declarations section |____________________________________ <end of file>We discuss each of these sections in the paragraphs that follow.
PARTITION:SYMBOL
It is often desirable to specify a part's power and ground connections so that they
get hooked up automatically (and invisibly). The format begins with the global
net name followed by a colon (:), followed by a comma-separated list of pin identifiers.
Each such global net specification must occur on a single line (even if it
gets very very long!). An example global net specification is
GND:5,7,14,15
which says that pins 5, 7, 14, and 15 are built-in connections to GND. They do
not appear on the symbol and are therefore never seen on the schematic.
Nevertheless, they are connected to the net named "GND
" whenever
the part is instantiated. Note that there may be zero or more global net
specifications. If you choose to use this capability, be very careful to
get it right. Invisible connections are a nice shortcut to make your
schematics cleaner and simpler but remember that connections do get made due to these
hidden built-in global nets. It is imperative, especially because they are
power or ground connections, that you get these perfect!
As a cross-check to ensure correct symbol/cell mapping we require that all
pins be mentioned somewhere within the .mkpart
file. If a
given cell pin is not to be part of the symbol and if it is also not on
any of the built-in global net specifications then its ID must appear
in a comma-separated list preceded by "NC:
".
The final and most important section of a makepart
input file is
the signals section. This section begins with a single line containing the
keyword "SIGNALS
". Following this keyword, each non-comment line must
be of the form:
type side dir pinID label
'type'
code is a single digit (0-2) that specifies
whether the signal is active-high (0
), active-low (1
),
or is not a signal at all but merely a request to skip a position along the
current symbol side (2
).'side'
designation is L
(left),
R
(right), T
(top), or B
(bottom). It assigns
the current pin to the given side of the symbol under construction and advances that
side's next position point. The first pin on the L or R side is at the top with
subsequent pins moving down the respective edge. The first pins on T or B sides
occur at the left with subsequent pins moving towards the right.'dir'
(direction) must be one of the keywords
IN
, OUT
, or BI
. It
sets the pin type within the symbol appropriately. This information is used later
in various usage-related rules checks. Note that skip items (typecode = 2
)
do not require a direction code.'pinID'
field is the physical location of the pin (normally an integer
pin number) within the cell. Some cells use pin identifiers that are non-numeric but these
are usually BGAs which cannot be used in ECE 189.
Note that skip items (typecode = 2
) do not have a pinID
code.typecode
of 1
the tilde is automatically inserted by the Library Manager when your symbol is imported. This
gives you an active-low bubble drawn on the symbol as well as an overbar in the label. You
should never use a leading tilde on your own active-low labels since another tilde will
be inserted by the system upon symbol import.
Note that skip items (typecode = 2
) do not require a label
field.mkpart
file
The lines below show the content of a file named 74act11374.mkpart
.
This part is an octal D-type flip-flop with common clock and active-low output enable.
The part has builtin 5V power connections on pin 18 and 19 (using the global
netname P5V
) and builtin ground connections on pins 5, 6, 7, and 8
(using the global netname GND
). There are no unused pins and therefore
no NC:
section is required. The symbol, once imported, will be placed
in the "SEB
" partition under the symbol name 74ACT11374
.
############################################################### # # 74ACT11374DW --- Octal Latch # ############################################################### 24 6 9 SEB:74ACT11374 74ACT11374DW 74ACT11374 octal latch with common CLK & active-low OE SO24W P5V:18,19 GND:5,6,7,8 SIGNALS 1 L IN 24 OE // will have an inversion bubble and an overbar 0 L IN 13 CLK 2 L ---------- 0 L IN 23 D1 0 L IN 22 D2 0 L IN 21 D3 0 L IN 20 D4 0 L IN 17 D5 0 L IN 16 D6 0 L IN 15 D7 0 L IN 14 D8 2 R ---------- 2 R ---------- 2 R ---------- 0 R BI 1 Q1 0 R BI 2 Q2 0 R BI 3 Q3 0 R BI 4 Q4 0 R BI 9 Q5 0 R BI 10 Q6 0 R BI 11 Q7 0 R BI 12 Q8
The created symbol looks like the graphic shown below. Note the bubble designating
an active-low input on the OE
pin (pin #24). The U?
at the
top of the symbol is the default reference designator. This is a changeable field
that you will override with something like U101
when the part is instantiated.
The order number and cell name attributes are visible at the bottom. Several of the
other attributes (including the pin directions) are not visible by default. If you
wish to change the visibility (either to turn off the order number and/or cell name attributes
or to turn on some other attribute(s) ) then you would use the librarian's symbol editor.
The symbol editor an also be used to re-size the box, move pins around, or make other
simple edits to a symbol. We recommend, however, that you keep your .mkpart
files up to date so that you can easily regenerate your symbols and parts if needed.
The referenced cell is a 20-pin "wide SOIC" (with custom cellname "S024W
")
that looks like the graphic depicted below. Note that the reference designator field
will be replaced by whatever you override the U?
with. The reference
designator appears both on the silkscreen and assembly plot layers. As seen below,
we typically want the silkscreen reference designator to appear outside the part's
footprint so that it will be visible on the final assembled board. The reference
designator that appears on the assembly plot, however, is normally positioned in the
center of the part's footprint, i.e. under the part, since at the time of assembly
the part will not yet be on the board. The assembly plot (a paper document) will be
used by the assembler to locate the correct spot for soldering the part to the board.
makepart
program
Makepart
is a console application. The executable resides on the
\\smbdc\Classdocs
partition under the folder named MPART
.
Running the program is easy. Just follow the steps below:
Classdocs
partition using
a drive letter of your choice. In this example we have chosen to use Y:
. mkpart
file resides, presumably somewhere within your personal account directory.
Of course, you must have previously made this file using a text editor.Y:\MPART\makepart basename
where basename
is the portion of the filename that occurs before the dot. This normally would correspond to
the name for the symbol you hope to generate.makepart
you should have two new files in the current
working directory. The file basename.1
is the new symbol, ready to be imported
into your central library. The file basename-part.txt
is the part specification,
in ASCII format. Before it is ready to be imported by the librarian, there is one more
step to be performed. The ASCII file basename-part.txt
must be converted
(encrypted) by a program named "DataConvert". Use the following command line:
DataConvert -encrypt -i basename-part.txt -o basename.hkp
.
The makepart
program should also produce a very short report
summarizing the number of pin declarations seen in the various categories. It is critical
that the pins of all types sum to the total number of pins available on the cell. If the
pin counts do not match then there is something wrong with your input file and you may
have trouble importing and/or using the resulting part. We do not recommend any attempts to
use a symbol or a part until the pin sums match the number of pins available on the
corresponding cell.
Once you have run makepart
and have your new symbol and part files ready,
the next step is to put them into your central library so that they can be used. This step
is known as "importing" a symbol. You must always import the symbol before attempting to
import the part description. Why? Because the part makes a correspondence between two
things (a symbol and a cell) and that correspondence cannot occur until both the symbol and
cell are known to the librarian. Let's first look at the steps required to import a
new symbol.
File->Open
menu and select your project's private
central library.basename.1
file and choose Open
.Congratulations! If you successfully followed the above procedure then you have imported
your first home-built symbol. Note that there is another shortcut way to do this process.
Under the Librarian's File
menu there is an Import Symbols...
command
that can accomplish the same import actions as above.
makepart
-generated part descriptionOnce you have used makepart
to generate one or more new symbols and parts and
once the new symbol(s) has been imported to the central library, it is time to import the
new part description. The steps for running the Librarian to accomplish this task are below:
Tools->Library Services...
Operation = Import
and
Import from = Part data file
Import from:
box to allow browsing.basename.hkp
and click Open
.Upon completing the above procedure, your new part should be available. If there are problems then you will be directed to a specific log file to see the details. In such cases, you may need to seek help from the instructor or teaching assistant.