CN102761473B - Simulating and routing method of communication between component models and concurrent transaction level simulation system - Google Patents

Simulating and routing method of communication between component models and concurrent transaction level simulation system Download PDF

Info

Publication number
CN102761473B
CN102761473B CN201110110822.1A CN201110110822A CN102761473B CN 102761473 B CN102761473 B CN 102761473B CN 201110110822 A CN201110110822 A CN 201110110822A CN 102761473 B CN102761473 B CN 102761473B
Authority
CN
China
Prior art keywords
communication
partial model
port
annexation
matrix
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201110110822.1A
Other languages
Chinese (zh)
Other versions
CN102761473A (en
Inventor
谢向辉
李宏亮
郝子宇
钱磊
张昆
吴东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuxi Jiangnan Computing Technology Institute
Original Assignee
Wuxi Jiangnan Computing Technology Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuxi Jiangnan Computing Technology Institute filed Critical Wuxi Jiangnan Computing Technology Institute
Priority to CN201110110822.1A priority Critical patent/CN102761473B/en
Publication of CN102761473A publication Critical patent/CN102761473A/en
Application granted granted Critical
Publication of CN102761473B publication Critical patent/CN102761473B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Computer And Data Communications (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to a simulating method for establishing communication between component models. The simulating method comprises the following steps of: distributing the component models in a matrix form and determining a dimension number of the matrix; dividing the matrix into sub-matrixes according to the types of the component models, and generating a distribution expression formula on the basis of the dimension number of the matrix and the positions of the sub-matrixes in the matrix; generating a connection relation expression formula on the basis of the position coordinates among the component models in the matrix and the component models to be simulated; checking whether the logics of the distribution expression formula and the connection relation expression formula are correct, and if so, generating a description file of a concurrent transaction level simulation system on the basis of the connection relation expression formula. The technical scheme disclosed by the invention has the advantages of improving the development efficiency of the concurrent transaction level simulation system and reducing the cost of the maintenance component models and the concurrent transaction level simulation system.

Description

The simulation communicated between partial model and method for routing, concurrent transaction level simulation system
Technical field
The present invention relates to concurrent transaction level imitation technology in hardware system, especially a kind ofly set up the analogy method, method for routing, communication module, partial model and the concurrent transaction level simulation system that communicate between partial model.
Background technology
In extensive Hardware Design, the method for concurrent transaction level analog simulation is an important technological means.The concurrent transaction level simulation system that concurrent transaction level simulation adopts design to comprise system level simulation device usually carrys out simulated target system.Functional part in partial model simulated target system wherein in system level simulation device.
Simulation due to extensive hardware system has its particularity, and such as hardware system is huge, the complex structure of hardware system, functional part is of a great variety, annexation between functional part is complicated, and therefore the development time of system level simulation device is longer, and expense is larger.In the design process of concurrent transaction level simulation system, the system level simulation device of usual desired design exploitation can have long-term value, and partial model and system level simulation device can be reused.But realize communication function again because partial model should realize logic function, in different systems, logic function and the communication function of partial model are not quite similar, and this causes the reusability of partial model poor, and the reusability of corresponding system level simulation device is also poor.In addition, system level simulation device is generally used for the checking of goal systems, because the structure of target hardware system in the design process often changes various, corresponding system level simulation device also will change, thus the design of partial model also can change, the in like manner change of partial model also can affect the change of system level simulation device.Both changes are mutual, and when modifying, both also check and balance.
Current paralleling transaction level modeling method cannot ensure that system level simulation device is separated with the design process of partial model, and the namely design of concurrent transaction level simulation system cannot be separated with the design of partial model, causes both design processes cannot be independent.Wherein the amendment of any one must cause the amendment of another one, and this makes the development efficiency of concurrent transaction level simulation system lower, and the amendment in later stage and maintenance difficulties are comparatively large, and development cost is also higher.
Within 2009, publish at " ANALYSIS, ARCHITECTURES AND MODELLINGOF EMBEDDED SYSTEMS, IFIP Advances in Information and CommunicationTechnology " on paper " Efficient Parallel Transaction Level Simulation byExploiting Temporal Decoupling " (author: Rauf Salimi Khaligh and MartinRadetzki, Volume 310/2009, pp.149-158, 2009) a concurrent transaction level analog platform is disclosed, this platform realizes based on the SystemC simulator of OSCI, its main purpose is the improved efficiency being obtained Parallel Simulation by the Time Decoupling character excavated in transaction-level simulation.But, because the method measured transaction-level simulator SystemC realizes, its run expense and flexibility poor, and the method is not considered how for the modeling of system-level model provides effective support.
But the degree of coupling how reduced between partial model and concurrent transaction level simulation system, improves the development efficiency of concurrent transaction level simulation system, reduce the expense that partial model and concurrent transaction level simulation system are safeguarded, become one of current problem demanding prompt solution.
Summary of the invention
The problem that the present invention solves reduces the degree of coupling between partial model and concurrent transaction level simulation system, improves the development efficiency of concurrent transaction level simulation system, reduces the expense safeguarded partial model and concurrent transaction level simulation system.
For solving the problem, the invention provides and a kind ofly set up the analogy method communicated between partial model, comprising:
Described partial model is distributed in the matrix form, determines the dimension of described matrix;
According to the type of described partial model, described matrix is divided into submatrix, based on dimension and the position generation distribution and expression formula of described submatrix in described matrix of described matrix, described distribution and expression formula describes the position coordinates of described partial model in described matrix;
Generate annexation based on the position coordinates of described partial model in described matrix and the annexation between partial model to be simulated and express formula, described annexation expression formula describes the annexation between described partial model;
Check that whether the logic of described distribution and expression formula and annexation expression formula is correct, if correct, express formula based on described distribution and expression formula and annexation, generate the description document of concurrent transaction level simulation system, described description document comprises position coordinates and the annexation of described partial model, described annexation is with the Name & Location coordinate of source partial model, the Name & Location coordinate of destination partial model represents, described position coordinates is the mark of described partial model;
Logically true position coordinates and the partial model one_to_one corresponding referring to described partial model of described distribution and expression formula; Described annexation is expressed the logically true of formula and is referred to that described annexation expression formula comprises the annexation of each partial model, and described partial model does not have the annexation of redundancy.
Optionally, the described dimension based on described matrix and the described submatrix position in described matrix generates distribution and expression formula and comprises: based on dimension and the position of described submatrix in described matrix of described matrix, determine the parameter in the distribution formula set up in advance, obtain described distribution and expression formula, described distribution formula is:
<x m,y n>,x m,y n=(i,j,+,-,×,÷,k),i∈[0,N],j∈[0,N],k∈N,m∈N,n∈N
Wherein <x m, y n> represents the position coordinates of described partial model in described matrix, x mrepresent abscissa, y nrepresent ordinate, x mbe the function of i, i is based on the dimension determination span of described matrix; y nbe the function of j, j is based on the dimension determination span of described matrix, and k represents constant, and determine based on the position of described submatrix in described matrix, N represents integer.
Optionally, the distribution formula based on described distribution formula generation two-dimensional matrix is:
<x g,y h>,x g=a·i+b,y h=c·j+d,i=[0,A-1],j=[0,B1],a∈N,b∈N,c∈N,d∈N,g∈N,h∈N
The dimension of described two-dimensional matrix comprises the line number of described two-dimensional matrix and the columns of described two-dimensional matrix, and wherein A represents the columns of described two-dimensional matrix, and B represents the line number of described two-dimensional matrix; A is the coefficient of i, and c is the coefficient of j, and b, d are constant, and a, b, c, d determine based on the span of i and j and the position of described submatrix in described matrix, and N is integer.
Optionally, describedly generate annexation based on the position coordinates of described partial model in described matrix and the annexation between partial model to be simulated and express formula and comprise: determine the annexation Parameters in Formula set up in advance based on the position coordinates of described partial model in described matrix, the described submatrix position in described matrix and the annexation between partial model to be simulated, obtain described annexation and express formula, described annexation formula is:
i∈[0,N],j∈[0,N],
n∈N,l∈N,p∈N,v∈N,u∈N
<x l, y p> and <x v, y u> represents the position coordinates of two partial models with annexation, and n represents constant, and N represents natural number.
Optionally, before checking that whether the logic of described distribution and expression formula and annexation expression formula is correct, also comprise: check that described distribution and expression formula and annexation are expressed formula and whether met default syntactic information; Described syntactic information comprises spelling requirement and the algorithm of described distribution formula and annexation formula.
Optionally, the described analogy method communicated between partial model of setting up also comprises: if described distribution and expression formula and annexation express formula do not meet described syntactic information and/or logic error, then feed back error message.
Optionally, the type of described partial model comprises: processor type, type of memory, router type.
Optionally, described matrix is two-dimensional grid, two-dimentional looped network or three-dimensional grate.
The method for routing communicated between partial model, comprising:
Analogy method described in utilization generates the description document of concurrent transaction level simulation system;
The title of obtaining communication source, described communication source is source partial model to be established a communications link;
In the description document of described concurrent transaction level simulation system, search the title of the communication objective end corresponding with described communication source, described communication objective end is the destination partial model corresponding with source to be established a communications link;
Record communication port information, described communication port information comprises the Name & Location coordinate of described communication source, the Name & Location coordinate of communication objective end;
Be that described communication source and communication objective end set up communication port and configuration communication passage based on described communication port information.
Optionally, described description document also comprises the type of described partial model, and the type of described partial model is the type of described communication source, and the type of described partial model comprises: processor type, type of memory, router type.
Optionally, the method for routing communicated between partial model is also included in described description document the type of searching the partial model corresponding with the type of described communication source; Described communication port information also comprises the type of described communication source.
A kind of communication module, comprises port router, port queue administration module and communication controler;
Described port router, in order to obtain the description document of the concurrent transaction level simulation system that the analogy method described in utilizing generates, and the title of obtaining communication source, described communication source is source partial model to be established a communications link; Also in order to search the title of the communication objective end corresponding with described communication source in described description document, described communication objective end is the destination partial model corresponding with source to be established a communications link; Also in order to record communication port information, described communication port information comprises the Name & Location coordinate of described communication source, the Name & Location coordinate of communication objective end;
Described communication controler, in order to obtain event bag, described event handbag draws together event content and the title of port of the source that communicates sending this event bag;
Described port queue administration module, in order to obtain the communication port information corresponding with described communication source from described port router, and sets up communication port based on described communication port information;
Described communication port comprises:
Port arrangement module in order to obtain described communication port information, and is communication source and corresponding communication objective end configuration communication passage based on described communication port information;
Message transmission module, in order to obtain described event bag from described communication controler, adds described event content and forms message and send described message by described communication port by described communication port information.
Optionally, described communication controler, also in order to receive the message sent by communication source.
Optionally, described port queue administration module, also in order to resolve the message that described communication controler receives, the title of the port of the event content obtaining this message and the communication objective end receiving this message.
Optionally, described communication port also comprises: message processing module, resolves the event content obtained, and send result in order to receive and to process described port queue administration module.
A kind of partial model comprising described communication module.
Optionally, also comprise component logic, for sending the result of event bag or reception event content.
A kind of concurrent transaction level simulation system comprising partial model as above.
Optionally, described concurrent transaction level simulation system also comprises parallel host network, in order to realize the message transmission between partial model.
Compared with prior art, the present invention has the following advantages:
Described partial model is distributed with a matrix type, and according to the type of partial model, this matrix is divided into submatrix, based on dimension and the position generation distribution and expression formula of described submatrix in described matrix of described matrix, described distribution and expression formula describes the position coordinates of described partial model in described matrix; Generate annexation based on the position coordinates of described partial model in described matrix and the annexation between partial model to be simulated and express formula.Express formula based on described distribution and expression formula and annexation, generate the description document of concurrent transaction level simulation system.Described description document contains annexation and the position coordinates thereof of described partial model.
Described description document simulates the annexation between partial model, sets up the communication connection between partial model by described description document.This not only simplifies the development procedure of concurrent transaction level simulation system, and improve the development efficiency of concurrent transaction level simulation system.
If concurrent transaction level simulation system changes, the distribution mode of partial model or connection is caused to change, according to the distribution mode after change or new annexation formula can be adopted, recalculate new distribution mode and the annexation of described partial model, obtain new description document.This can not remodify or design whole concurrent transaction level simulation system, only needs to recalculate or change annexation formula and obtains new description document, just can realize the design of whole concurrent transaction level simulation system.
Owing to revising separately or apparatus of repair parts model, the operation of concurrent transaction level simulation system can not be affected; Independent amendment or safeguard concurrent transaction level simulation system, also can not affect the operation of partial model, and what therefore this was larger simplify to partial model and the amendment of concurrent transaction level simulation system and the work of maintenance.In addition, recalculate or change annexation formula and obtain new description document, also reduce the expense that partial model and concurrent transaction level simulation system are safeguarded.
Accompanying drawing explanation
Fig. 1 is the flow chart setting up a kind of execution mode of the analogy method communicated between partial model provided by the invention;
Fig. 2 is the schematic diagram that distribution and expression formula provided by the invention and annexation express a kind of execution mode of formula logical check;
Fig. 3 is the matrix structure figure schematic diagram of the distribution mode of partial model provided by the invention;
Fig. 4 is the flow chart of a kind of execution mode of the method for routing communicated between partial model provided by the invention;
Fig. 5 is the structure list of topological structure description document provided by the invention;
Fig. 6 is the flow chart of a kind of execution mode of the method for routing of communication port provided by the invention;
Fig. 7 is the structure chart of a kind of execution mode of port router provided by the invention;
Fig. 8 is the flow chart of a kind of execution mode of the message method of communication port provided by the invention;
Fig. 9 is the flow chart of a kind of execution mode of the message receival method of communication port provided by the invention;
Figure 10 is the structure chart of a kind of execution mode of communication port provided by the invention;
Figure 11 is the structure chart of a kind of execution mode of communication module provided by the invention;
Figure 12 be message provided by the invention send flow graph;
Figure 13 is the reception flow graph of message provided by the invention;
Figure 14 is the structure chart of a kind of execution mode of partial model provided by the invention;
Figure 15 is the structure chart of a kind of execution mode of concurrent transaction level simulation system provided by the invention;
Figure 16 is the communication connection schematic diagram of partial model in concurrent transaction level simulation system provided by the invention;
Figure 17 is the structure chart of a kind of execution mode of event bag provided by the invention;
Figure 18 is the structure chart of a kind of execution mode of message provided by the invention.
Embodiment
For enabling above-mentioned purpose of the present invention, feature and advantage more become apparent, and are described in detail the specific embodiment of the present invention below in conjunction with accompanying drawing.
Due in existing paralleling transaction level modeling method, there is provided enough supports to the reusable of partial model, the modeling person of component-level model is caused to need to be concerned about the design of system-level model, the modeling person of system-level model also needs the inside being concerned about component-level model to realize on the other hand, therefore the degree of coupling of partial model and concurrent transaction level simulation system is higher, and both designs and amendment cannot complete independentlies.This will cause the development efficiency of concurrent transaction level simulation system lower, and it is safeguarded and the expense revised also larger.
Fig. 1 is the flow chart setting up a kind of execution mode of the analogy method communicated between partial model provided by the invention, comprising:
S11, distributes in the matrix form by described partial model, determines the dimension of described matrix;
S12, according to the type of described partial model, is divided into submatrix by described matrix, based on dimension and the position generation distribution and expression formula of described submatrix in described matrix of described matrix;
S13, generates annexation based on the position coordinates of described partial model in described matrix and the annexation between partial model to be simulated and expresses formula;
S14, checks that whether the logic of described distribution and expression formula and annexation expression formula is correct;
S15, expresses formula based on described distribution and expression formula and annexation, generates the description document of concurrent transaction level simulation system.
Fig. 2 is the flow chart that distribution and expression formula provided by the invention and annexation express a kind of execution mode of formula logical check, comprising:
S31, checks whether described annexation expression formula comprises the annexation of each partial model;
S32, checks whether described annexation expression formula comprises the annexation of the redundancy of described partial model;
S33, to check in described distribution and expression formula position coordinates and partial model whether one_to_one corresponding.
Describe in detail below in conjunction with Fig. 1 with Fig. 2 and describedly set up the analogy method communicated between partial model.First referring to Fig. 1:
In S11, being distributed in the matrix form by described partial model, be generally by described partial model with the formal distribution of two-dimensional grid, two-dimentional looped network or three-dimensional grate, and the partial model of identical type is placed on the region closed on more.For two-dimensional matrix, the dimension of described matrix comprises line number and the columns of matrix.
In S12, according to the type of described partial model, described matrix is divided into submatrix, generally refers to and the partial model of identical type is divided in a submatrix.The position of described submatrix in described matrix generally refers to which row and column in the matrix that row and column that described submatrix comprises is corresponding original.Such as, after being divided into submatrix, the 3rd row in the matrix that the first row of submatrix is corresponding original.
Partial model distributes in the matrix form, and its position coordinates in a matrix represents its abscissa and ordinate respectively with matrix column and row, and position coordinates is the mark of this partial model.
In S13, represent this partial model with position coordinates, generate annexation based on the position coordinates of described partial model in described matrix and the annexation between partial model to be simulated and express formula.Such as, the position coordinates of partial model A is <x l, y pthe position coordinates of >, partial model B is <x v, y u>, if having annexation between the two, its annexation is expressed formula and can be write as
In S13, if the logic that described distribution and expression formula and annexation express formula is all correct, then generate the description document in S14.Logically true position coordinates and the partial model one_to_one corresponding referring to described partial model of described distribution and expression formula; Described annexation is expressed the logically true of formula and is referred to that described annexation expression formula comprises the annexation of each partial model, and described partial model does not have the annexation of redundancy.
Referring to Fig. 2, wherein in S31, check that described annexation is expressed the annexation whether formula comprise each partial model and referred to, described annexation expresses the annexation that formula comprises each partial model, that is, check whether the situation occurring missing, whether have the annexation of certain partial model not to be included in described annexation expression formula.In concurrent transaction level simulation system, there is not isolated partial model, that is, at least there is between partial model and miscellaneous part model an annexation.In S31, comprise the inspection that whether there is isolated partial model, occur that isolated partial model belongs to logic error.In addition, if partial model A has three annexations, but contains only two annexations in described annexation expression formula, this also belongs to situation about missing, and also belongs to logic error.
Check that described annexation is expressed the annexation whether formula comprise the redundancy of described partial model and referred to, check whether described partial model has unnecessary annexation, such as, partial model A has annexation with partial model B, but by expressing the logical check of formula to annexation, obtain annexation between these two partial models and occurred twice, be obviously once redundancy in this twice, belong to logic error.
To check in described distribution and expression formula position coordinates and partial model whether one_to_one corresponding, refer to that a position coordinates can only a unique corresponding partial model, and a partial model also only has a unique position coordinates corresponding with it, and position coordinates is the mark of partial model.If there is the corresponding multiple partial model of position coordinates, or a partial model has multiple position coordinates and all belongs to logic error.
In above-mentioned logical check, occur any one or a few logic error, then described distribution and expression formula or annexation express the logic mistake of formula, cannot generate description document.
In S14, if the logic that described distribution and expression formula and annexation express formula is all correct, then generate description document.Described description document comprises position coordinates and the annexation of described partial model, and described annexation is with the Name & Location coordinate of source partial model, and the Name & Location coordinate of destination partial model represents.Because position coordinates and partial model are one to one, therefore described position coordinates can as the mark of described partial model.
The matrix that described partial model is formed is divided into submatrix according to type, therefore also comprises the type of described partial model in described description document.The type of described partial model is except comprising: except processor type, type of memory, router type, can also comprise type of hardware, external memory type, switch type etc.
Describedly set up the analogy method communicated between partial model, be also included in check described distribution and expression formula and annexation express the logic of formula whether correct before, check that described distribution and expression formula and annexation are expressed formula and whether met default syntactic information; Described syntactic information comprises spelling requirement and the algorithm of described distribution formula and annexation formula.
Also comprise, if described distribution and expression formula and annexation express formula do not meet one or more in described syntactic information, logic error, then feed back error message.Described error message comprises: the reason of makeing mistakes and the position of makeing mistakes, concrete:
Described reason of makeing mistakes comprises: the misspelling that described distribution and expression formula or annexation express formula, do not meet in described algorithm one or more, described in the position of makeing mistakes comprise: the position of misspelling or do not meet the position of described algorithm.Such as, the title misspelling of partial model, parameter name misspelling, multiplying is write as add operation etc.
Described reason of makeing mistakes also comprises: if described annexation expresses formula lacks in the corresponding multiple partial model of position coordinates of partial model in the annexation of described partial model, the annexation comprising the redundancy of described partial model, described distribution and expression formula and a corresponding multiple position coordinates of partial model one or more.The information of makeing mistakes described in feedback comprises: the title of the partial model of the described annexation of feedback disappearance, feedback have the title of the partial model of the annexation of redundancy.If a corresponding multiple partial model of position coordinates in described distribution and expression formula, feed back the information of makeing mistakes and comprise: the title feeding back multiple partial models corresponding to this position coordinates, feedback has the title of the partial model of multiple position coordinates.
Described matrix is generally two-dimensional grid, two-dimentional looped network and/or three-dimensional grate.The distribution formula of two-dimensional grid, two-dimentional looped network and/or three-dimensional grate and the representation of annexation formula have certain similitude, the form of these formula system is with the formula represented, be created as reference representation storehouse, directly can apply mechanically formula so in use.
Described reference representation storehouse comprises distribution formula and the annexation formula of parameter to be determined, during use based on the dimension of described matrix and described submatrix the position in described matrix, determine the parameter in the distribution formula set up in advance, obtain described distribution and expression formula; Determine the annexation Parameters in Formula set up in advance based on the position coordinates of described partial model in described matrix, the described submatrix position in described matrix and the annexation between partial model to be simulated, obtain described annexation and express formula.
Described distribution formula is:
<x m,y n>,x m,y n=(i,j,+,-,×,÷,k),i∈[0,N],j∈[0,N],k∈N,m∈N,n∈N
Wherein <x m, y n> represents the position coordinates of described partial model in described matrix, x mrepresent abscissa, y nrepresent ordinate, x mbe the function of i, i is based on the dimension determination span of described matrix; y nbe the function of j, j is based on the dimension determination span of described matrix, and k represents constant, and determine based on the position of described submatrix in described matrix, N represents integer.
The distribution formula of two-dimensional matrix is:
<x g,y h>,x g=a·i+b,y h=c·j+d,i=[0,A-1],j=[0,B-1],a∈N,b∈N,c∈N,d∈N,g∈N,h∈N
The dimension of described two-dimensional matrix comprises the line number of described two-dimensional matrix and the columns of described two-dimensional matrix, and wherein A represents the columns of described two-dimensional matrix, and B represents the line number of described two-dimensional matrix; A is the coefficient of i, and c is the coefficient of j, and b, d are constant, and a, b, c, d determine based on the span of i and j and the position of described submatrix in described matrix, and N is integer.
Described annexation formula is:
i∈[0,N],j∈[0,N],
n∈N,l∈N,p∈N,v∈N,u∈N
<x l, y p> and <x v, y u> represents the position coordinates of two partial models with annexation, and n represents constant, and N represents natural number.
The target of concurrent transaction level modeling is exactly farthest realize being separated of partial model and concurrent transaction level simulation system, separates design process or the modeling process of both couplings.During partial model modeling, without the need to being concerned about the structure of concurrent transaction level simulation system; And during concurrent transaction level simulation system modeling, directly can utilize existing partial model, set up the annexation between partial model by structure description file.
In concurrent transaction level modeling, if carry out appropriate design to partial model, it can be made to have reusable characteristic, briefly, be exactly the information that this partial model does not comprise system-level model, in outside be exactly one and receive input signal, return " flight data recorder " of output signal.Based on this " flight data recorder ", the process of system-level modeling just only needs the connection describing these " flight data recorders ".
Fig. 3 is the matrix structure figure schematic diagram of the distribution mode of partial model provided by the invention, describes in detail below in conjunction with Fig. 1, Fig. 2 and Fig. 3.
Shown in Fig. 3 is the initial matrix of the two-dimensional grid of 5 × 5, wherein has two base part models: sample_m1 and sample_m2, sample_m1 represent processor, and sample_m2 represents internal memory.Different according to the type of partial model, this initial matrix can be divided into several submatrix block: N1, N2 and N3.Wherein N1 forms the matrix of 3 × 3, and matrix-block N2 forms the matrix of 2 × 3, and matrix N 3 forms the matrix of 5 × 2 respectively.
The reference representation storehouse set up in advance comprises:
The distribution formula of two-dimensional matrix is:
<x g,y h>,x g=a·i+b,y h=c·j+d,i=[0,A-1],j=[0,B-1],a∈N,b∈N,c∈N,d∈N,g∈N,h∈N
The dimension of described two-dimensional matrix comprises the line number of described two-dimensional matrix and the columns of described two-dimensional matrix, and wherein A represents the columns of described two-dimensional matrix, and B represents the line number of described two-dimensional matrix; A is the coefficient of i, and c is the coefficient of j, and b, d are constant, and a, b, c, d determine based on the span of i and j and the position of described submatrix in described matrix, and N is integer.
The annexation formula of the partial model of two-dimensional matrix distribution is:
i∈[0,N],j∈[0,N],
n∈N,l∈N,p∈N,v∈N,u∈N
<x l, y p> and <x v, y u> represents the position coordinates of two partial models with annexation, and n represents constant, and N represents natural number.
The syntactic information of above-mentioned two formula comprises:
Algorithm comprises:
1, first by ltr and dig constructed variable (var), according to the rule (beginning of letter, after with any number of letter or digit) of var, Two Variables a1 can be constructed, a2.
2, construct numeral (num) by dig, according to the rule (digit starts, after with any number of digit) of Num, numeral 10 can be constructed.
3, by the definition (according to the combination of oper between numeral, variable or numerical variable) of formula (fom), can formula be obtained: a1+a2-10.
Three submatrixs as shown in Figure 3: N1, N2 and N3, illustrate for submatrix N1, for convenience of description, the abscissa herein in position coordinates and ordinate be not to have the <x of footnote, and y> represents.
Because submatrix N1 is 3 × 3, in the upper left corner of initial matrix, three row of the corresponding initial matrix of data of three row comprised and three row and three row.Abscissa x can get three values between 0 to 2, same, and ordinate y can get three values between 0 to 2, and three kinds of values of three of x kinds of values and y can combination in any, forms all positions in 3 × 3 matrixes.Therefore, the distribution and expression formula of submatrix N1 can be written as:
<x,y>,x=i,y=j,i=[0,2],j=[0,2]。
The in like manner dimension 2 × 3 of submatrix N2, in the lower left corner of initial matrix, the first two columns of corresponding initial matrix fourth line and fifth line.The distribution and expression formula of submatrix N2 is:
<u,v>,u=i,v=j,i=[0,2],j=[3,4]。
The dimension 5 × 2 of submatrix N3, on the right side of initial matrix, rear two row of the five-element of corresponding initial matrix.The distribution and expression formula of submatrix N3 is:
<m,n>,m=i,n=j,i=[3,4],j=[0,4]。
(position coordinates is respectively (2 to be positioned at tertial three partial models with submatrix N1,0), (2,1), (2,2) (position coordinates is respectively (3,0)), to be positioned at the 4th three partial models arranged with submatrix N3, (3,1), (3,2)) between annexation be example illustrate annexation express formula.
If the 3rd row first have annexation with first row first in submatrix N3 in submatrix N1, in submatrix N1, in the 3rd row second and submatrix N3, first row second has annexation, and in submatrix N1, the 3rd arranges the 3rd and have annexation with first row the 3rd in submatrix N3.Submatrix N1 is in the left side of initial matrix, and the 3rd row of submatrix N1 are the 3rd row of initial matrix, and submatrix N3 is on the right side of initial matrix, and the first row of submatrix N3 is the 4th row of initial matrix.Its annexation expresses formula:
R ( < u , v > , < m , n > ) = ( u = 2 v = i , m = 3 n = i , i = [ 0,2 ] )
In described connection formula, the span of v with n is consistent, therefore can represent with identical parameter i.
In described annexation expression formula, the part of numeral " 2 " and numeral " 3 " represents with predetermined syntactic information.Such as, dig::=0|3|, num::=dig *, so num representative digit " 3 ", DIG::=0|2|, NUM::=DIG *, NUM representative digit " 2 ", so above-mentioned annexation is expressed formula and is become:
R ( < u , v > , < m , n > ) = ( u = NUM v = i , m = num n = i , i = [ 0,2 ] )
Wherein, NUM and num is the parameter of the numeric type according to the syntactic information definition preset.
According to the syntactic information preset, check whether correctly distribution and expression formula and annexation express the grammer of formula, comprising: whether the spelling of parameter name is correct, and whether algorithm is correct.Such as: num is made up of one or more dig, and dig is Arabic numerals, as 3 is correct num, because it is made up of a dig, and 3b is illegal num, because it is not made up of dig entirely, then can feed back following error message:
Error:Line:6,3b?is?wrong.
Represent that the num spelling of the 6th row makes mistakes.
Check that distribution and expression formula and annexation express the logic of formula, comprising:
Check whether described annexation expression formula comprises the annexation of each partial model;
Check whether described annexation expression formula comprises the annexation of the redundancy of described partial model;
To check in described distribution and expression formula position coordinates and partial model whether one_to_one corresponding.
Such as, in the annexation expression formula that the annexation of partial model A does not comprise, then following error message can be fed back:
Erro:model?A?is?miss。
Represent the annexation having lacked partial model A.
If the syntactic information that described distribution and expression formula and annexation express formula is correct and logically true, then generate description document.Described description document comprises position coordinates and the annexation of described partial model, and described annexation is with the Name & Location coordinate of source partial model, and the Name & Location coordinate of destination partial model represents.Described position coordinates and partial model are one to one, and therefore described position coordinates is the mark of described partial model, with the partial model that described position coordinates representative is corresponding with it.
Annexation between partial model A and partial model B, can show with the form of text description, such as, [partial model A: the mark <2 of source partial model, 1>, partial model B: the mark <3 of destination partial model, 1>], this represents to have annexation between partial model A and partial model B, A is the title of source partial model, it is designated <2, 1>, the title of end pieces model for the purpose of B, it is designated <3, 1>, also can with program code, the form performances such as graphic symbol, such as, code form: R (modleA<2, 1>, modleB<3, 1>), R represents to have annexation between partial model modleA and partial model modleB, modleA is the title of source partial model, its position coordinates (mark) is <2, 1>, the title of end pieces model for the purpose of modleB, its position coordinates (mark) is <3, 1>.
Annexation between partial model can be classified, and generally has two kinds: unidirectional connection and be bi-directionally connected relation.Such as, be unidirectional annexation between partial model A and partial model B, represent that partial model A is to the unidirectional transmission message of partial model B or event content, or partial model B be to the unidirectional transmission message of partial model A or event content; Be be bi-directionally connected relation between partial model A and partial model B, represent that partial model A sends message or event content to partial model B, and partial model B also send message or event content to partial model A.
The number of the annexation between partial model and the type of annexation also can add in described description document.Such as, R (modleA<2,1>, modleB<3,1>) represent between modleA and modleB it is be bi-directionally connected relation, S (modleA<2,1>, modleB<3,1>) represent the unidirectional annexation of modleA to modleB.R (modleA<2, 1>, modleB<3, 1>), R (modleA<2, 1>, modleC<4, 1>), R (modleA<2, 1>, modleD<5, 1>), represent modleA respectively with modleB, modleC, modleD has the relation of being bi-directionally connected respectively, and modleA has 3 annexations.ModleA has the relation of being bi-directionally connected respectively with modleB, modleC, modleD respectively, and modleA has 3 annexations also can be kept in description document.
Because different concurrent transaction level model implementation method is different, the method for expressing of the design's not limiting part model.Described description document is applicable to the paralleling transaction level modeling method of various system and partial model loose coupling.The description document generated can time for the system model coded description of physical simulation device, also can be the texts such as txt, word.
Fig. 4 is the flow chart of a kind of execution mode of the method for routing communicated between partial model provided by the invention, comprising:
S21, generates the description document of concurrent transaction level simulation system;
S22, the title of obtaining communication source, described communication source is source partial model to be established a communications link;
S23, searches the title of the communication objective end corresponding with described communication source in the description document of described concurrent transaction level simulation system, and described communication objective end is the destination partial model corresponding with source to be established a communications link;
S24, record communication port information, described communication port information comprises the Name & Location coordinate of described communication source, the Name & Location coordinate of communication objective end;
S25 is that described communication source and communication objective end set up communication port and configuration communication passage based on described communication port information.
In the modeling or design process of the concurrent transaction level simulation system of reality, the structure of partial model is very complicated, and described partial model comprises communication module, also comprises component logic, in order to realize logic function.
Described communication module comprises port router (also claiming router), communication controler and port queue administration module etc., and port queue administration module is generally used for setting up communication port according to communication port information.Port router comprises routing iinformation administration module, and described routing iinformation administration module comprises routing table cache module, enquiry module etc.Communication port comprises port arrangement module, message transmission module, message processing module etc.
Port queue administration module obtains the port number of this partial model from enquiry module, and obtains the communication port information of each port successively.Annexation between partial model generally has three kinds: communication port generally can be divided into three types: only send the communication port of message, receive only the communication port of message or event content, has not only sent but also the communication port of receipt message or event content.The type of communication port and number are generally by type and the decision of the annexation of this partial model.Such as, partial model A and partial model B, partial model C, partial model D have the relation of being bi-directionally connected respectively, and so partial model A has three communication port, and this communication port is not only sent but also the communication port of receipt message or event content.If partial model A is to the unidirectional transmission message of partial model B, then partial model A has the communication port that only sends message, and partial model B has the communication port that receives only message or event content.
A communication port has a communication port information, and that is, the number of communication port information is consistent with the number of communication port.After port queue administration module obtains each new communication port information, by communication port new for establishment one in communication module, by numeral or this communication port of letter designation, and corresponding communication port information is inserted port information administration module.
Type, the number of the annexation of partial model generally also can be included in description document, and the title of communication port is generally defaulted as numeral or letter in addition, when generating description document, can be included in description document by auto-sequencing.
Fig. 5 to Figure 18 is the detailed applications method of the description document provided in the embodiment of the present invention, described description document is also referred to as topological structure description document, in the present embodiment, the communication module of partial model sets up communication port according to communication port information, correspondingly, also comprise the port information (as title, mark etc.) of partial model in description document, communication port information also comprises the communication port information of source and the port information of communication objective end.Describe in detail below in conjunction with Fig. 5 to Figure 18.
Fig. 5 is the structure list of the topological structure description document that the embodiment of the present invention provides, and the structure of topological structure description document as shown in Figure 5.Topological structure description document is main unit with partial model, describes the essential information of each partial model, and the annexation of the port of this partial model.In order to avoid a conflict, topological structure description document requires that being designated of partial model is overall unique, and the title of the port of partial model is unique in this partial model.Because being designated of partial model is overall unique, the title of port only needs to ensure that partial model is interior unique, carries out would not making a mistake when topological structure describes to this port.
Partial model is generally transmitting terminal or the receiving terminal of message, and therefore partial model can be used as communication source or communication objective end.For convenience of description, if indicate without special, in following content, communication source or communication objective end is namely represented with partial model.
What this topological structure description document described is annexation between partial model, and point out the annexation between the port of a partial model and the port of miscellaneous part model.
As shown in Figure 5, the annexation of the port of the whole partial models comprised in a concurrent transaction level simulation system is represented.Comprise the annexation of the port of several partial models in this topological structure description document, each partial model comprises two parts content, and one is module information M1, and two is channel information M2.In module information M1, comprise the title of partial model, mark, type and number of active lanes, type is generally finger processor, internal memory, hard disk etc., and number of active lanes is the number of the communication port between this partial model and miscellaneous part model.In channel information M2, itemize have recorded the information of each port, the port information of a port recorded in every bar record, comprise the mark of the partial model having annexation with this port, title, have annexation with which port of this partial model, the title of this port, type, time of delay.The title of port is generally defaulted as Arabic numerals or letter, and according to numeral or the sequence of alphabetical order.Port type generally comprises transmission types, type of receipt and transmission and to hold concurrently type of receipt.Refer to that this port sends a message and how long needs time of delay.
Such as, partial model A has 4 ports, and the title of 4 ports is respectively a, b, c, d, and has 4 communication ports between partial model A and miscellaneous part model.The module information of partial model A comprises, and the name of partial model is called A, is designated <2, and 1>, type are processor and number of active lanes is 4.Channel information comprises 4 records, the information of a port recorded in every bar record, if port a is in order to initiate a message, (<3 is designated with partial model B, port f 1>) has communication connection, then the record of port a comprises: the mark <2 of source, 1>, destination be designated <3,1>, the port name of source is called a, and the port name of destination is called f, channel type is transmission types, and time of delay is 0.04s.
The general communication connection according to concurrent transaction level simulation system to be simulated of topological structure description document, sets up the annexation of source and destination.When establishing a connection, the type of the port of described source is transmission types, then the type of the port of corresponding with it destination can only be to be type of receipt or to receive transmission types of holding concurrently, and same partial model both can be source also can be destination.
According to the annexation between each partial model of concurrent transaction level simulation system to be simulated, annexation in described topological structure description document between analog component model, after partial model obtains described topological structure description document, according to content wherein, set up the annexation between partial model, then achieve the modeling of concurrent transaction level simulation system.
Fig. 6 is the flow chart of a kind of execution mode of the method for routing of communication port provided by the invention, comprising:
S101, obtains topological structure description document, and described topological structure description document comprises the title of the mark of source, the mark of destination, the title of the port of source and the port of destination;
S102, the title of the port of obtaining communication source, described communication source is source to be established a communications link, and the port of described communication source is the port of source to be established a communications link;
S103, searches the title of the port of the communication objective end corresponding with the port of described communication source and the mark of communication objective end in described topological structure description document;
S104, record communication port information, described communication port information comprises the mark of described communication source, the title of port, the mark of communication objective end of communication source, the title of the port of communication objective end;
S105 is that described communication source and communication objective end set up communication port and configuration communication passage based on described communication port information.
The analogy method that the topological structure description document of step S101 can utilize setting up shown in Fig. 1 to communicate between partial model generates, and described source is the partial model that the issuing side of message initiates a message in other words conj.or perhaps, and the port of described source is in order to send described message; Described destination is the receiving terminal of described message or perhaps the partial model of receipt message, and the port of described destination is in order to receive described message, and namely source and destination have annexation.Because the transmission of message moves in circles with reception, the source of therefore message transmission, also can be the destination of message sink, in other words, source and destination can change according to the flow direction of message next time.In concurrent transaction level simulation system, partial model normally communicates source or communication objective end.
Described communication source is source to be established a communications link, the partial model namely in concurrent transaction level simulation system.After partial model has designed, set up the communication connection between partial model, the more parallel host network of configuration, concurrent transaction level simulation system just completes.For preventing in the process established a communications link, occurring situation about missing, the partial model designed, when establishing a communications link, regard this partial model as source to be established a communications link.
The port of described communication objective end is the port of the destination corresponding with the port of source described to be established a communications link, and described communication objective end is the destination corresponding with source to be established a communications link.Message is flowed by port in the entire system, when establishing a communications link, need to determine the communication source of message and communication objective end, guarantee that both are corresponding, then determine which port of communication source is corresponding with which port of communication objective end, ensure that message flows in the port of correspondence.
Be that described communication source and communication objective end set up communication port and after configuration communication passage based on described communication port information, communicate in the communication port set up for communication source and corresponding communication port information the port of source, the port of the communication port set up for communication objective end and corresponding communication objective end.Message is sent to communication objective end by the communication communication port of source, the communication port of configuration, and the communication port of communication objective end receives the message (will be described in detail follow-up to the parsing of message) after resolving.
Generally, transmission types port and type of receipt or to receive the port of transmission types of holding concurrently corresponding; The port of type of receipt and transmission types or to receive the port of transmission types of holding concurrently corresponding; Send the port of type of receipt of holding concurrently, if send message, then identical with the port of transmission types, if receipt message, then identical with the port of type of receipt.
Topological structure description document comprises module information and the channel information of this partial model, wherein module information comprises the title of this partial model, mark, type and number of active lanes, and number of active lanes is the number of the communication port between this partial model and miscellaneous part model.In channel information, itemize have recorded the information of each port, comprises the mark of the partial model having annexation with this port, title, has annexation, the title of this port, type, time of delay with which port of this partial model.
In S104, record communication port information, these information selectively can be recorded according to actual conditions, communication port information only records the information of conventional port under normal circumstances, can save memory space like this.
Described communication port is used to transmission message, and communication port is generally by parallel host real-time performance.
Fig. 7 is the structure chart of a kind of execution mode of port router provided by the invention, describes in detail below in conjunction with Fig. 1, Fig. 2 and Fig. 7.
The structure of port router A1 as shown in Figure 7, mainly contains two parts composition: routing iinformation administration module A11 and enquiry module A12.
Routing iinformation administration module A11, comprises routing table cache modules A 112, and in order to obtain topological structure description document, described topological structure description document comprises the title of the mark of source, the mark of destination, the title of the port of source and the port of destination; Also for the title of the port of obtaining communication source, described communication source is source to be established a communications link, and the port of described communication source is the port of source to be established a communications link; Also in order to record communication port information, described communication port information comprises the mark of described communication source, the title of port, the mark of communication objective end of communication source, the title of the port of communication objective end.
Enquiry module A12, in order to search the title of port and the mark of communication objective end of the communication objective end corresponding with the port of described communication source in described topological structure description document, the port of described communication objective end is the port of the destination corresponding with the port of source described to be established a communications link, and described communication objective end is the destination corresponding with source to be established a communications link.
Enquiry module A12 generally provides two interfaces: interface is in order to the title of the mark of query communication destination, the port of communication objective end; Another interface in order to the mark of query communication source, the title of port of communication source.
If described topological structure description document also comprises the number of the title of described source, type and communication port; The type of the port of described source and time of delay; The type of the port of described source comprises: type of receipt, transmission types and reception are held concurrently transmission types, then enquiry module A12, also in order to search type and the time of delay of the port of described source in described topological structure description document; And the type of the port of described source and time of delay are added in communication port information.
After routing table cache modules A 112 obtains topological structure description document, this file is preserved into a router cache table, stored in routing table cache modules A 112, the content of router cache table is identical with topological structure description document.The structure of router cache table is the annexation queue organized by row, article one, annexation describes the connection of a pair port, comprise: " mark of source ", " mark of destination ", " title of the port of source ", " title of the port of destination ", " type ", " time of delay " six fields.
Routing table cache modules A 112 mainly has the following advantages, when when the concurrent transaction level simulation system simulated is huge, the annexation of preserving huge system in partial model or other simulators needs a large amount of internal memory, therefore, in order to reduce memory cost, routing table cache modules A 112 will only preserve the conventional routing iinformation of part.Described routing iinformation mostly refers to communication port information, that is, the communication port information of conventional port or partial model, from topological structure description document, is kept in router cache table, which saves memory space by routing table cache modules A 112.
Routing iinformation administration module A11 also comprises update module A111, when the routing iinformation needing to search is in routing table cache, directly will obtain information; If the routing iinformation searched is not in routing table cache, routing table cache modules A 112 needs read topological structure description document again, obtain corresponding routing iinformation, update module A111 is according to new topological structure description document, and the old router cache table of preservation before replacing in routing table cache modules A 112.
That is, update module A111 routers cache table carries out upgrading and safeguarding.If enquiry module A12 is in router cache table, search the communication port information of the port less than communication source, then routing table cache modules A 112 obtains topological structure description document again, obtain corresponding information, new information is preserved in old router cache table by update module A111, forms new router cache table.That is, update module A111 according to new topological structure description document, corresponding new and old router cache table, and preserve and form new router cache table.
Fig. 8 is the flow chart of a kind of execution mode of the message method of communication port provided by the invention, comprising:
S201, reads the communication port information corresponding with the port of described communication source from described port router, and is that communication source and corresponding communication objective end set up communication port and configuration communication passage based on described communication port information;
S202, obtains event bag, and the title of the port of the source that communicates of event content and this event bag of transmission drawn together by described event handbag;
S203, adds described event content and forms message by described communication port information;
S204, sends described message by described communication port.
Because the traffic volume of message is general larger, therefore described message method also comprises according to sending time of message, sets up the transmission buffer queue of message, this prevent message at one time in pour in, strengthen the live load of communication port, cause the situation when machine or clogged with messages.Message is issued to communication objective end by communication port, and communication port is generally by parallel host real-time performance.
Described event bag is sent by component logic, and this is the function in order to better divided parts logic.Component logic is used for transmission event bag or receive the result of event content, and that is described component logic is in order to complete the logic function except contacts with overseas parties.Communication port is for receiving event content, event bag or the event of transmission bag, message or result.The service area of component logic with communication port is separated, prevents both functions from intersecting, lump together, improve the reusability of partial model.
Fig. 9 is the flow chart of a kind of execution mode of the message receival method of communication port provided by the invention, comprising:
S301, receives described message by the communication port corresponding with described communication source;
S302, resolves described message, obtains the title of the port of the communication objective end of event content and this message of reception.
The message that communication objective termination is received is sent by the message method of the communication port shown in Fig. 9, and according to receiving the time sequencing of described event content, set up the reception buffer queue of described event content.Because event content comprises in the message, therefore the reception buffer queue of described event content is generally set up, therefore also referred to as message sink buffer queue according to the time sequencing of receiving package containing the message of this event content.
After communication objective termination receives described message, it is resolved, obtains concrete communication port information, carry out follow-up work.When resolving described message, according to receiving putting in order of buffer queue, resolve described message one by one.
Follow-up work comprises, and processes described event content, and feedback processing result, described result feeds back to the component logic of communication objective end.When processing described message, the mark of the communication source of described message, the communication title of port of source and the mark of communication objective end can also be obtained as required.
Figure 10 is the structure chart of a kind of execution mode of communication port A2 provided by the invention, comprising:
Port arrangement modules A 21 in order to obtain the communication port information corresponding with the port of described communication source from port router, and is communication source and corresponding communication objective end configuration communication passage based on described communication port information;
Message transmission module A22, in order to obtain event bag, described event handbag draws together event content and the title of the port of the source that communicates of this event bag of transmission, described communication port information is added described event content and forms message and send described message.
Communication port A2 also comprises:
Message processing module A23, in order to obtain and to process the event content in the message of other communication port transmission, feeds back to component logic A4 by result;
Message sends cache module A24, in order to the time sequencing according to the message sent, sets up the transmission buffer queue of described message;
Message sink cache module A25, in order to the time sequencing according to event content in the message received, sets up the reception buffer queue of described event content;
Port information administration module A26, in order to preserve the communication port information corresponding with the port of described communication source.
The structure of communication port as shown in Figure 6.Communication port A2 comprises port arrangement modules A 21, message transmission module A22 and message sink cache module A25, and message sends cache module A24, message processing module A23, port information administration module A26.
Wherein port arrangement modules A 21 obtains the communication port information corresponding with the port of described communication source, and is communication source and corresponding communication objective end configuration communication passage based on described communication port information.After port arrangement modules A 21 obtaining communication port information, described communication port will have been configured, with ensure message send or receive carry out smoothly.
Message transmission module A22 and message processing module A23 is used for the transmission of control message, reception and process, port information administration module A26 is used for the link information, communication port information etc. of minute book port, the link information of the port comprises this port and which port exists annexation, which communication objective end there is annexation etc. with.Communication port information comprises the title of the port, the title of the port of destination, the type (transmission types, type of receipt send type of receipt of holding concurrently) of port.
Communication port can also only for receiving and processing messages, and this communication port comprises message processing module, in order to obtain described event content; Described message processing module is also in order to process described event content, and feedback processing result is to the component logic of communication objective end.This also comprises: message sink cache module for receiving the communication port with processing messages, in order to according to the time sequencing obtaining described event content, sets up the reception buffer queue of described event content.
Communication port can be divided into three kinds according to its function: only send the communication port of message, receive only the communication port of message, has not only sent but also the communication port of receipt message.Not only sent but the communication port of receipt message identical with the structure of communication port A2 or close; Receive only the communication port of message, the message processing module generally only comprised and message sink cache module or with above-mentioned two kinds of same or similar modules of functions of modules; The communication port only sending message generally comprises port arrangement module, message transmission module, and message sends cache module and port information administration module.
Figure 11 is the structure chart (eliminating the concrete structure of communication port A2 in figure) of a kind of execution mode of communication module provided by the invention, comprising: port router A1, port queue administration module A32 and communication controler A31;
Communication controler A31, in order to obtain event bag, described event handbag draws together event content and the title of port of the source that communicates sending this event bag;
Port queue administration module A32, in order to obtain the communication port information corresponding with the port of described communication source from port router A1, and sets up communication port A2 based on described communication port information;
Communication port A2 comprises:
Port arrangement module in order to obtain described communication port information from port router A1, and is communication source and corresponding communication objective end configuration communication passage based on described communication port information;
Message transmission module, in order to obtain described event bag from described communication controler, adds described event content and forms message and send described message by described communication port by described communication port information.
Communication module A3 is generally used for receiving or initiating a message, and therefore communication controler A31 is also in order to receive the message sent by the port of communication source, and this message comprises communication port information and the event content of the port of the communication source sending this message.That is communication controler A31 is used for receiving the message that miscellaneous part model sends.
If communication controler A31 is also in order to receipt message, then port queue administration module A32, also in order to resolve the message that described communication controler receives, the title of the port of the event content obtaining this message and the communication objective end receiving this message.
Communication port A2 also comprises message processing module, resolve the event content obtained, and feedback processing result is to the component logic of communication objective end in order to receive and to process described port queue administration module; Message sends cache module, in order to according to the time sequencing sending described message, sets up the transmission buffer queue of described message; Message sink cache module, in order to the time sequencing of the event content according to the message received, sets up the reception buffer queue of described event content; Port information administration module, in order to preserve the port information of described communication port.
Message sends cache module and message sink cache module can also set up buffer queue according to message or the priority of event content, the capacity etc. of message.
Port queue administration module A32, also in order to monitoring communications port A2, when communication port A2 is idle, controls this communication port and receives described event content or send described message.By port queue administration module A32 monitoring communications port A2, control this communication port receive described event content when the free time or send described message, this is to prevent clogged with messages, further, receive described event content according to this communication port of sequential control of buffer queue or send described message.
Figure 12 be message provided by the invention send flow graph, Figure 13 is the reception flow graph of message provided by the invention.Describe in detail below in conjunction with Fig. 8, Fig. 9, Figure 10, Figure 11, Figure 12 and Figure 13.
After concurrent transaction level simulation system starts, communication module A3 will configure automatically.First port router A1 will read topological structure description document, be kept in routing table cache modules A 112 by the topological structure description document read, and form route-caching table.Then enquiry module A12 searches the title of the port of the communication objective end corresponding with the port of described communication source and the mark of communication objective end in route-caching table.
Communication module A3 using the partial model belonging to oneself as communication source, from the communication port information that port router A1 acquisition is corresponding with the port of described communication source, and set up based on described communication port information the communication objective end configuration communication passage that communication port is also communication source and correspondence.Specifically, port queue administration module A32, is inquired about by the enquiry module A12 in port router A1, obtains the communication port information that communication module A3 needs, and sets up communication port A2 based on described communication port information.Communication port information comprises the mark of destination, the title of the port of destination, and the type of this port is single transmission, reception or transceiver port.Communication port information will be kept in the port information administration module A26 of each communication port.Port queue administration module A32 obtaining communication port information, therefrom determines to need to set up several communication port.
Port arrangement modules A 21 finds the communication mark of source and the mark of communication objective end from communication port information, configuration communication port between the two.When component logic A4 needs to send message, need by communication port, message is sent to communication objective end from communication source.Communication port is generally rely on parallel host real-time performance, sends message, also can regard as and send message by parallel host network by communication port.
Message transmitting process as shown in figure 12, when component logic A4 outwards sends message by communication port A2, only needs to indicate to use which communication port, without the need to providing this port connection in systems in which.As shown in figure 12, the event bag that component logic A4 sends only comprises " title of transmit port " and the most substance of " event content " two, the title of the communication port of " title of the transmit port " source that namely communicates.When event bag enters communication module A3, first will carry out Message Processing by communication controler A31, communication controler A31 resolves message, obtains " title of transmit port " and " event content ".After port queue administration module A32 obtains the control of respective communications port, the event bag after resolving is temporarily stored in message transmission cache module A24.The control obtaining respective communications port refers to, whether idlely monitors this port, when this port is idle, controls this port and sends message.Message transmission module A22, when external communication port is idle, sends cache module A24 from message and takes out an event bag, and the communication port information adding corresponding port according to " title of transmit port " forms message.Generally, for event bag increases " mark of communication source ", " title of the port of communication source ", " mark of communication objective end ", " title of the port of communication objective end " four fields, based on the content of these four fields, message can send in parallel host network A 61.
First the receiving course of message as shown in figure 13, after the partial model that the message sent by communication source is arrived as communication objective end by the host network A 61 that walks abreast, will pass to communication controler A31, be resolved the message received by communication controler A31.Now message comprises communication port information and the event content of the port of the communication source sending this message, comprise particularly " mark of communication source ", " title of the port of communication source ", " mark of communication objective end ", " title of the port of communication objective end ", and " event content " five parts.According to " title of the port of communication objective end ", message bag is simplified as only having " title of receiving port " and " event content " two parts by port queue administration module A32, and obtain the control of corresponding receiving port, namely monitor this port, when this port is idle, control this port accepts.Wherein " title of receiving port " namely " title of the communication port of communication objective end ".Message after simplifying will pass to the message sink cache module A25 of communication port A2, and when this port is idle, pass to message processing module A23 process, result will be passed to component logic A4.
Figure 14 is the structure chart of a kind of execution mode of partial model provided by the invention, and Figure 15 is the structure chart of a kind of execution mode of concurrent transaction level simulation system provided by the invention.Describe in detail below in conjunction with Figure 14 and Figure 15.
Figure 14 is the structure chart of a kind of execution mode of partial model provided by the invention, and partial model A62 comprises: communication module A3 and component logic A4.Component logic A4, for sending event bag or receiving result.
Figure 11 is the structure chart of a kind of execution mode of concurrent transaction level simulation system provided by the invention, and concurrent transaction level simulation system A6 comprises partial model A62 and parallel host network A 61.
Each partial model A62 simulates the part in concurrent transaction level simulation system A6 independently, and carries out the transmission of message by parallel host network A 61.When needing to carry out mutual between partial model A62, will by parallel host network A 61 forwarding messages.When simulating concurrent transaction level simulation system A6, being realized by message mutual between two partial model A62, in message, comprising event content or event bag.Event bag is the packet of User Defined structure.In this packet, abstract realization is the event content of granularity with sequential between hardware module by user.
The interaction protocol that the process of interacting message adopts with partial model A62 is usually irrelevant, usually the details such as concrete bus timing are not related to, that is, component logic A4 sends or receives result, and communication module A3 is responsible for that event handbag is dressed up message and is sent by its communication port A2.Component logic A4 is indifferent to message and is sent by whom, is only concerned about to have issued what message, have received what result.Accordingly, communication module A3 is indifferent to transmission or have received what message, is only concerned about what who sent, whom sends to.Partial model A62 be divide into two parts by this, and component logic A4 is responsible for transmission event bag or receives result, and communication module A3 is responsible for sending or receipt message.During design part model A62, no longer be entangled with and which kind of need communicate to connect in concurrent transaction level simulation system, how annexation between partial model designs, during design concurrent transaction level simulation system, how the annexation be also no longer entangled with between partial model designs the communication connection that could meet concurrent transaction level simulation system.These annexations or communication connection are preset in topological structure description document, only need obtain this file, carry out the configuration of communication port according to the content of this file, just can meet the demand of the communication connection of concurrent transaction level simulation system, and also achieve the annexation between partial model.
This not only reduces the degree of coupling between partial model and concurrent transaction level simulation system, and improves the development efficiency of concurrent transaction level simulation system.If when the communication connection of the annexation between partial model or concurrent transaction level simulation system changes, only need corresponding content in amendment topological structure description document, then route cache table and communication port information are upgraded, just can complete the amendment of the communication connection of annexation between partial model or concurrent transaction level simulation system.This reduces the expense safeguarded partial model and concurrent transaction level simulation system, no longer needs to redesign partial model or concurrent transaction level simulation system, enhances the reusability of partial model, reduce the wasting of resources, saved cost.
Figure 16 is the communication connection schematic diagram of partial model in concurrent transaction level simulation system provided by the invention.Figure 12 is described in the correspondence between the partial model A62 of two parallel runnings in concurrent transaction level simulation system, omits and other structures herein.As shown in figure 16, communication module A3 mainly comprises: communication port A2, communication controler A31, port queue modules A 32, port router A1 for the structure of the communication module A3 of concurrent transaction level simulation and the applied environment in concurrent transaction level simulation system thereof.Port router A1 obtains outside topological structure description document.
Communication port A2 is connected with port router A1 by port queue modules A 32, can be obtained the information in port router A1 by port queue modules A 32.
As shown in figure 16, undertaken by communication module A3 alternately between two partial models, when component logic A4 needs to carry out PERCOM peripheral communication, first event bag will be passed to communication module A3, be responsible for event to encapsulate dress up message and forward by communication module A3; Equally, when receipt message, first the message received will be responsible for process by communication module A3, then pass to component logic A4.Under this scheme, component logic A4 is undertaken relying on communication module A3 completely with the mutual of outside, when not considering external condition, can realize the internal logic of partial model A62 independently, this design improves the development efficiency of partial model effectively.
Each partial model A62 can be divided into two parts, and a part does not relate to externally mutual component logic A4, and another part is responsible for the communication module A3 with outside mutual.Figure 16 is the structure chart of a kind of execution mode of event bag provided by the invention, and Figure 17 is the structure chart of a kind of execution mode of message provided by the invention.
Event bag B1 shown in Figure 17, comprises title B11 and the event content B10 of transmit port, and the title B11 of transmit port namely communicates the title of port of source.Event bag B1 is sent by component logic A4.Message B2 shown in Figure 18, comprises event content B10, the mark B12 of communication source, the title B11 ' of the port of communication source, the mark B13 of communication objective end, the title B14 of the port of communication objective end.The title B11 ' of the port of the source that wherein communicates is identical with the title B11 of transmit port in Figure 17.Message B2 is after receiving event bag B1 by communication module A3, adds that ingress port information formed, and is finally sent by communication port.
In sum, technical scheme disclosed in the embodiment of the present invention, improves the development efficiency of concurrent transaction level simulation system, reduces the expense safeguarded partial model and concurrent transaction level simulation system.
Although the present invention with preferred embodiment openly as above; but it is not for limiting the present invention; any those skilled in the art without departing from the spirit and scope of the present invention; the Method and Technology content of above-mentioned announcement can be utilized to make possible variation and amendment to technical solution of the present invention; therefore; every content not departing from technical solution of the present invention; the any simple modification done above embodiment according to technical spirit of the present invention, equivalent variations and modification, all belong to the protection range of technical solution of the present invention.

Claims (20)

1. set up the analogy method communicated between partial model, it is characterized in that, comprising:
Described partial model is distributed in the matrix form, determines the dimension of described matrix;
According to the type of described partial model, described matrix is divided into submatrix, based on dimension and the position generation distribution and expression formula of described submatrix in described matrix of described matrix, described distribution and expression formula describes the position coordinates of described partial model in described matrix;
Generate annexation based on the position coordinates of described partial model in described matrix and the annexation between partial model to be simulated and express formula, described annexation expression formula describes the annexation between described partial model;
Check that whether the logic of described distribution and expression formula and annexation expression formula is correct, if correct, express formula based on described distribution and expression formula and annexation, generate the description document of concurrent transaction level simulation system, described description document comprises position coordinates and the annexation of described partial model, described annexation is with the Name & Location coordinate of source partial model, and the Name & Location coordinate of destination partial model represents;
Logically true position coordinates and the partial model one_to_one corresponding referring to described partial model of described distribution and expression formula; Described annexation is expressed the logically true of formula and is referred to that described annexation expression formula comprises the annexation of each partial model, and described partial model does not have the annexation of redundancy.
2. set up the analogy method communicated between partial model as claimed in claim 1, it is characterized in that, the described dimension based on described matrix and the described submatrix position in described matrix generates distribution and expression formula and comprises: based on dimension and the position of described submatrix in described matrix of described matrix, determine the parameter in the distribution formula set up in advance, obtain described distribution and expression formula, described distribution formula is:
<x m,y n>,x m,y n=(i,j,+,-,×,÷,k),i∈[0,N],j∈[0,N],k∈N,m∈N,n∈N
Wherein <x m, y n> represents the position coordinates of described partial model in described matrix, x mrepresent abscissa, y nrepresent ordinate, x mbe the function of i, i is based on the dimension determination span of described matrix; y nbe the function of j, j is based on the dimension determination span of described matrix, and k represents constant, and determine based on the position of described submatrix in described matrix, N represents the integer being more than or equal to 0.
3. set up the analogy method communicated between partial model as claimed in claim 2, it is characterized in that, the distribution formula generating two-dimensional matrix based on described distribution formula is:
<x g,y h>,x g=a·i+b,y h=c·j+d,i=[0,A-1],j=[0,B-1],a∈N,b∈N,c∈N,d∈N,g∈N,h∈N
The dimension of described two-dimensional matrix comprises the line number of described two-dimensional matrix and the columns of described two-dimensional matrix, and wherein A represents the columns of described two-dimensional matrix, and B represents the line number of described two-dimensional matrix; A is the coefficient of i, and c is the coefficient of j, and b, d are constant, and a, b, c, d determine based on the span of i and j and the position of described submatrix in described matrix, N be more than or equal to 0 integer.
4. set up the analogy method communicated between partial model as claimed in claim 1, it is characterized in that, describedly generate annexation based on the position coordinates of described partial model in described matrix and the annexation between partial model to be simulated and express formula and comprise: determine the annexation Parameters in Formula set up in advance based on the position coordinates of described partial model in described matrix, the described submatrix position in described matrix and the annexation between partial model to be simulated, obtain described annexation and express formula, described annexation formula is:
n∈N,l∈N,p∈N,v∈N,u∈N
<x l, y p> and <x v, y u> represents the position coordinates of two partial models with annexation, and n represents constant, and N represents the integer being more than or equal to 0.
5. set up the analogy method communicated between partial model as claimed in claim 1, it is characterized in that, before checking that whether the logic of described distribution and expression formula and annexation expression formula is correct, also comprise: check that described distribution and expression formula and annexation are expressed formula and whether met default syntactic information; Described syntactic information comprises spelling requirement and the algorithm of described distribution formula and annexation formula.
6. set up the analogy method communicated between partial model as claimed in claim 5, it is characterized in that, also comprise: if described distribution and expression formula and annexation express formula do not meet described syntactic information and/or logic error, then feed back error message.
7. set up the analogy method communicated between partial model as claimed in claim 1, it is characterized in that, the type of described partial model comprises: processor type, type of memory, router type.
8. the analogy method that setting up as described in any one of claim 1-7 communicates between partial model, is characterized in that, described matrix is two-dimensional grid or two-dimentional looped network.
9. as described in claim 1, any one of 5-7, set up the analogy method communicated between partial model, it is characterized in that, described matrix is three-dimensional grate.
10. the method for routing communicated between partial model, is characterized in that, comprising:
The analogy method described in any one of claim 1 to 9 is utilized to generate the description document of concurrent transaction level simulation system;
The title of obtaining communication source, described communication source is source partial model to be established a communications link;
In the description document of described concurrent transaction level simulation system, search the title of the communication objective end corresponding with described communication source, described communication objective end is the destination partial model corresponding with source to be established a communications link;
Record communication port information, described communication port information comprises the Name & Location coordinate of described communication source, the Name & Location coordinate of communication objective end;
Be that described communication source and communication objective end set up communication port and configuration communication passage based on described communication port information.
The method for routing communicated between 11. partial models as claimed in claim 10, it is characterized in that, described description document also comprises the type of described partial model, the type of described partial model is the type of described communication source, and the type of described partial model comprises: processor type, type of memory, router type.
The method for routing communicated between 12. partial models as claimed in claim 11, is characterized in that, be also included in described description document the type of searching the partial model corresponding with the type of described communication source; Described communication port information also comprises the type of described communication source.
13. 1 kinds of communication modules, is characterized in that, comprise port router, port queue administration module and communication controler;
Described port router, in order to obtain the description document of the concurrent transaction level simulation system utilizing the analogy method described in any one of claim 1 to 9 to generate, and the title of obtaining communication source, described communication source is source partial model to be established a communications link; Also in order to search the title of the communication objective end corresponding with described communication source in described description document, described communication objective end is the destination partial model corresponding with source to be established a communications link; Also in order to record communication port information, described communication port information comprises the Name & Location coordinate of described communication source, the Name & Location coordinate of communication objective end;
Described communication controler, in order to obtain event bag, described event handbag draws together event content and the title of port of the source that communicates sending this event bag;
Described port queue administration module, in order to obtain the communication port information corresponding with described communication source from described port router, and sets up communication port based on described communication port information;
Described communication port comprises:
Port arrangement module in order to obtain described communication port information, and is communication source and corresponding communication objective end configuration communication passage based on described communication port information;
Message transmission module, in order to obtain described event bag from described communication controler, adds described event content and forms message and send described message by described communication port by described communication port information.
14. communication modules as claimed in claim 13, is characterized in that, described communication controler, also in order to receive the message sent by communication source.
15. communication modules as claimed in claim 14, is characterized in that, described port queue administration module, also in order to resolve the message that described communication controler receives, and the title of the port of the event content obtaining this message and the communication objective end receiving this message.
16. communication modules as claimed in claim 15, it is characterized in that, described communication port also comprises: message processing module, resolves the event content obtained, and send result in order to receive and to process described port queue administration module.
17. 1 kinds of partial models comprising the communication module described in any one of claim 13-16.
18. partial models as claimed in claim 17, is characterized in that, also comprise component logic, for sending the result of event bag or reception event content.
19. 1 kinds of concurrent transaction level simulation system comprising the partial model described in claim 17 or 18.
20. concurrent transaction level simulation system as claimed in claim 19, is characterized in that, also comprise parallel host network, in order to realize the message transmission between partial model.
CN201110110822.1A 2011-04-29 2011-04-29 Simulating and routing method of communication between component models and concurrent transaction level simulation system Active CN102761473B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110110822.1A CN102761473B (en) 2011-04-29 2011-04-29 Simulating and routing method of communication between component models and concurrent transaction level simulation system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110110822.1A CN102761473B (en) 2011-04-29 2011-04-29 Simulating and routing method of communication between component models and concurrent transaction level simulation system

Publications (2)

Publication Number Publication Date
CN102761473A CN102761473A (en) 2012-10-31
CN102761473B true CN102761473B (en) 2015-01-14

Family

ID=47055799

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110110822.1A Active CN102761473B (en) 2011-04-29 2011-04-29 Simulating and routing method of communication between component models and concurrent transaction level simulation system

Country Status (1)

Country Link
CN (1) CN102761473B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2876512A1 (en) * 2013-11-25 2015-05-27 dSPACE digital signal processing and control engineering GmbH Method for automatically connecting components of a model of a technical system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1879110A (en) * 2003-11-10 2006-12-13 罗伯特.博世有限公司 Simulation system and computer-implemented method for simulation and verifying a control system
CN102354123A (en) * 2011-07-18 2012-02-15 北京航空航天大学 Cross-platform extendible satellite dynamic simulation test system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000259636A (en) * 1999-03-05 2000-09-22 Hitachi Ltd Graph structure inspection system
JP2009282669A (en) * 2008-05-21 2009-12-03 Nec Corp Circuit comparison apparatus, circuit comparison method, and program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1879110A (en) * 2003-11-10 2006-12-13 罗伯特.博世有限公司 Simulation system and computer-implemented method for simulation and verifying a control system
CN102354123A (en) * 2011-07-18 2012-02-15 北京航空航天大学 Cross-platform extendible satellite dynamic simulation test system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《面向用户的并行计算***可用性建模研究》;郑方、郑霄、李宏亮等;《计算机研究与发展》;20080219 *
张昆、钱磊、李宏亮等.《VCPPS:一种面向并行Verilog模拟的代码分割器》.《计算机工程与科学》.2009, *

Also Published As

Publication number Publication date
CN102761473A (en) 2012-10-31

Similar Documents

Publication Publication Date Title
CN105608088B (en) A kind of database based on configuration file automatically creates and data dynamic recording method
CN103178996B (en) Distributed packet-switching chip model verification system and method
US9110884B2 (en) Message publishing and subscribing method and apparatus
CN103020024B (en) A kind of file layout change-over method
CN110413690A (en) Method of data synchronization, server, electronic equipment, the storage medium of database
CN105553851A (en) SDN-based network processor microcode and flow table implementation device and method
US20220083498A1 (en) Data transmission method and device for network on chip and electronic apparatus
Li et al. Wide-area spark streaming: Automated routing and batch sizing
CN109858285B (en) Block chain data processing method, device, equipment and medium
CN102402616B (en) Method and system for realizing database cluster
CN106708764A (en) Universal IO processing system for airborne avionic system
JP2014502756A (en) Apparatus and method for mass data storage based on tree structure
WO2022193183A1 (en) Network-on-chip simulation model generation method and apparatus, electronic device, and computer-readable storage medium
CN102761473B (en) Simulating and routing method of communication between component models and concurrent transaction level simulation system
CN102855278B (en) A kind of emulation mode and system
CN108282347A (en) A kind of server data online management method and system
CN102761472B (en) Communication port and routing method thereof, communication module and concurrent transaction level simulation system
CN104090895B (en) Obtain the method for radix, device, server and system
CN101834876B (en) Distributed semi-physics simulation system based on Bluetooth, database and UDP protocol and data summarization and distribution method thereof
CN110517369B (en) Fault tree construction method and system based on mind map
CN107968722A (en) A kind of conversion method of Interface Control File to AFDX network equipments configuration files
CN102722592B (en) Universal digital information recording device and method
CN108055077B (en) Verification device for applied optical fiber bus network and optical fiber bus network
CN106330556A (en) Method and device for generating service module calling associated information
CN114372051A (en) Data processing system, and data processing method and device based on block chain

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant