Implementation method and the device of OTN family chip Software tool bag framework
Technical field
The present invention relates to field of software development, particularly relate to a kind of OTN(Optical Transport Network, optical transfer network) implementation method and the device of family chip Software tool bag framework.
Background technology
Generally, be accompanied by the SDK(Software Development Kit of chip issue, SDK (Software Development Kit)) be to carry out secondary development for the ease of software engineer, can build rapidly the application system based on chip like this, save the process of writing hardware bottom layer code.Yet, along with the raising of chip complexity and increasing of associated hardware module, the DLL (dynamic link library) based on register or separate hardware module that conventional SDK provides makes the application of secondary development correlation module become extremely difficult, the secondary application and development of the complex chip that relating module is more also becomes extremely difficult, the similarities and differences operation-interface of module has also increased the complicacy of application, and the non-reusability of the SDK of the identical or similar hardware module of homologous series chip has not only increased the task amount of low level development, and cause poor portability.Above-mentioned deficiency embodies particularly evidently in OTN family chip, is mainly that same or similar hardware module is multiplexing in a large number in the mapping structure of same chip or family chip because related hardware module in mapping structure is more.
Summary of the invention
The object of the invention is in order to overcome the deficiency of above-mentioned background technology, a kind of implementation method and device of OTN family chip Software tool bag framework are provided, the mapping structure of setting up OTN family chip that can provide the unified operation of module interface, SDK identical or similar module to reuse and reuse based on module, for secondary application and development provides software architecture basis simply and easily.
The implementation method that the invention provides a kind of OTN family chip Software tool bag framework, comprises the following steps:
A: the abstract and instantiation of reusing of module operation interface: the register definitions file that reads each module of chip logic design phase, the register type of module is refined as up to specification according to the read-only class of alarm, the read-only class of state, count read-only class, the header file of configuration read-write class and a location read-write class sequential organization, and each register forms the relevant territory that splits according to standard G.709, according to the register of above-mentioned classification, set up the software configuration file table of each classification and corresponding function sign, this configuration of reusing that is masked as subsequent module indicates, according to classification, form the unified operation interface of module simultaneously, according to above-mentioned layout and with the relevant header file that splits territory, obtain reusing abstract structure, new function to existing module is added, and the function that existing module is not had adopts function sign to enable, after completing all modules abstract, according to the actual number of modules that has module of all chips, carry out instantiation,
B: the OTN chip mapping path of setting up merge module: according to the business mapping path of OTN chip, set up corresponding mapping path chained list, mapping path chained list of each business mapping path correspondence establishment, complete after mapping path chained list, node in mapping chained list is pointed to one by one to the module of mapping path, so far complete the OTN chip mapping path of merge module, after this to the operation of business mapping block by the unified operation being converted into completely chained list and chained list node.
On the basis of technique scheme, the interface of unified operation described in steps A comprises that [(Configuration Type is read in configuration, read Configuration Values)]/[configurable write (Configuration Type, write Configuration Values)], [counting is read (read pointer)]/[(read pointer) read in alarm]/[state is read (read pointer)]/[(Configuration Type is read in a location, read Configuration Values)]/[(Configuration Type is write Configuration Values) write in a location].
On the basis of technique scheme, steps A is further comprising the steps of: if certain module exists identical or similar module interface in chip software before, so just only need to adopt mode direct or that inherit to use original module interface, inherit and use; Otherwise, according to rule to reusing of module new interface abstract structure.
On the basis of technique scheme, steps A is further comprising the steps of: if certain module abstracts corresponding a plurality of modules in chip are carried out repeatedly instantiation to this module abstracts.
On the basis of technique scheme, step B is further comprising the steps of: if certain business has a plurality of mapping path, this mapping path chained list is adjusted dynamically according to path change.
The present invention also provides a kind of implement device of OTN family chip Software tool bag framework, comprises that reusing of module operation interface OTN chip mapping path abstract and instantiation unit and merge module sets up unit, wherein:
Abstract and the instantiation unit of described reusing of module operation interface, be used for: the register definitions file that reads each module of chip logic design phase, the register type of module is refined as up to specification according to the read-only class of alarm, the read-only class of state, count read-only class, the header file of configuration read-write class and a location read-write class sequential organization, and each register forms the relevant territory that splits according to standard G.709, according to the register of above-mentioned classification, set up the software configuration file table of each classification and corresponding function sign, this configuration of reusing that is masked as subsequent module indicates, according to classification, form the unified operation interface of module simultaneously, according to above-mentioned layout and with the relevant header file that splits territory, obtain reusing abstract structure, new function to existing module is added, and the function that existing module is not had adopts function sign to enable, after completing all modules abstract, according to the actual number of modules that has module of all chips, carry out instantiation,
The OTN chip mapping path of described merge module is set up unit, be used for: according to the business mapping path of OTN chip, set up corresponding mapping path chained list, mapping path chained list of each business mapping path correspondence establishment, complete after mapping path chained list, node by mapping in chained list points to the module of mapping path one by one, so far completes the OTN chip mapping path of merge module, after this to the operation of business mapping block by the unified operation being converted into completely chained list and chained list node.
On the basis of technique scheme, described unified operation interface comprises that [(Configuration Type is read in configuration, read Configuration Values)]/[configurable write (Configuration Type, write Configuration Values)], [counting is read (read pointer)]/[(read pointer) read in alarm]/[state is read (read pointer)]/[(Configuration Type is read in a location, read Configuration Values)]/[(Configuration Type is write Configuration Values) write in a location].
On the basis of technique scheme, abstract and the instantiation unit of described reusing of module operation interface also for: if there is identical or similar module interface at chip software before in certain module, so just only need to adopt mode direct or that inherit to use original module interface, inherit and use; Otherwise, according to rule to reusing of module new interface abstract structure.
On the basis of technique scheme, the abstract and instantiation unit of described reusing of module operation interface also for: if certain module abstracts is in the corresponding a plurality of modules of chip, this module abstracts is carried out to repeatedly instantiation.
On the basis of technique scheme, the OTN chip mapping path of described merge module set up unit also for: if certain business has a plurality of mapping path, this mapping path chained list is adjusted dynamically according to path change.
Compared with prior art, advantage of the present invention is as follows:
(1) the present invention provides the software architecture support of unified operation interface for all modules.
(2) the present invention provides the software architecture support of height reusability for identical in same chip or homologous series chip or similar module.
(3) mapping path that the present invention is OTN chip complexity provides the software architecture support of dynamic link table and equality operation corresponding to module.
(4) the present invention provides unified software architecture support for many moneys OTN family chip.
Accompanying drawing explanation
Fig. 1 is the example of the implementation method of OTN family chip Software tool bag framework in the embodiment of the present invention.
Fig. 2 is the abstract example of reusing of module interface structure in the embodiment of the present invention.
Fig. 3 is the abstract example of reusing of interface structure of similar module in the embodiment of the present invention.
Fig. 4 is the OTN chip mapping path example of setting up merge module in the embodiment of the present invention.
Embodiment
Below in conjunction with drawings and the specific embodiments, the present invention is described in further detail.
Shown in Figure 1, the embodiment of the present invention provides a kind of implementation method of OTN family chip Software tool bag framework, comprises the following steps:
A: the abstract and instantiation of reusing of module operation interface: shown in Figure 2, read the register definitions file of each module of chip logic design phase, pass through manual method, the register type of module is refined as up to specification according to the read-only class of alarm, the read-only class of state, count read-only class, the header file of configuration read-write class and a location read-write class sequential organization, and each register forms the relevant territory that splits according to standard G.709, according to the register of above-mentioned classification, set up the software configuration file table of each classification and corresponding function sign, this configuration of reusing that is masked as subsequent module indicates, [(Configuration Type is read in configuration to the unified operation interface of the formation of foundation classification simultaneously module, read Configuration Values)] config_read (config_type_n, pvalue)/[configurable write (Configuration Type, write Configuration Values)] config_write (config_type_n, value), [counting is read (read pointer)] counter (pvalue)/[(read pointer) read in alarm] alarm (pvalue)/[state is read (read pointer)] state (pvalue)/[(Configuration Type is read in a location, read Configuration Values)] indirect_read (indirect_type_n, pvalue)/[(Configuration Type is write in a location, write Configuration Values)] indirect_write (indirect_type_n, value), according to above-mentioned layout and with the relevant header file that splits territory, obtain reusing abstract structure.
If there is identical or similar module interface in certain module in chip software before, so just only need to adopt mode direct or that inherit to use original module interface, inherit and use, shown in Figure 3; Otherwise, according to rule to reusing of module new interface abstract structure; New function to existing module is added, and the function that existing module is not had adopts function sign to enable.After completing all modules abstract, according to the actual number of modules that has module of all chips, carry out instantiation; If certain module abstracts is corresponding a plurality of modules in chip, tackle this module abstracts and carry out repeatedly instantiation.
B: the OTN chip mapping path of setting up merge module: shown in Figure 4, according to the business mapping path of OTN chip, set up corresponding mapping path chained list.Mapping path chained list of each business mapping path correspondence establishment, if certain business has a plurality of mapping path, this mapping path chained list is adjusted dynamically according to path change; Complete after mapping path chained list, the node by mapping in chained list points to the module of mapping path one by one, so far completes the OTN chip mapping path of merge module, after this to the operation of business mapping block by the unified operation being converted into completely chained list and chained list node.
The embodiment of the present invention also provides a kind of implement device of OTN family chip Software tool bag framework, comprises that reusing of module operation interface OTN chip mapping path abstract and instantiation unit and merge module sets up unit, wherein:
Abstract and the instantiation unit of reusing of module operation interface, be used for: shown in Figure 2, read the register definitions file of each module of chip logic design phase, pass through manual method, the register type of module is refined as up to specification according to the read-only class of alarm, the read-only class of state, count read-only class, the header file of configuration read-write class and a location read-write class sequential organization, and each register forms the relevant territory that splits according to standard G.709, according to the register of above-mentioned classification, set up the software configuration file table of each classification and corresponding function sign, this configuration of reusing that is masked as subsequent module indicates, [(Configuration Type is read in configuration to the unified operation interface of the formation of foundation classification simultaneously module, read Configuration Values)] config_read (config_type_n, pvalue)/[configurable write (Configuration Type, write Configuration Values)] config_write (config_type_n, value), [counting is read (read pointer)] counter (pvalue)/[(read pointer) read in alarm] alarm (pvalue)/[state is read (read pointer)] state (pvalue)/[(Configuration Type is read in a location, read Configuration Values)] indirect_read (indirect_type_n, pvalue)/[(Configuration Type is write in a location, write Configuration Values)] indirect_write (indirect_type_n, value), according to above-mentioned layout and with the relevant header file that splits territory, obtain reusing abstract structure.If there is identical or similar module interface in certain module in chip software before, so just only need to adopt mode direct or that inherit to use original module interface, inherit and use, shown in Figure 3; Otherwise, according to rule to reusing of module new interface abstract structure; New function to existing module is added, and the function that existing module is not had adopts function sign to enable.After completing all modules abstract, according to the actual number of modules that has module of all chips, carry out instantiation; If certain module abstracts is corresponding a plurality of modules in chip, tackle this module abstracts and carry out repeatedly instantiation.
The OTN chip mapping path of merge module is set up unit, for: shown in Figure 4, according to the business mapping path of OTN chip, set up corresponding mapping path chained list.Mapping path chained list of each business mapping path correspondence establishment, if certain business has a plurality of mapping path, this mapping path chained list is adjusted dynamically according to path change; Complete after mapping path chained list, the node by mapping in chained list points to the module of mapping path one by one, so far completes the OTN chip mapping path of merge module, after this to the operation of business mapping block by the unified operation being converted into completely chained list and chained list node.
Fig. 1 is the example of the implementation method of OTN family chip Software tool bag framework.Certain the OTN chip OTN_CHIP_1 having existed is the Software tool bag that has completed chip, it comprises a/b/c/ ... / n module, mapping path comprises a<->c<-GreatT.Gr eaT.GTn and a<->b<-GreatT.Gr eaT.GTc<->n; Now be about to as another one OTN chip OTN_CHIP_2 chip design Software tool bag, it comprises a/b '/d/ ... / n module, a/b/c/ ... / n represents the module name of chip OTN_CHIP_1 the inside, and mapping path comprises a<->b ' <->n and a<->b ' <->d<-GreatT.Gre aT.GTn.B ' represents the module of another one chip OTN_CHIP_2, and with the chip OTN_CHIP_1 having existed in b module class seemingly.
When exploitation OTN_CHIP_2 chip design Software tool bag, first module is carried out to the abstract and instantiation of structuring, module a/n can directly be used the abstract of OTN_CHIP_1 chip, module b ' adopts the mode of inheriting module b to carry out abstract, only need to carry out new structuring to module d now abstract, all after abstract completing again to module a/b '/d/ ... / n carries out instantiation, form the module entity of OTN_CHIP_2, next set up mapping path a<->b ' <->n and the a<->b ' <->d<-GreatT.Gre aT.GTn chained list of OTN_CHIP_2 and the node of chained list is pointed to incarnate module one by one, just obtained the Software tool bag of OTN_CHIP_2.
Those skilled in the art can carry out various modifications and variations to the embodiment of the present invention, if these revise and modification within the scope of the claims in the present invention and equivalent technologies thereof, these modifications and modification are also within protection scope of the present invention.
The prior art that the content of not describing in detail in instructions is known to the skilled person.