← Back to team overview

kicad-developers team mailing list archive

EEschema Netlist proposed change

 

I've been working with EDIF from OrCad and been running into different
power netnames cellrefing the same library symbol. The EEscheme
netlister looks for pin properties: PIN_POWER_IN, PINNOTDRAW 
I discovered by code review that currently each power net 
requires a separate library symbol be defined, optionaly a net 
label could be used. I propose we lack this requirement and pick 
up the pin name from the VALUE set in the component instance:

library def:
#
# VCC
#
DEF VCC #PWR 0 30 Y Y 1 0 N
F0 "#PWR" 0 0 50 H V
F1 "VCC" 0 0 50 H V
DRAW
X VCC 1 100 -100 0 U 49 49 1 1 W N
C 100 -30 60 0 1 0
P 2 0 1 0 100 -100 100 -60
ENDDRAW
ENDDEF

sch instance:
$Comp
L VCC #PWR1
U 1 1 47CC47B2
P 2700 1700
F 0 "#PWR1" H 2550 1800 50 0000 C C
F 1 "+5V" H 2600 1700 50 0000 C C
1 2700 1700
1 0 0 -1
$EndComp

The following contains test1.sch with netlist after modifing
eeschema/netlist.cpp
http://f1.grp.yahoofs.com/v1/MLvMR_5W5uM3T92gPDctMngqgZAd3PUEz6CRmc9pcu3QVdMkmQFTIUyBfRifGtXKbn8Ah7JSY1S1MIztxtu3f89JUTYsHS2pb_9PKg/powerNet1.sh

This change seems to be backward compatible with existing schematics/
netlists using the previous scheme. Here is the context diff:

*** netlist.cpp.orig 2008-03-03 16:17:18.000000000 -0700
--- netlist.cpp 2008-03-03 19:44:01.000000000 -0700
***************
*** 630,636 ****
ObjNet[NbrItem].m_Comp = NULL;
ObjNet[NbrItem].m_SheetList = *sheetlist;
ObjNet[NbrItem].m_Type = NET_PINLABEL;
! ObjNet[NbrItem].m_Label = &Pin->m_PinName;
ObjNet[NbrItem].m_Start.x = x2;
ObjNet[NbrItem].m_Start.y = y2;
ObjNet[NbrItem].m_End =
ObjNet[NbrItem].m_Start;
--- 630,636 ----
ObjNet[NbrItem].m_Comp = NULL;
ObjNet[NbrItem].m_SheetList = *sheetlist;
ObjNet[NbrItem].m_Type = NET_PINLABEL;
! ObjNet[NbrItem].m_Label =
&DrawLibItem->m_Field[VALUE].m_Text; // fwb
ObjNet[NbrItem].m_Start.x = x2;
ObjNet[NbrItem].m_Start.y = y2;
ObjNet[NbrItem].m_End =
ObjNet[NbrItem].m_Start;


Comments?
Frank