allgro common lisp 安装option 怎么设置

Franz Inc. - Semantic Graph and Common Lisp Solutions
Semantic Graph Technologies
AllegroGraph – When Property Graphs are too simple for your Complex World
Semantic Data Lake Data Management System for Analytics
Common Lisp Tools
Enterprise Ready Development Platform for Mission Critical Applications
Gruff - Visualize, Navigate, Query, Explore
Discover The Industry’s most unique tool for Graph Technology
Franz Inc. named to KMWorld Magazine’s
“100 COMPANIES that Matter in Knowledge Management”
Visual Query Magic
Gruff - RDF Browser
Allegro CL 10.1 Beta
New Platform!
AllegroGraph v6.1
Now Available!
Industry Leading Graph Database and Common Lisp Technologies
Franz Inc. is an early innovator in Artificial Intelligence and
leading supplier of Semantic Graph Database technology with expert
knowledge in developing and deploying Cognitive Computing
solutions.
AllegroGraph is an ultra scalable, high-performance, and transactional
Semantic Graph Database which turns complex data into actionable
business insights.
Allegro CL provides an ideal Lisp programming environment to create
complex, mission-critical applications that solve real world problems.
Franz Inc. is committed to market-driven product development, the
highest levels of product quality and responsive customer support and
service. Franz customers include dozens of Fortune 500 companies that
span healthcare, intelligence agencies, life sciences,
telecommunications, and visionary researcher organizations looking to
solve complex problems.
News & Events
LATEST NEWS
PRESS RELEASES
IC-FOODS Inaugural Conference
Jan. 31 - Feb. 1
Nov. 15-16
The Knowledge Management World Conference
Nov. 14-17
Franz VP to Keynote at the 14th Pacific Rim International Conference on AI
Trusted by Leading Organizations
Businesses Innovating with Industry Leading Franz Inc. Technologies
Contact Us
2201 Broadway, Suite 715 Oakland, California 94612
1 (510) 452-2000
Common Lisp
Semantic Data Lake
Allegro NFS
Subscribe To Our Newsletters
Send mail toCommon Lisp is a high-level, all-purpose, object-oriented,
dynamic, functional programming language with long history.
Common Lisp is used in many fields, ranging from web development to
finance, and also common in computer science education.
There are more than 9 different implementations of common lisp which
are available, all have different foreign function
interfaces. SWIG currently supports only the Allegro Common
Lisp, Common Foreign Function Interface(CFFI), CLisp and UFFI
foreign function interfaces.
22.1 Allegro Common Lisp
Allegro Common Lisp support in SWIG has been updated to include
support for both C and C++. You can read about the interface
22.2 Common Foreign Function Interface(CFFI)
CFFI, the Common Foreign Function Interface, is a portable foreign
function interface for ANSI Common Lisp systems, similar in
spirit to UFFI. Unlike UFFI, CFFI requires only a small set of
low-level functionality from the Lisp implementation, such as
calling a foreign function by name, allocating foreign memory,
and dereferencing pointers.
To run the cffi module of SWIG requires very little effort, you
just need to run:
swig -cffi -module module-name
But a better was of using all the power of SWIG is to write SWIG
interface files. Below we will explain how to write interface
files and the various things which you can do with them.
22.2.1 Additional Commandline Options
The following table list the additional commandline options available for the CLISP module. They can also be seen by using:
swig -cffi -help
CFFI specific options
-generate-typedef
If this option is given then defctype will be used to generate
shortcuts according to the typedefs in the input.
-[no]cwrap
Turn on or turn off generation of an intermediate C file when
creating a C interface. By default this is only done for C++ code.
-[no]swig-lisp
Turns on or off generation of code for helper lisp macro, functions,
etc. which SWIG uses while generating wrappers. These macros, functions
may still be used by generated wrapper code.
22.2.2 Generating CFFI bindings
As we mentioned earlier the ideal way to use SWIG is to use interface
files. To illustrate the use of it, lets assume that we have a
file named test.h with the following C code:
#define y 5
#define x (y &&
struct bar {
int *z[1000];
struct bar *
struct foo {
struct foo * b[100];
int pointer_func(void (*ClosureFun)( void* _fun, void* _data, void* _evt ), int p);
int func123(div_t * p,int **q[100],int r[][1000][10]);
void lispsort_double (int n, double * array);
enum color { RED, BLUE, GREEN};
Corresponding to this we will write a simple interface file:
%module test
%include "test.h"
The generated SWIG Code will be:
;;;SWIG wrapper code starts here
(cl:defmacro defanonenum (&body enums)
"Converts anonymous enums to defconstants."
`(cl:progn ,@(cl:loop for value in enums
for index = 0 then (cl:1+ index)
when (cl:listp value) do (cl:setf index (cl:second value)
value (cl:first value))
collect `(cl:defconstant ,value ,index))))
(cl:eval-when (:compile-toplevel :load-toplevel)
(cl:unless (cl:fboundp 'swig-lispify)
(cl:defun swig-lispify (name flag cl:&optional (package cl:*package*))
(cl:labels ((helper (lst last rest cl:&aux (c (cl:car lst)))
((cl:null lst)
((cl:upper-case-p c)
(helper (cl:cdr lst) 'upper
(cl:case last
((lower digit) (cl:list* c #\- rest))
(cl:t (cl:cons c rest)))))
((cl:lower-case-p c)
(helper (cl:cdr lst) 'lower (cl:cons (cl:char-upcase c) rest)))
((cl:digit-char-p c)
(helper (cl:cdr lst) 'digit
(cl:case last
((upper lower) (cl:list* c #\- rest))
(cl:t (cl:cons c rest)))))
((cl:char-equal c #\_)
(helper (cl:cdr lst) '_ (cl:cons #\- rest)))
(cl:error "Invalid character: ~A" c)))))
(cl:let ((fix (cl:case flag
((constant enumvalue) "+")
(variable "*")
(cl:t ""))))
(cl:intern
(cl:concatenate
'cl:string
(cl:nreverse (helper (cl:concatenate 'cl:list name) cl:nil cl:nil))
package))))))
;;;SWIG wrapper code ends here
(cl:defconstant y 5)
(cl:defconstant x (cl:ash 5 -1))
(cffi:defcstruct bar
(p :short)
(q :short)
(z :pointer)
(n :pointer))
(cffi:defcvar ("my_struct" my_struct)
(cffi:defcstruct foo
(b :pointer))
(cffi:defcfun ("pointer_func" pointer_func) :int
(ClosureFun :pointer)
(cffi:defcfun ("func123" func123) :int
(p :pointer)
(q :pointer)
(r :pointer))
(cffi:defcfun ("lispsort_double" lispsort_double) :void
(array :pointer))
(cffi:defcenum color
The SWIG wrapper code refers to the special code which SWIG
may need to use while wrapping C code. You can turn on/off the
generation of this code by using the -[no]swig-lisp
option. You must have noticed that SWIG goes one extra step to
ensure that CFFI does not do automatic lispification of the C
function names. The reason SWIG does this is because quite often
developers want to build a nice CLOS based lispy API, and this one
to one correspondence between C function names and lisp function
name helps.
Maybe you want to have your own convention for generating lisp
function names for corresponding C function names, or you just
want to lispify the names, also, before we forget you want to
export the generated lisp names. To do this, we will use the
SWIG feature directive.
Let's edit the interface file such that the C type "div_t*" is changed
to Lisp type ":my-pointer", we lispify all names,
export everything, and do some more stuff.
%module test
%typemap(cin) div_t* ":my-pointer";
%feature("intern_function","1");
%feature("export");
%feature("inline") lispsort_
%feature("intern_function", "my-lispify") lispsort_
%rename func123 renamed_cool_
%ignore "pointer_func";
%include "test.h"
The typemap(cin) ensures that for all arguments which are input
to C with the type "div_t*", the ":my-pointer" type be
used. Similarly
typemap(cout) are used for all types which
are returned from C.
The feature intern_function ensures that all C names are
interned using the swig-lispify function. The "1" given
to the feature is optional. The use of feature like
%feature("intern_function","1"); globally enables
interning for everything. If you want to target a single
function, or declaration then use the targeted version of
feature, %feature("intern_function", "my-lispify")
lispsort_, here we are using an additional feature
which allows us to use our lispify function.
The export feature allows us to export the symbols. The inline
feature declaims the declared function as inline. The rename
directive allows us to change the name(it is useful when
generating C wrapper code for handling overloaded
functions). The ignore directive ignores a certain
declaration.
There are several other things which are possible, to see some
example of usage of SWIG look at the Lispbuilder and wxCL
projects. The generated code with 'noswig-lisp' option is:
(cl:defconstant #.(swig-lispify "y" 'constant) 5)
(cl:export '#.(swig-lispify "y" 'constant))
(cl:defconstant #.(swig-lispify "x" 'constant) (cl:ash 5 -1))
(cl:export '#.(swig-lispify "x" 'constant))
(cffi:defcstruct #.(swig-lispify "bar" 'classname)
(#.(swig-lispify "p" 'slotname) :short)
(#.(swig-lispify "q" 'slotname) :short)
(#.(swig-lispify "a" 'slotname) :char)
(#.(swig-lispify "b" 'slotname) :char)
(#.(swig-lispify "z" 'slotname) :pointer)
(#.(swig-lispify "n" 'slotname) :pointer))
(cl:export '#.(swig-lispify "bar" 'classname))
(cl:export '#.(swig-lispify "p" 'slotname))
(cl:export '#.(swig-lispify "q" 'slotname))
(cl:export '#.(swig-lispify "a" 'slotname))
(cl:export '#.(swig-lispify "b" 'slotname))
(cl:export '#.(swig-lispify "z" 'slotname))
(cl:export '#.(swig-lispify "n" 'slotname))
(cffi:defcvar ("my_struct" #.(swig-lispify "my_struct" 'variable))
(cl:export '#.(swig-lispify "my_struct" 'variable))
(cffi:defcstruct #.(swig-lispify "foo" 'classname)
(#.(swig-lispify "a" 'slotname) :int)
(#.(swig-lispify "b" 'slotname) :pointer))
(cl:export '#.(swig-lispify "foo" 'classname))
(cl:export '#.(swig-lispify "a" 'slotname))
(cl:export '#.(swig-lispify "b" 'slotname))
(cffi:defcfun ("renamed_cool_func" #.(swig-lispify "renamed_cool_func" 'function)) :int
(p :my-pointer)
(q :pointer)
(r :pointer))
(cl:export '#.(swig-lispify "renamed_cool_func" 'function))
(cl:declaim (cl:inline #.(my-lispify "lispsort_double" 'function)))
(cffi:defcfun ("lispsort_double" #.(my-lispify "lispsort_double" 'function)) :void
(array :pointer))
(cl:export '#.(my-lispify "lispsort_double" 'function))
(cffi:defcenum #.(swig-lispify "color" 'enumname)
#.(swig-lispify "RED" 'enumvalue :keyword)
#.(swig-lispify "BLUE" 'enumvalue :keyword)
#.(swig-lispify "GREEN" 'enumvalue :keyword))
(cl:export '#.(swig-lispify "color" 'enumname))
22.2.3 Generating CFFI bindings for C++ code
This feature to SWIG (for CFFI) is very new and still far from
complete. Pitch in with your patches, bug reports and feature
requests to improve it.
Generating bindings for C++ code, requires -c++ option to be
present and it first generates C binding which will wrap the C++
code, and then generates the
corresponding CFFI wrapper code. In the generated C wrapper
code, you will often want to put your own C code, such as the
code to include various files. This can be done by making use of
"%{" and "%}" as shown below.
#include "Test/test.h"
Also, while parsing the C++ file and generating C wrapper code SWIG
may need to be able to understand various symbols used in other
header files. To help SWIG in doing this while ensuring that
wrapper code is generated for the target file, use the "import"
directive. The "include" directive specifies the target file for
which wrapper code will be generated.
%import "ancillary/header.h"
%include "target/header.h"
Various features which were available for C headers can also be used
here. The target header which we are going to use here is:
namespace OpenDemo {
class Test
// constructors
Test (void) {x = 0;}
Test (float X) {x = X;}
// vector addition
Test operator+ (const Test& v) const {return Test (x+v.x);}
// length squared
float lengthSquared (void) const {return this-&dot (*this);}
static float distance (const Test& a, const Test& b){return(a-b).length();}
inline Test parallelComponent (const Test& unitBasis) const {
return unitBasis *
Test setYtoZero (void) const {return Test (this-&x);}
static const T
inline Test operator* (float s, const Test& v) {return v*s;}
inline std::ostream& operator&& (std::ostream& o, const Test& v)
return o && "(" && v.x && ")";
inline Test RandomUnitVectorOnXZPlane (void)
return RandomVectorInUnitRadiusSphere().setYtoZero().normalize();
The interface used is:
%module test
%include "test.cpp"
SWIG generates 3 files, the first one is a C wrap which we don't show,
the second is the plain CFFI wrapper which is as shown below:
(cffi:defcfun ("_wrap_Test_x_set" Test_x_set) :void
(self :pointer)
(x :float))
(cffi:defcfun ("_wrap_Test_x_get" Test_x_get) :float
(self :pointer))
(cffi:defcfun ("_wrap_new_Test__SWIG_0" new_Test) :pointer)
(cffi:defcfun ("_wrap_new_Test__SWIG_1" new_Test) :pointer
(X :float))
(cffi:defcfun ("_wrap_Test___add__" Test___add__) :pointer
(self :pointer)
(v :pointer))
(cffi:defcfun ("_wrap_Test_lengthSquared" Test_lengthSquared) :float
(self :pointer))
(cffi:defcfun ("_wrap_Test_distance" Test_distance) :float
(a :pointer)
(b :pointer))
(cffi:defcfun ("_wrap_Test_parallelComponent" Test_parallelComponent) :pointer
(self :pointer)
(unitBasis :pointer))
(cffi:defcfun ("_wrap_Test_setYtoZero" Test_setYtoZero) :pointer
(self :pointer))
(cffi:defcvar ("Test_zero" Test_zero)
(cffi:defcfun ("_wrap_delete_Test" delete_Test) :void
(self :pointer))
(cffi:defcfun ("_wrap___mul__" __mul__) :pointer
(s :float)
(v :pointer))
(cffi:defcfun ("_wrap___lshift__" __lshift__) :pointer
(o :pointer)
(v :pointer))
(cffi:defcfun ("_wrap_RandomUnitVectorOnXZPlane" RandomUnitVectorOnXZPlane) :pointer)
The output is pretty good but it fails in disambiguating overloaded
functions such as the constructor, in this case. One way of
resolving this problem is to make the interface use the rename
directiv, but hopefully there are better solutions.
In addition SWIG also generates, a CLOS file
(clos:defclass test()
((ff :reader ff-pointer)))
(clos:defmethod (cl:setf x) (arg0 (obj test))
(Test_x_set (ff-pointer obj) arg0))
(clos:defmethod x ((obj test))
(Test_x_get (ff-pointer obj)))
(cl:shadow "+")
(clos:defmethod + ((obj test) (self test) (v test))
(Test___add__ (ff-pointer obj) (ff-pointer self) (ff-pointer v)))
(clos:defmethod length-squared ((obj test) (self test))
(Test_lengthSquared (ff-pointer obj) (ff-pointer self)))
(clos:defmethod parallel-component ((obj test) (self test) (unitBasis test))
(Test_parallelComponent (ff-pointer obj) (ff-pointer self) (ff-pointer unitBasis)))
(clos:defmethod set-yto-zero ((obj test) (self test))
(Test_setYtoZero (ff-pointer obj) (ff-pointer self)))
I agree that the CFFI C++ module needs lot more work. But I hope it
provides a starting point, on which you can base your work of
importing C++ libraries to Lisp.
If you have any questions, suggestions, patches, etc., related to CFFI
module feel free to contact us on the SWIG mailing list, and
also please add a "[CFFI]" tag in the subject line.
22.2.4 Inserting user code into generated files
It is often necessary to
into the automatically generated interface files. For example, when building
a C++ interface, example_wrap.cxx will likely not compile unless
you add a #include "header.h" directive. This can be done
using the SWIG %insert(section) %{ ...code... %} directive:
%module example
#include "header.h"
%include "header.h"
int fact(int n);
Additional sections have been added for inserting into the
generated lisp interface file:
lisphead - inserts before type declarations
swiglisp - inserts after type declarations according to
where it appears in the .i file
Note that the block %{ ... %} is effectively a shortcut for
%insert("header") %{ ... %}.
22.3 CLISP
is a feature-loaded
implementation of common lisp which is portable across most of the
operating system environments and hardware. CLISP includes an
interpreter, a compiler, a debugger, CLOS, MOP, a foreign
language interface, i18n, regular expressions, a socket
interface, and more. An X11 interface is available through CLX,
Garnet and CLUE/CLIO. Command line editing is provided by
readline. CLISP runs Maxima, ACL2 and many other Common Lisp
To run the clisp module of SWIG requires very little effort, you
just need to execute:
swig -clisp -module module-name
Because of the high level nature of the CLISP FFI, the bindings
generated by SWIG may not be absolutely correct, and you may need
to modify them. The good thing is that you don't need to complex
interface file for the CLISP module. The CLISP module tries to
produce code which is both human readable and easily modifyable.
22.3.1 Additional Commandline Options
The following table list the additional commandline options available for the CLISP module. They can also be seen by using:
swig -clisp -help
CLISP specific options
-extern-all
If this option is given then clisp definitions for all the functions
and global variables will be created otherwise only definitions for
externed functions and variables are created.
-generate-typedef
If this option is given then def-c-type will be used to generate
shortcuts according to the typedefs in the input.
22.3.2 Details on CLISP bindings
As mentioned earlier the CLISP bindings generated by SWIG may need
some modifications. The clisp module creates a lisp file with
the same name as the module name. This
lisp file contains a 'defpackage' declaration, with the
package name same as the module name. This package uses the
'common-lisp' and 'ffi' packages. Also, package exports all
the functions, structures and variables for which an ffi
binding was generated.
After generating the defpackage statement, the clisp module also
sets the default language.
(defpackage :test
(:use :common-lisp :ffi)
:pointer_func
:make-cfunr
:lispsort_double
:test123))
(in-package :test)
(default-foreign-language :stdc)
The ffi wrappers for functions and variables are generated as shown
below. When functions have arguments of type "double * array",
SWIG doesn't knows whether it is an 'out' argument or it is
an array which will be passed, so SWIG plays it safe by
declaring it as an '(array (ffi:c-ptr DOUBLE-FLOAT))'. For
arguments of type "int **z[100]" where SWIG has more
information, i.e., it knows that 'z' is an array of pointers to
pointers of integers, SWIG defines it to be '(z (ffi:c-ptr
(ffi:c-array (ffi:c-ptr (ffi:c-ptr ffi:int)) 100)))'
extern "C" {
int pointer_func(void (*ClosureFun)( void* _fun, void* _data, void* _evt ), int y);
int func123(div_t * x,int **z[100],int y[][1000][10]);
void lispsort_double (int n, double * array);
void test123(float x , double y);
(ffi:def-call-out pointer_func
(:name "pointer_func")
(:arguments (ClosureFun (ffi:c-function (:arguments (arg0 (ffi:c-pointer NIL))
(arg1 (ffi:c-pointer NIL))
(arg2 (ffi:c-pointer NIL)))
(:return-type NIL)))
(y ffi:int))
(:return-type ffi:int)
(:library +library-name+))
(ffi:def-call-out func123
(:name "func123")
(:arguments (x (ffi:c-pointer div_t))
(z (ffi:c-ptr (ffi:c-array (ffi:c-ptr (ffi:c-ptr ffi:int)) 100)))
(y (ffi:c-ptr (ffi:c-ptr (ffi:c-array ffi:int (1000 10))))))
(:return-type ffi:int)
(:library +library-name+))
(ffi:def-call-out lispsort_double
(:name "lispsort_double")
(:arguments (n ffi:int)
(array (ffi:c-ptr DOUBLE-FLOAT)))
(:return-type NIL)
(:library +library-name+))
(ffi:def-call-out test123
(:name "test")
(:arguments (x SINGLE-FLOAT)
(y DOUBLE-FLOAT))
(:return-type NIL)
(:library +library-name+))
The module also handles strutcures and #define constants as shown
below. SWIG automatically adds the constructors and accessors
created for the struct to the list of symbols exported by the
struct bar {
int *z[1000];
struct bar *
#define max 1000
(ffi:def-c-struct bar
(x :type ffi:short)
(y :type ffi:short)
(a :type character)
(b :type character)
(z :type (ffi:c-array (ffi:c-ptr ffi:int) 1000))
(n :type (ffi:c-pointer bar)))
(defconstant max 1000)Allegro入门总结
参考资料:于博士&cadence视频教程,入门的主要资源。&&&&&&&&&&&&&&1
&&&&&&&&&&Cadence高速电路板设计与仿真&&&周润景&&&&&&&&&&&&&&&&&&2
使用的软件为:cadence&16.3,学习目录跟2的目录一致。
一、cadence原理图设计平台
这里使用的cadence原理图设计平台是Design&Entry&CIS,在使用上比较方便简单,跟protel相似,主要是跟于博士的教程没有什么出入,按照视频教程基本上看两遍就可以学会了。对于工具的使用自己摸索摸索多数功能也能实现。没有太多容易遗忘的地方。
原理设计流程:
1、建立元件库,这里仅仅使用一些基本的方法建立元件;
在Capture&Design&CIS,file-&new-&Library,可以新建一个元件库用来存储自己的元件符号。
选择xxx.olb文件,右键new&part就可以添加自己的元件;
&&&&在原理图工作环境中把自己建立的库选入列表中就可以跟使用自带的元件库一样。
&&&&此外常用的库有:Discrete.olb、MicroController.olb、Conector.olb、Gate.olb;添加方法是“Place&Part”&&&&
对话框中的Library中点击添加;(只有两个按钮,一个删除,一个添加)。
&&&&在原理图制作中,需要注意栅格选定,如果放置时引脚没有选定,绘出的元件在原理图中很难连线。绘制元件图用到的操作一般在Option里面,其他放置引脚,元件框,都在右边的工具栏中;
2、放置元件,连接成原理图,主要是网络和层次电路图的使用;
&&&File-&new-&project命令建立新的原理图,选择sch即可。至于其他的操作方法比较符合人的思维习惯,把于博士的视频教程看一遍估计就可以记住了。
3、封装填写,可以批量填写,这个功能很有用;
&&&批量填写,具体操作时把元件都选中后,右键Edit&Propertion,在footprint选项中,想使用excel一样,填写即可;
4、DRC检查和元件的标号标注;
&&&在进行这些操作时需要选中DSN文件,另外在于博士的教程中详细讲解了Edit-&browse命令的用法,很是受用;
5、导出网络列表;
&&&跟上面一样需要选择dsn文件。
二、cadence封装的制作
由于cadence封装对制版关系重大,且不容易检查,这里不做简要介绍。于博士的视频教程跟实际使用基本没有出入,按照教程做几个封装基本就会掌握。封装的制作工具是pad&designer和allegro&PCB&design&GXL16.3,这个版本跟于博士教程中师范的版本有较大的出入。在使用时往往需要添加自己封装库,添加方法是:Setup-&User&Preferences&Dailog,z在这个对话框中选择Paths-&Library,在里面设置padPath和psmPath即可。选择自己建立封装的文件夹,这样在Place&Manuly里面就可以看到,需要把library选上。
这里对paddesigner中的一些概念明确一下:
&&&&1、PAD有三种
&1)Regular&Pad&,规则焊盘(正片中),有圆形(Circle)、方形(Square)、Oblong(拉长圆形)、方形(Rectang)、Octagon(八边形)、任意形状(Shape);
&&2)Thermal&relief,热风焊盘(正负片都可以存在一般用作负片),形状如上,多了NULL,于博士的教程中队贴片的焊盘都不设置热风焊盘;
&&3)Anti&Pad&抗电边距(负片中使用),用来防止管脚跟其他网络相连,比regularpad大0.1mm
&&4)SOLDMASK&:阻焊层,使铜箔裸露可以涂覆大0.1mm;
&&5)PASTMASK&:胶贴或钢网同样大小;
&&6)FileMASK:预留层,一般不做设置,做着跟soldmask一般大小;
在有些教程中,对thermal&和anti的设置较大,比regular大20mil或小一点;
有个比较偷懒的办法是从现成的brd文件中导出封装,具体就是打开brd文件,File-&export-&libraries,即可导出封装。网上有的说把protel的封装导入allegro中,在我的软件里没有成功,可能是没有Layout的问题。还有还有一种方法:用PADS自带的转换工具,将protel文件转换成PADS的PCB文件,再导入到allegro一种方法:用PADS自带的转换工具,将protel文件转换成PADS的PCB文件,再导入到allegro,这个方法没有试过,因为自己作封装的麻烦程度也差不多了。
三、cadence电路板的制作
&&&打开PCB&&Editer选择allegro&PCB&design&GXL16.3,file、new、即可建立,由于是看于博士的教程学习,习惯使用手动建立选择board。
&&&1、设置图纸大小,右键,Uquick&Utillity、可以是在图纸和栅格显示。
&&&2、建立电路板外框
Add、Line,在右边的Option页中,选择Active&Class为Board&Geometry,在Active&Subclass中选择Outline。使用命令行即可输入,X&*&*,标示绝对坐标,ix或iy是相对坐标;
&&&3、放置安装孔
在Place、Manualy、Placement中单击Advanced&Setting页面,勾选Library。在Placement&List中选择Mechanical,使用坐标定位即可。在于博士教程中使用的是自己建立的通孔焊盘。
&&&4、设置容许摆放区域
Setup、Areas、Package&Keepin,确认在Option控制面板中为Package&Keepin/All,使用坐标画出一个图形就是摆放区域;
&&&5、设置容许布线区域
Setup、Areas、Route&Keepin命令,在Option中确认为Route&&Keepin/All,划定布线区域。可以使用Z-Copy命令。
在《Cadence高速电路板设计与仿真》中,还有关于禁止布线区域设置、电路机械符号设置,在这里跟于博士的教程有些不太一样,这里遵循于博士的方法。
6、设置电路板的层叠结构
Setup、crosssecton,电源层使用的是plan
7、对电源层和底层铺通。
Z-Copy,在Find里面设置Shape,其他的全部关掉,Option:ETCH/GND,选择Shape&Option。
8、导入网表
使用的命令是,File-&Import:logic。在这里选择cis导出的网络表格,如果没有错误和警报,即可进入布局布线。出问题一般是因为封装的制作问题使得调用的封装处错误,在摆放此元件的时候会显示错无得原因。
9、元件的摆放操作
在Place-&manuly里面,选择需要放置的元器件,然后把鼠标挪动到allegro其他地方,这个元件就会跟着鼠标走,可以同时选择多个元件,放置完一个后会在放置下一个。也可以使用Place、QuickPlace一下吧全部的元件放置到版图中,跟protel一样。
可以与原理图交互放置,在allgro中点击place、manully,然后在原理图中点击这个元件,在把鼠标挪动到allgro中就会把把元件放置到这个位置。在16.3中这个功能是默认设置,如果没有这个设置,可以在CIS中点击DSN文件,在Option-&Preference-&Miscellaneous中选择Enabled&Intertool&Communition。这样就可以使用这个功能了。
&对于元件摆放中的命令一般是mirro和Rotate,进行正面摆放和旋转,对旋转角度的控制在,Option的More&option中设置旋转角度就可以了。
&还有一些其他的放置方法,但感觉着三个就够了。没有学。
10、设置布线规则
规则的设定主要在Setup中Constraints下设置Physical和Spacing,Spacing主要设置个中事务之间的&&&&&&&&
间距,在Physical中设置线宽和过孔。这里没有学习高级的设置,感觉在绘制线路的时候进行调整线宽挺好,只是各种事物之间的间距需要认真设置。
&&&&&11、对飞线的隐藏
Display-&Show&Rats和Blank&Rats中设置,里面的具体意义估计能够看一看就能够明白了,总共那几个命令,都试一下挺不错的。
&&&&&12、对电源网络的高亮显示
Display-&Assign&Color,使用者命令之后,在Find中选择nets对其他的选项不选,然后再Option中点击一个颜色后到allgro中点击这个网络中的一个引脚,就可以把这个网络中的所有引脚设置为高亮。
&&&&&13、引脚的自动扇出
Rout-&PCB&Router,Fanout&by&pick&命令可以对特定的芯片进行扇出,在Find中选择Comps,然后点击某个元件就可以了。
&&&&&14、铺铜
铺通的命令是,在Shape-&绘图命令一般是矩形在Option中选择铺铜层和动态铜皮,也可以同时选择网络也可在铺完后,右键Assign&net。
静态铜铺设方法雷同,一般铺完静态铜会加一个合并的命令,命令如下:Shape-&Murge&Shapes.然后选择需要合并的命令,这些合并的区域必须属于一个网络。
&&15、分割电源层
进行显示设置;Display-&Color/Visibility,在弹出的Color&Dailog中选择Stack-Up,选中其中Through&all和anti&Etch的交点。
在所需要分割的电源层中使用Add-&Line,在Option中选择Anti&Etch、all,设置Line&Width(即分割后的区域之间的距离),画出一个闭合的区域,对于多个电源需要多个闭合区域,如果不能够画出区域来,使用较粗的线吧各个电源焊盘连接起来也可以。然后使用Edit-&Split&Plane命令,Create命令,在对话框中选择工作层,点击Create,按照提示一步一步的走就行了。&
四&&PCB的后处理
&&&&在于博士的教程中没有那么多的步骤,仅仅是在logic-&rename&进行操作。设置编号的规则。编号:那个层,从哪个层开始,开始位置,方向。
在reference&Designer&Format中设置编号的规则,前缀、上层下层的标识,选择Preserve&Current&Prefix(保留原有的前缀)。
&&&&回注的操作,直接在dsn文件中tool-&backannotated。即可。
编号之后会有DRC错误,是约束规则照成的,这里的DRC作为可以忽略。
1、自动重命名元件序号,
&1)display/Colordisplay命令,打开Color&Dialog对话框,在Global&Visible的off按钮,对提示信息点击yes,就是把所有的显示关闭;
&2)在Compent、Ref&Des中选中&Assembly&top和Assembly&Bottom;Geometry、Board&Geometry中选择Outline;Package&Geometry中选择Assembly&top和Assembly&Bottom;选择Stack_Up,Top选择PIn和Via,Bottom选择Pin;
&3)Logic、Auto&Rename&Refdes、Rename;在弹出的对话框中选择Use&Default&grid和Rename&all&component,重命名所有的组件;在more中有设置,这里使用的是默认设置;点击Rename即可;使用Edit的Text命令,可以手工重命名元件,命令使用方式跟其他命令一样;
&4)调整字体大小,Edit&、Change命令,在Find控制栏只选择Text选项,在Option中选择Ref&Des/Assembly&Top,勾选Text&block(设置字体大小的地方);点击文字即可设置大小
&5)使用Edit、move命令可以设置文字的位置。
2、回注(Back&Annotation)
&&&File-&Export-&Logic&命令,在弹出对话框中选择CIS,在这里设置路径,点击Export&CIS的命令,成功后有信息:starting&genfeedformat&/genfeedformat&compeleted&successufully&
&&&在CIS中打开与此电路板对应的原理图,tool、Back&annotated&命令可以吧刚才的标注信息导入到原理图中。
注:在重新编号中发现标号全变成REFT*,不知为何。
2、&&加入测试点
于博士在教程中提到,关于测试点跟工艺流程有关系,每个公司都会有详细的规则手册,对于大批量生产的电路板,使用的时候按照章程即可;
六&&对布线后的电路进行DRC检查:
&&&tool-&Report中选择要检查的项目;
&1、Unconnect&Pin的检查,
&2、Shape&Dynamic&state&&动态铜皮的检查。
&3、DRC&&检查
数据库的检查:Tool&&&Update&DRC,这个命令进行检查。
七&&电路板加工前的准备工作(导出gerber文件)
1、&建立丝印层,
&&&关闭走线线条,打开autosilk_Top
Manufacturer-&Auto&Silkscreen,点击silkScreen,即可,如果原来有丝印层,在这里会给删除,重新编写编号。
2、添加文字性的说明
Add-&text,在Option中选择Manufacturer、Autosilk_Top。
3、钻孔文件&&给数控机床用
设置生成钻孔文件的参数,NC&Parameter,
产生钻孔文件,Manufacturer-》NC-&NC&&drill最好保持默认设置,点击drill。生成钻孔表和钻孔图,NC&-&Drill&Legend,生成钻孔表和图,
&&&&&4、出光绘文件&
Manufacturer-》Artwork,输出格式gerber&RS274X。
&七&&allegro其他的高级功能
&&1、数据库写保护,&&&File&、Properties中可以对设计进行加锁,选中其中的Disable&export&of&design&data,&&&&&&&&&&&&&&&&注:一旦数据库密码遗忘,则无法再对文件进行操作;
&&2、解锁&&&同样是file、Properties中点击Unlock命令,输入先前的密码即可解除锁定;
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。}

我要回帖

更多关于 实用common lisp编程 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信