As a data structure of small white, for the development of new tools PYCONN data structure selection carried out a large number of ideological struggle and not its fruit, had to start from the data structure based on the process of selection.
A data structure is a form of organization of the relationship between the elements and data elements.
The data structure contains the storage structure, the logical structure, and the operation of the database.
The storage structure is divided into four basic forms:
(1) sequential storage mode. The data elements are stored sequentially, and each storage node contains only one element. The storage location reflects the logical relationship between data elements. Storage density is large, but some operations, such as INSERT, delete, are inefficient.
(2) Chain storage mode. Each storage node contains a set of pointers in addition to the data element information. The pointer reflects the logical relationship between the data elements. This approach does not require contiguous storage space, facilitates dynamic operations (such as insertions, deletions, and so on), but has large storage overhead and is not suitable for random lookups.
(3) How the index is stored. In addition to the data elements stored in an address contiguous memory space, there is a need to establish an Index table, Index Table index indicates the storage node storage location, both static and dynamic characteristics.
(4) hash storage mode. The keyword is hashed in a contiguous, limited address space, and the value of the hash function is interpreted as the storage address of the element where the keyword is located, which is called a hash store. It is characterized by fast access, can only be randomly accessed by the keyword, inconvenient sequential access.
The logical structure is also divided into four basic forms:
(1) Collection
(2) Linear structure
(3) tree-shaped structure
(4) graphic or mesh structure.
Under current conditions, we can almost not relate to the size and continuity of memory space, only seek the efficiency of finding and other operations.
A general judgment, PYCONN storage structure can choose index storage mode or hash storage mode, or mixed form;
The logical structure can be either a tree structure or a graphic/mesh structure.
In a nutshell, a data structure can be expressed in terms of a struct (struct) or class, which we use in Python, so we use class.
Most of the Pyconn are operated on two levels:
1. Finding and modifying instance data elements
2. Finding and modifying the relationship between instance
Consider these two layers as a two-tier data structure, as previously envisioned
The first layer is class instance (instance with level guaranteed uniqueness)
Value mainly includes
A. Examples of forms (module and Param)
B. Connection with other instance
C. resources (Reg, comb, mem)
Storage structure can choose hash storage
Logical structure can be ignored (elements are not dependent on each other)
Basic operation is insert (initialize), find, modify value (divide cause), delete (delete dft/lp connection)
The second tier is the class Instance_tree (System)
Storage structure can choose to chain storage (actually can be regarded as the value of the instance is the pointer, so this layer can not care about the storage structure)
Logical structure can choose the tree structure (because the top-down logical relationship, the feeling does not need a diagram or grid structure)
The basic operation is to insert (the ASIC code from top to bottom parsing), find, modify the value (mainly to modify the hierarchy that is), delete.
It can also be understood that the data structure of pyconn is a storage structure: hash + logical Structure: Tree
Input from Pyconn:
Fpga_partition.txt (similar to the hierarchy part in Iconnect, let's separate auto partition from Pyconn)
ASIC RTL GTECH Network table
The hierarchical and instantiated form of the ASIC RTL (see if it can be generated with a reverse connect)
Pyconn's DB1:
Instance_tree Asic_system
Instance Asic_instance1
Instance Asic_instance2
Instance Asic_instance3
Pyconn's DB2:
Instance_tree Fpga_system
Instance Fpga_instance1
Instance Fpga_instance2
Instance Fpga_instance3
Output of Pyconn:
FPGA RTL Code
Hash is deterministic, i.e. hash, but
There are so many tree-like structures, which are the best--the final choice criterion is fast--and what is it?
Problem turns into
1. What kinds of trees are there, what are the characteristics of these trees and what are the appropriate operations?
2. What do pyconn need to do with instance? How much is the probability of each operation?
Data structure selection of Pyconn