473,412 Members | 2,142 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

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 669

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Brian McGee | last post by:
If I have two sql server databases that started out with identical table/key/index structures, but were not properly kept in sync, is there any way I can generate a table change script to...
5
by: el_roachmeister | last post by:
For being a good web programmer, is a course on data structures important? It seems php already has built-in functions for what they teach in a data structures course. On the other hand all...
4
by: Thomas Paul Diffenbach | last post by:
Can anyone point me to an open source library of /statically allocated/ data structures? I'm writing some code that would benefit from trees, preferably self balancing, but on an embedded system...
4
by: Dave | last post by:
Hi. I am learning PyOpenGL and I am working with a largish fixed scene composed of several thousand GLtriangles. I plan to store the coords and normals in a NumPy array. Is this the fastest...
3
by: osp | last post by:
hi to every one.... i just started out with c++ and i think i am doing well.i use Robert Laffore to study. which book should i use for data structures ? please help. thank you with regards ...
3
by: Zeke Zinzul | last post by:
Hi Guys & Geeks, What's the most elegant way of dealing with binary data and structures? Say I have this (which I actually do, a woo-hoo): struct Struct_IconHeader { byte width; byte...
2
by: efrat | last post by:
Hello, I'm planning to use Python in order to teach a DSA (data structures and algorithms) course in an academic institute. If you could help out with the following questions, I'd sure...
7
by: canteyn | last post by:
Here is my problem: Structure typedef struct { char lname; char fname; int age; double salary; } employee_t;
13
by: jehugaleahsa | last post by:
Hello: I got tired of trying to find good implementations of collections and other data structures in C#. So, I started implementing my own. However, data structures is a wholly different...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.