The implementation method of OTN family chip software tool pack framework and device
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 of family chip software tool pack framework
And device.
Background technology
Under normal circumstances, along with chip issue SDK (Software Development Kit,
SDK) it is to carry out secondary development for the ease of software engineer, so can be fast
Build application system based on chip fastly, save the process writing hardware bottom layer code.But,
Along with the raising of chip complexity and increasing of associated hardware module, conventional SDK provides
DLL based on depositor or separate hardware module makes answering of secondary development correlation module
With becoming extremely difficult, the secondary application and development of the complex chip that relating module is more also becomes pole
Its difficulty, the similarities and differences operation interface of module too increases the complexity of application, and homologous series core
The non-reuse property of the SDK of the same or like hardware module of sheet not only increases low level development
Task amount, and cause poor portability.Above-mentioned deficiency is body in OTN family chip
Now particularly evident, more mainly due to related hardware module in mapping structure, identical or class
As hardware module a large amount of multiplexings in the mapping structure of same chip or family chip.
Summary of the invention
The invention aims to overcome the deficiency of above-mentioned background technology, it is provided that a kind of OTN
The implementation method of family chip software tool pack framework and device, be provided that the system of module interface
One operation, the SDK of same or like module reuse and based on module reuse set up OTN
The mapping structure of family chip, provides software architecture base simply and easily for secondary application and development
Plinth.
The present invention provides the implementation method of a kind of OTN family chip software tool pack framework,
Comprise the following steps:
Reusing of interface be abstract and instantiation for the operation of A: module: reads chip logic and designs rank
The register definitions file of each module of section, is refined as meeting regulation by the register type of module
According to alarm read-only class, the read-only class of state, count read-only class, a configuration read-write class and location
Read and write the header file of class sequential organization, and each depositor is formed relevant according to G.709 specification
Split territory, according to the depositor of above-mentioned classification set up each classification software configuration file table and
Corresponding function mark, this configuration of reusing being masked as subsequent module indicates, foundation point simultaneously
Class forms the unified operation interface of module;According to above-mentioned layout and with the head in relevant fractionation territory
File, obtains reusing abstract structure;The New function of existing module is added, to existing
The function having module not have uses function mark to enable;Complete all modules abstract it
After, carry out instantiation according to the actual number of modules having module of all chips;
B: set up the OTN chip mapping path embedding module: according to the business of OTN chip
Mapping path, sets up corresponding mapping path chained list, and each business mapping path is corresponding
Set up a mapping path chained list, after completing mapping path chained list, by mapping path chained list
Node point to the module of mapping path one by one, the OTN chip so far completing to embed module reflects
Rays footpath, the hereafter operation to business mapping block will be fully converted to save chained list and chained list
The unified operation of point.
On the basis of technique scheme, unified operation interface described in step A includes [joining
Put reading (Configuration Type reads Configuration Values)]/[configurable write (Configuration Type writes Configuration Values)], [counting
Read (read pointer)]/[(read pointer) is read in alarm]/[state reads (read pointer)]/[(configuration class is read in a location
Type, reads Configuration Values)]/[(Configuration Type writes Configuration Values) is write in a location].
On the basis of technique scheme, step A is further comprising the steps of: if certain
There is identical module interface in module in chip software before, then only need to use directly
Mode use original module interface, if certain module exists in chip software before
Similar module interface, then only the mode of succession need to be used to use original module interface;No
Then, according to rule to module new interface reusing abstract structure.
On the basis of technique scheme, step A is further comprising the steps of: if certain
The most corresponding multiple modules of module abstracts, then carry out repeatedly example to this module abstracts
Change.
On the basis of technique scheme, step B is further comprising the steps of: if certain
Business has multiple mapping path, then this mapping path chained list is carried out according to path change dynamically
Adjust.
What the present invention also provided for a kind of OTN family chip software tool pack framework realizes device,
Abstract and the OTN chip of instantiating unit and embedding module including module operation reusing of interface
Mapping path sets up unit, wherein:
Reusing of interface be abstract and instantiating unit for the operation of described module, is used for: reading chip
The register definitions file of each module of logic design phase, refines the register type of module
For meet regulation according to alarm read-only class, the read-only class of state, count read-only class, configuration read
Write class and the header file of a location read-write class sequential organization, and each depositor is according to G.709 advising
Model forms relevant fractionation territory, and the software setting up each classification according to the depositor of above-mentioned classification is joined
Putting file table and corresponding function mark, this configuration of reusing being masked as subsequent module indicates,
Form the unified operation interface of module according to classification simultaneously;According to above-mentioned layout and with relevant
Split the header file in territory, obtain reusing abstract structure;The New function of existing module is carried out
Adding, the function not having existing module uses function mark to enable;Complete all moulds
Block abstract after, carry out example according to the actual number of modules having module of all chips
Change;
The OTN chip mapping path of described embedding module sets up unit, is used for: according to OTN
The business mapping path of chip, sets up corresponding mapping path chained list, and each business maps
Path all one mapping path chained lists of correspondence establishment, after completing mapping path chained list, will map
Node in the chained list of path points to the module of mapping path one by one, so far completes to embed module
OTN chip mapping path, the hereafter operation to business mapping block will be fully converted to chain
Table and the unified operation of chained list node.
On the basis of technique scheme, described unified operation interface includes that [configuration reads (to join
Put type, read Configuration Values)]/[configurable write (Configuration Type writes Configuration Values)], [counting reads that (reading refers to
Pin)]/[(read pointer) is read in alarm]/[state reads (read pointer)]/[(Configuration Type, reading configuration are read in a location
Value)]/[(Configuration Type writes Configuration Values) is write in a location].
On the basis of technique scheme, described module operation reusing of interface is abstract and real
Example unit is additionally operable to: if certain module exists identical mould in chip software before
Block interface, then only direct mode need to be used to use original module interface, if certain mould
There is similar module interface in block in chip software before, then only need to use succession
Mode uses original module interface;Otherwise, according to rule, module reusing of new interface is taken out
Image structures.
On the basis of technique scheme, described module operation reusing of interface is abstract and real
Example unit is additionally operable to: if the most corresponding multiple modules of certain module abstracts, the most right
This module abstracts carries out repeatedly instantiation.
On the basis of technique scheme, the OTN chip mapping path of described embedding module
Set up unit to be additionally operable to: if certain business has multiple mapping path, then this mapping path chain
Table adjusts dynamically according to path change.
Compared with prior art, advantages of the present invention is as follows:
(1) present invention provides the software architecture support of unified operation interface for all modules.
(2) during the present invention is same chip or homologous series chip, same or like module carries
Supply the software architecture support of height reusability.
(3) present invention is that the complicated mapping path of OTN chip provides dynamic link table and module
The software architecture support of corresponding equality operation.
(4) present invention provides unified software architecture support for many moneys OTN family chip.
Accompanying drawing explanation
Fig. 1 is the realization side of OTN family chip software tool pack framework in the embodiment of the present invention
The example of method.
Fig. 2 is reusing of module interface Structural abstraction example in the embodiment of the present invention.
Fig. 3 is interface the reusing Structural abstraction example of similar module in the embodiment of the present invention.
Fig. 4 is the OTN chip mapping path example set up in the embodiment of the present invention and embed module.
Detailed description of the invention
Below in conjunction with the accompanying drawings and specific embodiment the present invention is described in further detail.
Shown in Figure 1, the embodiment of the present invention provides a kind of OTN family chip software tool
The implementation method of bag framework, comprises the following steps:
Reusing of interface be abstract and instantiation for the operation of A: module: shown in Figure 2, reading core
The register definitions file of each module of sheet logic design phase, by manual method, by module
Register type be refined as meeting regulation according to alarm read-only class, the read-only class of state, meter
The read-only class of number, configuration read-write class and the header file of a location read-write class sequential organization, and each
Depositor forms relevant fractionation territory according to G.709 specification, sets up according to the depositor of above-mentioned classification
The software configuration file table of each classification and corresponding function mark, this is masked as subsequent module
Reuse configuration mark, [configuration is read simultaneously to form the unified operation interface of module according to classification
(Configuration Type reads Configuration Values)] config_read (config_type_n, pvalue)/[configurable write
(Configuration Type writes Configuration Values)] config_write (config_type_n, value), [counting read
(read pointer)] counter (pvalue)/[(read pointer) is read in alarm] alarm (pvalue)/[state is read (to read
Pointer)] state (pvalue)/[(Configuration Type, reading configuration are read in a location
Value)] indirect_read (indirect_type_n, pvalue)/[location writes that (Configuration Type is write and joined
Put value)] indirect_write (indirect_type_n, value);According to above-mentioned layout and with phase
Close the header file splitting territory, obtain reusing abstract structure.
If there is identical module interface in chip software before in certain module, then
Only direct mode need to be used to use original module interface, if certain module is at core before
Sheet software exists similar module interface, then only the mode of succession need to be used to use original
Module interface, shown in Figure 3;Otherwise, according to rule to module reusing of new interface
Abstract structure;The New function of existing module is added, the function that existing module is not had
Function mark is used to enable.Complete all modules abstract after, according to all chips
The actual number of modules having module carry out instantiation;If certain module abstracts is in the chips
Corresponding multiple modules are then tackled this module abstracts and are carried out repeatedly instantiation.
B: set up the OTN chip mapping path embedding module: shown in Figure 4, according to
The business mapping path of OTN chip, sets up corresponding mapping path chained list.Each business
Mapping path all one mapping path chained lists of correspondence establishment, if certain business has multiple mapping
Path, then this mapping path chained list adjusts dynamically according to path change;Complete to map
After the chained list of path, the node in mapping path chained list is pointed to one by one the module of mapping path,
So far complete to embed the OTN chip mapping path of module, the hereafter behaviour to business mapping block
Make to be fully converted to the unified operation to chained list and chained list node.
The embodiment of the present invention also provides for the realization of a kind of OTN family chip software tool pack framework
Device, including module operation, reusing of interface be abstract and instantiating unit and embedding module
OTN chip mapping path sets up unit, wherein:
Reusing of interface be abstract and instantiating unit in module operation, is used for: see Fig. 2 institute
Show, read the register definitions file of chip logic design phase each module, by artificial side
Method, be refined as the register type of module meeting regulation according to alarm read-only class, state
Read-only class, count read-only class, configuration read-write class and the head literary composition of location read-write class sequential organization
Part, and each depositor forms according to G.709 specification and relevant splits territory, according to above-mentioned classification
Depositor set up software configuration file table and corresponding function mark, this mark of each classification
Will is that the configuration of reusing of subsequent module indicates, forms the unified operation of module according to classification simultaneously
Interface [(Configuration Type reads Configuration Values) is read in configuration] config_read (config_type_n,
Pvalue)/[configurable write (Configuration Type writes Configuration Values)] config_write (config_type_n,
Value), [counting reads (read pointer)] counter (pvalue)/[(reading refers in alarm reading
Pin)] alarm (pvalue)/[state reads (read pointer)] state (pvalue)/[a location reading (Configuration Type,
Read Configuration Values)] indirect_read (indirect_type_n, pvalue)/[(configuration class is write in a location
Type, writes Configuration Values)] indirect_write (indirect_type_n, value);According to above-mentioned layout
And with the header file in relevant fractionation territory, obtain reusing abstract structure.If certain module
Identical module interface is there is, then only need to use direct side in chip software before
Formula uses original module interface, if certain module exists similar in chip software before
Module interface, then only the mode of succession need to be used to use original module interface, see Fig. 3
Shown in;Otherwise, according to rule to module new interface reusing abstract structure;To existing mould
The New function of block is added, and the function not having existing module uses function mark to make
Energy.Complete all modules abstract after, according to the actual mould having module of all chips
Block number carries out instantiation;If the most corresponding multiple modules of certain module abstracts, tackle
This module abstracts carries out repeatedly instantiation.
The OTN chip mapping path embedding module sets up unit, is used for: see Fig. 4 institute
Show, according to the business mapping path of OTN chip, set up corresponding mapping path chained list.Often
One business mapping path all one mapping path chained list of correspondence establishment, if certain business has
Multiple mapping path, then this mapping path chained list adjusts dynamically according to path change;
After completing mapping path chained list, the node in mapping path chained list is pointed to mapping path one by one
Module, so far complete embed module OTN chip mapping path, hereafter to business map
The operation of module will be fully converted to the unified operation to chained list and chained list node.
Fig. 1 is the example of the implementation method of OTN family chip software tool pack framework.?
Certain the OTN chip OTN_CHIP_1 existed is the software tool pack having completed chip, its
Including a/b/c/ .../n module, mapping path includes a<->c<->n and a<->b<->c<->n;Existing
Will be another one OTN chip OTN_CHIP_2 chip design software tool kit, its bag
Include a/b '/d/ .../n module, a/b/c/ .../n represents the module inside chip OTN_CHIP_1
Name, mapping path includes a<->b '<->n and a<->b '<->d<->n.B ' represents additionally
The module of one chip OTN_CHIP_2, and with the chip existed
B module in OTN_CHIP_1 is similar to.
When developing OTN_CHIP_2 chip design software tool kit, first module is carried out
Structuring is abstract and instantiation, and module a/n can directly use taking out of OTN_CHIP_1 chip
As, module b ' uses the mode inheriting module b to carry out abstract, now only needs module d
Carry out new structuring abstract, the most abstract complete after again to module a/b '/d/ .../n carries out reality
Example, constitutes the modular entity of OTN_CHIP_2, next sets up OTN_CHIP_2's
Mapping path a<->b '<->n and a<->b '<->d<->n chained list and by the node of chained list by
One module pointing to hypostazation, has just obtained the software tool pack of OTN_CHIP_2.
Those skilled in the art can carry out various modifications and variations to the embodiment of the present invention, if
If these amendment and modification within the scope of the claims in the present invention and equivalent technologies thereof, then this
A little amendments and modification are also within protection scope of the present invention.
The prior art that the content not described in detail in description is known to the skilled person.