468,293 Members | 1,853 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,293 developers. It's quick & easy.

Data Structures - Getting started..

Hi all,

I have a primitive data structure which looks like this.

cells = [{'name': 'AND2X1',
'pins': [{'direction': 'input', 'name': 'A', 'type':
'signal'},
{'direction': 'input', 'name': 'B', 'type':
'signal'},
{'direction': 'output', 'name': 'Y', 'type':
'signal'},
{'direction': 'inout', 'name': 'VDD', 'type':
'power'},
{'direction': 'inout', 'name': 'VSS', 'type':
'ground'}],
'type': None},
{'name': 'AND2X2',
'pins': [{'direction': 'input', 'name': 'A', 'type':
'signal'},
{'direction': 'input', 'name': 'B', 'type':
'signal'},
{'direction': 'output', 'name': 'Y', 'type':
'signal'},
{'direction': 'inout', 'name': 'VDD', 'type':
'power'},
{'direction': 'inout', 'name': 'VSS', 'type':
'ground'}],
'type': None},]

I want to make me a 'more better' data structure where I could do the
following:

lef = IP() # My new fangled data structure
lef.add("AND2X1")
lef.AND2X.type("stdcell")
lef.AND2X.pin.add("A")
lef.AND2X.pin.A.direction=("Input")
lef.AND2X.pin.add("B")
lef.AND2X.pin.A.direction=("Input")
lef.AND2X.pin.add("Y")
lef.AND2X.pin.A.direction=("Output")
lef.AND2X.pin.A.type=("signal")

lef.add("AND3X1")
lef.AND2X.type("stdcell")
lef.AND2X.pin.add("A")
lef.AND2X.pin.A.direction=("Input")
lef.AND2X.pin.add("B")
lef.AND2X.pin.A.direction=("Input")
lef.AND2X.pin.add("Y")
lef.AND2X.pin.A.direction=("Output")
lef.AND2X.pin.A.type=("signal")

print lef.asList() # Would return ["AND2X1",
"AND3X1"]
print lef.AND2X1.pins.asList() # Would return ["A", "B", "Y"]

for x in lef:
print x.name # Would return AND2X1
print x.type # Would return stdcell (if used)
print x.pins # Would return pins (if used)

Can anyone get me started?
Jun 27 '08 #1
0 566

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by el_roachmeister | last post: by
4 posts views Thread by Thomas Paul Diffenbach | last post: by
4 posts views Thread by Dave | last post: by
3 posts views Thread by osp | last post: by
13 posts views Thread by jehugaleahsa | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.