delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2014/10/18/07:21:40

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
Date: Sat, 18 Oct 2014 13:20:58 +0200 (CEST)
X-X-Sender: igor2 AT igor2priv
To: geda-user AT delorie DOT com
X-Debug: to=geda-user AT delorie DOT com from="gedau AT igor2 DOT repo DOT hu"
From: gedau AT igor2 DOT repo DOT hu
Subject: Re: [geda-user] gnetlist backend
In-Reply-To: <alpine.DEB.2.00.1410181058460.3358@igor2priv>
Message-ID: <alpine.DEB.2.00.1410181313120.3358@igor2priv>
References: <alpine DOT DEB DOT 2 DOT 00 DOT 1410181058460 DOT 3358 AT igor2priv>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
MIME-Version: 1.0
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--0-1363946753-1413631258=:3358
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed



On Sat, 18 Oct 2014, gedau AT igor2 DOT repo DOT hu wrote:

> 1. is there a ready-to-use gnetlist backend that prints the netlist in some 
> easy-to-process text format and prints _all_ attributes of all components in 
> an also easy-to-process format?

I have a working prototype already (attached). It's a copy of the osmond 
backend. Please note that I don't know anything about scheme, so my code 
may look strange.

The output is one-line-per-record with fields separated by tab. First 
field is record type. Things are announced before details are given, e.g. 
before listing pin attributes the pin names of the element is listed.

I couldn't figure how to:

- get a list of attribute names attached to a net

- access attributes attached to a net, other than its netname

- get a list of attribute names attached to a pin

Could someone help with these so I can make the backend more generic?

Once this works, as I'm already knee-deep in scheme I will probably 
bite the bullet and write a few other similar backends, exporting to 
lihata, xml, indented text and json (in this order of priority).

TIA,

Tibor
--0-1363946753-1413631258=:3358
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=gnet-dumptext.scm
Content-Transfer-Encoding: BASE64
Content-ID: <alpine DOT DEB DOT 2 DOT 00 DOT 1410181320580 DOT 3358 AT igor2priv>
Content-Description: 
Content-Disposition: attachment; filename=gnet-dumptext.scm

Ozs7IGdFREEgLSBHUEwgRWxlY3Ryb25pYyBEZXNpZ24gQXV0b21hdGlvbg0K
Ozs7IGduZXRsaXN0IGJhY2sgZW5kIGZvciBkdW1waW5nIGFsbCBhdHRyaWJ1
dGVzIGFuZCBuZXRsaXN0IGluIHRleHQgZm9ybWF0DQo7OzsgQ29weXJpZ2h0
IChDKSAyMDE0IFRpYm9yICdJZ29yMicgUGFsaW5rYXMNCjs7Ow0KOzs7IFRo
aXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJp
YnV0ZSBpdCBhbmQvb3IgbW9kaWZ5DQo7OzsgaXQgdW5kZXIgdGhlIHRlcm1z
IG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhcyBwdWJsaXNo
ZWQgYnkNCjs7OyB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uOyBlaXRo
ZXIgdmVyc2lvbiAyIG9mIHRoZSBMaWNlbnNlLCBvcg0KOzs7IChhdCB5b3Vy
IG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uDQo7OzsNCjs7OyBUaGlzIHBy
b2dyYW0gaXMgZGlzdHJpYnV0ZWQgaW4gdGhlIGhvcGUgdGhhdCBpdCB3aWxs
IGJlIHVzZWZ1bCwNCjs7OyBidXQgV0lUSE9VVCBBTlkgV0FSUkFOVFk7IHdp
dGhvdXQgZXZlbiB0aGUgaW1wbGllZCB3YXJyYW50eSBvZg0KOzs7IE1FUkNI
QU5UQUJJTElUWSBvciBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9T
RS4gIFNlZSB0aGUNCjs7OyBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZ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G9y
dCkNCg0KCSAgICAgICAobmV3bGluZSBwb3J0KQ0KCSAgICAgICAoZHVtcHRl
eHQ6d3JpdGUtc2lnbmFsIHBvcnQgKGNkciBzaWduYWxzKSkpKSkpKQ0KCSAg
ICAgICAgICAgICAgDQo7Ow0KOzsgV3JpdGUgb3V0IGFsbCB0aGUgc2lnbmFs
cw0KOzsJICAgICAgIA0KKGRlZmluZSBkdW1wdGV4dDpzaWduYWwNCiAgIChs
YW1iZGEgKHBvcnQpDQogICAgICAobGV0ICgoYWxsLXVuaXEtbmV0cyAoZ25l
dGxpc3Q6Z2V0LWFsbC11bmlxdWUtbmV0cyAiZHVtbXkiKSkpDQogICAgICAg
ICAoZHVtcHRleHQ6d3JpdGUtc2lnbmFsIHBvcnQgYWxsLXVuaXEtbmV0cykp
KSkNCg0KDQooZGVmaW5lIGR1bXB0ZXh0IA0KICAgKGxhbWJkYSAob3V0cHV0
LWZpbGVuYW1lKQ0KICAgICAgKGxldCAoKHBvcnQgKG9wZW4tb3V0cHV0LWZp
bGUgb3V0cHV0LWZpbGVuYW1lKSkpDQogICAgICAgICAoYmVnaW4NCgkgICAg
KGR1bXB0ZXh0OnBhcnRzIHBvcnQgcGFja2FnZXMpDQoJICAgIChkdW1wdGV4
dDpzaWduYWwgcG9ydCkNCiAgICAgICAgICkNCiAgICAgICAgIChjbG9zZS1v
dXRwdXQtcG9ydCBwb3J0KSkpKQ0K

--0-1363946753-1413631258=:3358--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019