[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-bug: problem with tragesym
I am really a n00b at geda in general, but I recently tried to follow this guide:
http://geda.seul.org/wiki/geda:tragesym_tutorial
I (think) the steps were clear and simple enough to follow, I used a combination of OOo and vim to setup a tab separated
file and it looked OK to me, but when I tried:
$ /usr/bin/tragesym mega164p.csv mega164p2.sch
Traceback (most recent call last):
File "/usr/bin/tragesym", line 599, in <module>
opts,attr,pins=readsrc(file_in)
File "/usr/bin/tragesym", line 209, in readsrc
geda_attr[(string.strip(element[0]),nr)]=string.strip(element[1])
IndexError: list index out of range
not so good, so I tweaked tragesym a bit and it seems to have worked. I claim no expertise with python or geda so
attached is a patch and the relevant files.
mega164p.csv (tab separated file for tragesym)
mega164p.sch (symbol output after my hacking)
tragesym.diff
[options]
# rotate_labels rotates the pintext of top and bottom pins
# this is useful for large symbols like FPGAs with more than 100 pins
# sort_labels will sort the pins by it's labels
# useful for address ports, busses, ...
wordswap yes
rotate_labels no
sort_labels no
generate_pinseq yes
sym_width 5000
pinwidthvertical 400
pinwidthhorizontal 400
[geda_attr]
# name will be printed in the top of the symbol
# if you have a device with slots, you'll have to use slot= and slotdef=
# use comment= if there are special information you want to add
version 20090409
name ATMEGA164P/324P/644P
device ATMEGA164P
refdes U?
footprint DIP40
description Atmel 8-bit microprocessor
documentation
author Perry Hargrave
numslots 0
dist-license
use-license
[pins]
# tabseparated list of pin descriptions
#
# pinnr is the physical number of the pin
# seq is the pinseq= attribute, leave it blank if it doesn't matter
# type can be (in, out, io, oc, oe, pas, tp, tri, clk, pwr)
# style can be (line,dot,clk,dotclk,none). none if only want to add a net
# posit. can be (l,r,t,b) or empty for nets
# net specifies the name of the net. Vcc or GND for example.
# label represents the pinlabel.
# negation lines can be added with "\_" example: \_enable\_
# if you want to write a "\" use "\\" as escape sequence
#
#pinnr seq type style posit. net label
1 1 io line l (PCINT8/XCK0)PB0
2 2 io line l (PCINT9/CLKO)PB1
3 3 io line l (PCINT10/INT2)PB2
4 4 io line l (PCINT11/OC0A)PB3
5 5 io line l (PCINT12/OC0B)PB4
6 6 io line l (PCINT13/MOSI)PB5
7 7 io line l (PCINT14/MISO)PB6
8 8 io line l (PCINT15/SCK)PB7
9 9 in dot l RST \_RESET\_
10 10 pwr line l Vcc VCC
11 11 pwr line l GND GND
12 12 out clk l XTAL2
13 13 out clk l XTAL1
14 14 in line l (PCINT24/RXD0)PD0
15 15 out line l (PCINT25/TXD0)PD1
16 16 in line l (PCINT26/RXD1)PD2
17 17 out line l (PCINT27/TXD1)PD3
18 18 io line l (PCINT28/XCK1)PD4
19 19 io line l (PCINT29/OC1A)PD5
20 20 io line l (PCINT30/OC2B)PD6
21 40 io line r PA0(ADC0/PCINT0)
22 39 io line r PA1(ADC1/PCINT1)
23 38 io line r PA2(ADC2/PCINT2)
24 37 io line r PA3(ADC3/PCINT3)
25 36 io line r PA4(ADC4/PCINT4)
26 35 io line r PA5(ADC5/PCINT5)
27 34 io line r PA6(ADC6/PCINT6)
28 33 io line r PA7(ADC7/PCINT7)
29 32 pas line r AREF
30 31 pwr line r GND GND
31 30 pwr line r AVCC AVCC
32 29 io line r PC7(TOSC2/PCINT23)
33 28 io line r PC6(TOSC1/PCINT22)
34 27 io line r PC5(TDI/PCINT21)
35 26 io line r PC4(TDO/PCINT20)
36 25 io line r PC3(TMS/PCINT19)
37 24 io line r PC2(TCK/PCINT18)
38 23 io line r PC1(SDA/PCINT17)
39 22 io line r PC0(SCL/PCINT16)
40 21 io line r PD7(OC2A/PCINT31)
v 20090409 1
P 100 8100 400 8100 1 0 0
{
T 300 8150 5 8 1 1 0 6 1
pinnumber=1
T 300 8050 5 8 0 1 0 8 1
pinseq=1
T 450 8100 9 8 1 1 0 0 1
pinlabel=(PCINT8/XCK0)PB0
T 450 8100 5 8 0 1 0 2 1
pintype=io
}
P 100 7700 400 7700 1 0 0
{
T 300 7750 5 8 1 1 0 6 1
pinnumber=2
T 300 7650 5 8 0 1 0 8 1
pinseq=2
T 450 7700 9 8 1 1 0 0 1
pinlabel=(PCINT9/CLKO)PB1
T 450 7700 5 8 0 1 0 2 1
pintype=io
}
P 100 7300 400 7300 1 0 0
{
T 300 7350 5 8 1 1 0 6 1
pinnumber=3
T 300 7250 5 8 0 1 0 8 1
pinseq=3
T 450 7300 9 8 1 1 0 0 1
pinlabel=(PCINT10/INT2)PB2
T 450 7300 5 8 0 1 0 2 1
pintype=io
}
P 100 6900 400 6900 1 0 0
{
T 300 6950 5 8 1 1 0 6 1
pinnumber=4
T 300 6850 5 8 0 1 0 8 1
pinseq=4
T 450 6900 9 8 1 1 0 0 1
pinlabel=(PCINT11/OC0A)PB3
T 450 6900 5 8 0 1 0 2 1
pintype=io
}
P 100 6500 400 6500 1 0 0
{
T 300 6550 5 8 1 1 0 6 1
pinnumber=5
T 300 6450 5 8 0 1 0 8 1
pinseq=5
T 450 6500 9 8 1 1 0 0 1
pinlabel=(PCINT12/OC0B)PB4
T 450 6500 5 8 0 1 0 2 1
pintype=io
}
P 100 6100 400 6100 1 0 0
{
T 300 6150 5 8 1 1 0 6 1
pinnumber=6
T 300 6050 5 8 0 1 0 8 1
pinseq=6
T 450 6100 9 8 1 1 0 0 1
pinlabel=(PCINT13/MOSI)PB5
T 450 6100 5 8 0 1 0 2 1
pintype=io
}
P 100 5700 400 5700 1 0 0
{
T 300 5750 5 8 1 1 0 6 1
pinnumber=7
T 300 5650 5 8 0 1 0 8 1
pinseq=7
T 450 5700 9 8 1 1 0 0 1
pinlabel=(PCINT14/MISO)PB6
T 450 5700 5 8 0 1 0 2 1
pintype=io
}
P 100 5300 400 5300 1 0 0
{
T 300 5350 5 8 1 1 0 6 1
pinnumber=8
T 300 5250 5 8 0 1 0 8 1
pinseq=8
T 450 5300 9 8 1 1 0 0 1
pinlabel=(PCINT15/SCK)PB7
T 450 5300 5 8 0 1 0 2 1
pintype=io
}
P 100 4900 300 4900 1 0 0
{
T 300 4950 5 8 1 1 0 6 1
pinnumber=9
T 300 4850 5 8 0 1 0 8 1
pinseq=9
T 450 4900 9 8 1 1 0 0 1
pinlabel=\_RESET\_
T 450 4900 5 8 0 1 0 2 1
pintype=in
}
V 350 4900 50 6 0 0 0 -1 -1 0 -1 -1 -1 -1 -1
P 100 4500 400 4500 1 0 0
{
T 300 4550 5 8 1 1 0 6 1
pinnumber=10
T 300 4450 5 8 0 1 0 8 1
pinseq=10
T 450 4500 9 8 1 1 0 0 1
pinlabel=VCC
T 450 4500 5 8 0 1 0 2 1
pintype=pwr
}
P 100 4100 400 4100 1 0 0
{
T 300 4150 5 8 1 1 0 6 1
pinnumber=11
T 300 4050 5 8 0 1 0 8 1
pinseq=11
T 450 4100 9 8 1 1 0 0 1
pinlabel=GND
T 450 4100 5 8 0 1 0 2 1
pintype=pwr
}
P 100 3700 400 3700 1 0 0
{
T 300 3750 5 8 1 1 0 6 1
pinnumber=12
T 300 3650 5 8 0 1 0 8 1
pinseq=12
T 525 3700 9 8 1 1 0 0 1
pinlabel=XTAL2
T 525 3700 5 8 0 1 0 2 1
pintype=out
}
L 500 3700 400 3775 3 0 0 0 -1 -1
L 500 3700 400 3625 3 0 0 0 -1 -1
P 100 3300 400 3300 1 0 0
{
T 300 3350 5 8 1 1 0 6 1
pinnumber=13
T 300 3250 5 8 0 1 0 8 1
pinseq=13
T 525 3300 9 8 1 1 0 0 1
pinlabel=XTAL1
T 525 3300 5 8 0 1 0 2 1
pintype=out
}
L 500 3300 400 3375 3 0 0 0 -1 -1
L 500 3300 400 3225 3 0 0 0 -1 -1
P 100 2900 400 2900 1 0 0
{
T 300 2950 5 8 1 1 0 6 1
pinnumber=14
T 300 2850 5 8 0 1 0 8 1
pinseq=14
T 450 2900 9 8 1 1 0 0 1
pinlabel=(PCINT24/RXD0)PD0
T 450 2900 5 8 0 1 0 2 1
pintype=in
}
P 100 2500 400 2500 1 0 0
{
T 300 2550 5 8 1 1 0 6 1
pinnumber=15
T 300 2450 5 8 0 1 0 8 1
pinseq=15
T 450 2500 9 8 1 1 0 0 1
pinlabel=(PCINT25/TXD0)PD1
T 450 2500 5 8 0 1 0 2 1
pintype=out
}
P 100 2100 400 2100 1 0 0
{
T 300 2150 5 8 1 1 0 6 1
pinnumber=16
T 300 2050 5 8 0 1 0 8 1
pinseq=16
T 450 2100 9 8 1 1 0 0 1
pinlabel=(PCINT26/RXD1)PD2
T 450 2100 5 8 0 1 0 2 1
pintype=in
}
P 100 1700 400 1700 1 0 0
{
T 300 1750 5 8 1 1 0 6 1
pinnumber=17
T 300 1650 5 8 0 1 0 8 1
pinseq=17
T 450 1700 9 8 1 1 0 0 1
pinlabel=(PCINT27/TXD1)PD3
T 450 1700 5 8 0 1 0 2 1
pintype=out
}
P 100 1300 400 1300 1 0 0
{
T 300 1350 5 8 1 1 0 6 1
pinnumber=18
T 300 1250 5 8 0 1 0 8 1
pinseq=18
T 450 1300 9 8 1 1 0 0 1
pinlabel=(PCINT28/XCK1)PD4
T 450 1300 5 8 0 1 0 2 1
pintype=io
}
P 100 900 400 900 1 0 0
{
T 300 950 5 8 1 1 0 6 1
pinnumber=19
T 300 850 5 8 0 1 0 8 1
pinseq=19
T 450 900 9 8 1 1 0 0 1
pinlabel=(PCINT29/OC1A)PD5
T 450 900 5 8 0 1 0 2 1
pintype=io
}
P 100 500 400 500 1 0 0
{
T 300 550 5 8 1 1 0 6 1
pinnumber=20
T 300 450 5 8 0 1 0 8 1
pinseq=20
T 450 500 9 8 1 1 0 0 1
pinlabel=(PCINT30/OC2B)PD6
T 450 500 5 8 0 1 0 2 1
pintype=io
}
P 5700 8100 5400 8100 1 0 0
{
T 5500 8150 5 8 1 1 0 0 1
pinnumber=21
T 5500 8050 5 8 0 1 0 2 1
pinseq=21
T 5350 8100 9 8 1 1 0 6 1
pinlabel=PA0(ADC0/PCINT0)
T 5350 8100 5 8 0 1 0 8 1
pintype=io
}
P 5700 7700 5400 7700 1 0 0
{
T 5500 7750 5 8 1 1 0 0 1
pinnumber=22
T 5500 7650 5 8 0 1 0 2 1
pinseq=22
T 5350 7700 9 8 1 1 0 6 1
pinlabel=PA1(ADC1/PCINT1)
T 5350 7700 5 8 0 1 0 8 1
pintype=io
}
P 5700 7300 5400 7300 1 0 0
{
T 5500 7350 5 8 1 1 0 0 1
pinnumber=23
T 5500 7250 5 8 0 1 0 2 1
pinseq=23
T 5350 7300 9 8 1 1 0 6 1
pinlabel=PA2(ADC2/PCINT2)
T 5350 7300 5 8 0 1 0 8 1
pintype=io
}
P 5700 6900 5400 6900 1 0 0
{
T 5500 6950 5 8 1 1 0 0 1
pinnumber=24
T 5500 6850 5 8 0 1 0 2 1
pinseq=24
T 5350 6900 9 8 1 1 0 6 1
pinlabel=PA3(ADC3/PCINT3)
T 5350 6900 5 8 0 1 0 8 1
pintype=io
}
P 5700 6500 5400 6500 1 0 0
{
T 5500 6550 5 8 1 1 0 0 1
pinnumber=25
T 5500 6450 5 8 0 1 0 2 1
pinseq=25
T 5350 6500 9 8 1 1 0 6 1
pinlabel=PA4(ADC4/PCINT4)
T 5350 6500 5 8 0 1 0 8 1
pintype=io
}
P 5700 6100 5400 6100 1 0 0
{
T 5500 6150 5 8 1 1 0 0 1
pinnumber=26
T 5500 6050 5 8 0 1 0 2 1
pinseq=26
T 5350 6100 9 8 1 1 0 6 1
pinlabel=PA5(ADC5/PCINT5)
T 5350 6100 5 8 0 1 0 8 1
pintype=io
}
P 5700 5700 5400 5700 1 0 0
{
T 5500 5750 5 8 1 1 0 0 1
pinnumber=27
T 5500 5650 5 8 0 1 0 2 1
pinseq=27
T 5350 5700 9 8 1 1 0 6 1
pinlabel=PA6(ADC6/PCINT6)
T 5350 5700 5 8 0 1 0 8 1
pintype=io
}
P 5700 5300 5400 5300 1 0 0
{
T 5500 5350 5 8 1 1 0 0 1
pinnumber=28
T 5500 5250 5 8 0 1 0 2 1
pinseq=28
T 5350 5300 9 8 1 1 0 6 1
pinlabel=PA7(ADC7/PCINT7)
T 5350 5300 5 8 0 1 0 8 1
pintype=io
}
P 5700 4900 5400 4900 1 0 0
{
T 5500 4950 5 8 1 1 0 0 1
pinnumber=29
T 5500 4850 5 8 0 1 0 2 1
pinseq=29
T 5350 4900 9 8 1 1 0 6 1
pinlabel=AREF
T 5350 4900 5 8 0 1 0 8 1
pintype=pas
}
P 5700 4500 5400 4500 1 0 0
{
T 5500 4550 5 8 1 1 0 0 1
pinnumber=30
T 5500 4450 5 8 0 1 0 2 1
pinseq=30
T 5350 4500 9 8 1 1 0 6 1
pinlabel=GND
T 5350 4500 5 8 0 1 0 8 1
pintype=pwr
}
P 5700 4100 5400 4100 1 0 0
{
T 5500 4150 5 8 1 1 0 0 1
pinnumber=31
T 5500 4050 5 8 0 1 0 2 1
pinseq=31
T 5350 4100 9 8 1 1 0 6 1
pinlabel=AVCC
T 5350 4100 5 8 0 1 0 8 1
pintype=pwr
}
P 5700 3700 5400 3700 1 0 0
{
T 5500 3750 5 8 1 1 0 0 1
pinnumber=32
T 5500 3650 5 8 0 1 0 2 1
pinseq=32
T 5350 3700 9 8 1 1 0 6 1
pinlabel=PC7(TOSC2/PCINT23)
T 5350 3700 5 8 0 1 0 8 1
pintype=io
}
P 5700 3300 5400 3300 1 0 0
{
T 5500 3350 5 8 1 1 0 0 1
pinnumber=33
T 5500 3250 5 8 0 1 0 2 1
pinseq=33
T 5350 3300 9 8 1 1 0 6 1
pinlabel=PC6(TOSC1/PCINT22)
T 5350 3300 5 8 0 1 0 8 1
pintype=io
}
P 5700 2900 5400 2900 1 0 0
{
T 5500 2950 5 8 1 1 0 0 1
pinnumber=34
T 5500 2850 5 8 0 1 0 2 1
pinseq=34
T 5350 2900 9 8 1 1 0 6 1
pinlabel=PC5(TDI/PCINT21)
T 5350 2900 5 8 0 1 0 8 1
pintype=io
}
P 5700 2500 5400 2500 1 0 0
{
T 5500 2550 5 8 1 1 0 0 1
pinnumber=35
T 5500 2450 5 8 0 1 0 2 1
pinseq=35
T 5350 2500 9 8 1 1 0 6 1
pinlabel=PC4(TDO/PCINT20)
T 5350 2500 5 8 0 1 0 8 1
pintype=io
}
P 5700 2100 5400 2100 1 0 0
{
T 5500 2150 5 8 1 1 0 0 1
pinnumber=36
T 5500 2050 5 8 0 1 0 2 1
pinseq=36
T 5350 2100 9 8 1 1 0 6 1
pinlabel=PC3(TMS/PCINT19)
T 5350 2100 5 8 0 1 0 8 1
pintype=io
}
P 5700 1700 5400 1700 1 0 0
{
T 5500 1750 5 8 1 1 0 0 1
pinnumber=37
T 5500 1650 5 8 0 1 0 2 1
pinseq=37
T 5350 1700 9 8 1 1 0 6 1
pinlabel=PC2(TCK/PCINT18)
T 5350 1700 5 8 0 1 0 8 1
pintype=io
}
P 5700 1300 5400 1300 1 0 0
{
T 5500 1350 5 8 1 1 0 0 1
pinnumber=38
T 5500 1250 5 8 0 1 0 2 1
pinseq=38
T 5350 1300 9 8 1 1 0 6 1
pinlabel=PC1(SDA/PCINT17)
T 5350 1300 5 8 0 1 0 8 1
pintype=io
}
P 5700 900 5400 900 1 0 0
{
T 5500 950 5 8 1 1 0 0 1
pinnumber=39
T 5500 850 5 8 0 1 0 2 1
pinseq=39
T 5350 900 9 8 1 1 0 6 1
pinlabel=PC0(SCL/PCINT16)
T 5350 900 5 8 0 1 0 8 1
pintype=io
}
P 5700 500 5400 500 1 0 0
{
T 5500 550 5 8 1 1 0 0 1
pinnumber=40
T 5500 450 5 8 0 1 0 2 1
pinseq=40
T 5350 500 9 8 1 1 0 6 1
pinlabel=PD7(OC2A/PCINT31)
T 5350 500 5 8 0 1 0 8 1
pintype=io
}
B 400 100 5000 8400 3 0 0 0 -1 -1 0 -1 -1 -1 -1 -1
T 5400 8600 8 10 1 1 0 6 1
refdes=U?
T 400 8600 9 10 1 0 0 0 1
ATMEGA164P/324P/644P
T 400 8800 5 10 0 0 0 0 1
device=ATMEGA164P
T 400 9000 5 10 0 0 0 0 1
footprint=DIP40
T 400 9200 5 10 0 0 0 0 1
author=Perry Hargrave
T 400 9400 5 10 0 0 0 0 1
description=Atmel 8-bit microprocessor
T 400 9600 5 10 0 0 0 0 1
numslots=0
--- /usr/bin/tragesym 2009-03-20 08:48:02.000000000 -0700
+++ /home/perry/.bin/tragesym 2009-04-09 23:39:46.000000000 -0700
@@ -206,7 +206,8 @@
nr=1
while geda_attr.has_key((element[0],nr)):
nr=nr+1
- geda_attr[(string.strip(element[0]),nr)]=string.strip(element[1])
+ if len(element) > 1:
+ geda_attr[(string.strip(element[0]),nr)]=string.strip(element[1])
elif section=="pins":
element=string.split(line,"\t")
if len(element) > 2:
_______________________________________________
geda-bug mailing list
geda-bug@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-bug