From bb055fa2094a7b7cb8f96e67c1a46db4856146a2 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 20 Dec 2012 22:03:58 -0300 Subject: [PATCH] experimental directive "allow holes" to allow multiple holes per pad This is for thermal vias and the unusual grounding method NXP use in their HVQFN33 footprints. --- README | 9 ++++++++- dump.c | 2 ++ fpd.l | 1 + fpd.y | 24 +++++++++++++++++++----- hole.c | 11 ++++++----- hole.h | 6 +++--- obj.c | 3 ++- obj.h | 1 + 8 files changed, 42 insertions(+), 15 deletions(-) diff --git a/README b/README index e8aca0a..c58fd41 100644 --- a/README +++ b/README @@ -177,7 +177,14 @@ allow overlap Do not check for overlaps at all. If the "allow" directive is omitted, fped defaults to allowing -neigher overlap nor touch. +neither overlap nor touch. + +There is also the following experimental directive that can be used +alone or without one of the overlap-checking directives: + +allow holes + +Allow multiple holes per pad. Vectors diff --git a/dump.c b/dump.c index cf874d4..26f96f4 100644 --- a/dump.c +++ b/dump.c @@ -591,6 +591,8 @@ static void dump_allow(FILE *file) default: abort(); } + if (!holes_linked) + fprintf(file, "allow holes\n"); } diff --git a/fpd.l b/fpd.l index 8265adf..12cd598 100644 --- a/fpd.l +++ b/fpd.l @@ -133,6 +133,7 @@ SP [\t ]* "allow" BEGIN(ALLOW); "overlap" return TOK_ALLOW_OVERLAP; "touch" return TOK_ALLOW_TOUCH; +"holes" return TOK_ALLOW_HOLES; "%del" { BEGIN(NOKEYWORD); return TOK_DBG_DEL; } diff --git a/fpd.y b/fpd.y index 2919961..a6a19de 100644 --- a/fpd.y +++ b/fpd.y @@ -462,7 +462,7 @@ static int dbg_meas(const char *name) %token TOK_DBG_DEL TOK_DBG_MOVE TOK_DBG_FRAME %token TOK_DBG_PRINT TOK_DBG_IPRINT %token TOK_DBG_DUMP TOK_DBG_EXIT TOK_DBG_TSORT TOK_DBG_MEAS -%token TOK_ALLOW_OVERLAP TOK_ALLOW_TOUCH +%token TOK_ALLOW_HOLES TOK_ALLOW_OVERLAP TOK_ALLOW_TOUCH %token NUMBER %token STRING @@ -544,9 +544,16 @@ opt_setup: setup: unit - | allow - | unit allow - | allow unit + | allow_pads + | allow_holes + | unit allow_pads + | unit allow_pads allow_holes + | unit allow_holes + | unit allow_holes allow_pads + | allow_pads unit + | allow_pads unit allow_holes + | allow_holes unit + | allow_holes unit allow_pads ; unit: @@ -565,7 +572,7 @@ unit: } ; -allow: +allow_pads: TOK_ALLOW_TOUCH { allow_overlap = ao_touch; @@ -576,6 +583,13 @@ allow: } ; +allow_holes: + TOK_ALLOW_HOLES + { + holes_linked = 0; + } + ; + frame_defs: | frame_defs frame_def ; diff --git a/hole.c b/hole.c index 1b90995..f72f275 100644 --- a/hole.c +++ b/hole.c @@ -1,8 +1,8 @@ /* * hole.c - Classify holes and connect them with pads * - * Written 2010 by Werner Almesberger - * Copyright 2010 by Werner Almesberger + * Written 2010, 2012 by Werner Almesberger + * Copyright 2010, 2012 by Werner Almesberger * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -73,14 +73,15 @@ static void clear_links(const struct pkg *pkg) } -int link_holes(void) +int link_holes(int linked) { const struct pkg *pkg; for (pkg = pkgs; pkg; pkg = pkg->next) { clear_links(pkg); - if (!connect_holes(pkg)) - return 0; + if (linked) + if (!connect_holes(pkg)) + return 0; } return 1; } diff --git a/hole.h b/hole.h index 6c51ad0..6c04229 100644 --- a/hole.h +++ b/hole.h @@ -1,8 +1,8 @@ /* * hole.h - Classify holes and connect them with pads * - * Written 2010 by Werner Almesberger - * Copyright 2010 by Werner Almesberger + * Written 2010, 2012 by Werner Almesberger + * Copyright 2010, 2012 by Werner Almesberger * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -13,6 +13,6 @@ #ifndef HOLE_H #define HOLE_H -int link_holes(void); +int link_holes(int linked); #endif /* !HOLE_H */ diff --git a/obj.c b/obj.c index 7f3fa73..e6783be 100644 --- a/obj.c +++ b/obj.c @@ -40,6 +40,7 @@ struct frame *frames = NULL; struct frame *active_frame = NULL; void *instantiation_error = NULL; enum allow_overlap allow_overlap = ao_none; +int holes_linked = 1; static struct bitset *frame_set; /* frames visited in "call chain" */ @@ -577,7 +578,7 @@ int instantiate(void) find_vec = NULL; find_obj = NULL; if (ok) - ok = link_holes(); + ok = link_holes(holes_linked); if (ok) ok = refine_layers(allow_overlap); if (ok) diff --git a/obj.h b/obj.h index 2515125..6cd9e6f 100644 --- a/obj.h +++ b/obj.h @@ -255,6 +255,7 @@ extern struct frame *frames; /* root frame first */ extern struct frame *active_frame; extern void *instantiation_error; extern enum allow_overlap allow_overlap; +extern int holes_linked; struct inst;