CN102761473A - 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 PDFInfo
- Publication number
- CN102761473A CN102761473A CN2011101108221A CN201110110822A CN102761473A CN 102761473 A CN102761473 A CN 102761473A CN 2011101108221 A CN2011101108221 A CN 2011101108221A CN 201110110822 A CN201110110822 A CN 201110110822A CN 102761473 A CN102761473 A CN 102761473A
- Authority
- CN
- China
- Prior art keywords
- partial model
- communication
- annexation
- port
- 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.)
- Granted
Links
Images
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Computer And Data Communications (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
Technical field
The present invention relates to parallel transaction-level imitation technology in the hardware system, especially a kind of analogy method, method for routing, communication module, partial model and parallel transaction-level analogue system of communicating by letter between partial model of setting up.
Background technology
In extensive Hardware Design, the method for parallel transaction-level analog simulation is important techniques means.The parallel transaction-level analogue system that parallel transaction-level simulation adopts design to comprise the system level simulation device is usually come the simulated target system.The functional part in the partial model simulated target system in the system level simulation device wherein.
Because the simulation of extensive hardware system has its particularity, and is huge such as hardware system, the complex structure of hardware system; Functional part is of a great variety; Annexation between the functional part is complicated, so the development time of system level simulation device is longer, and expense is bigger.In parallel transaction-level design of simulating system process, the system level simulation device of desired design exploitation can have long-term value usually, and partial model and system level simulation device can be reused.But because partial model should realize that logic function realizes communication function again; In the different systems; The logic function and the communication function of partial model are not quite similar, and this causes the reusability of partial model relatively poor, and the reusability of corresponding system level simulation device is also relatively poor.In addition; The system level simulation device is generally used for the checking of goal systems; Because the structure of target hardware system often changes various in design process; Corresponding system level simulation device also will change, thereby the design of partial model also can change, and the variation of partial model in like manner also can affect the variation of system level simulation device.Both variations are mutual, and when making amendment, both also check and balance.
Present parallel transaction-level modeling method can't guarantee that the design process of system level simulation device and partial model separates, and the transaction-level design of simulating system that just walks abreast can't be separated with the design of partial model, causes both design processes can't be independent.Wherein any one modification must cause another person's modification, and this makes that the development efficiency of parallel transaction-level analogue system is lower, and the modification in later stage and maintenance difficulties are bigger, and development cost is also higher.
Published at " ANALYSIS in 2009; 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) disclose a parallel transaction-level analog platform, this platform realizes that based on the SystemC simulator of OSCI its main purpose is to obtain the improved efficiency of Parallel Simulation through the time decoupling zero character in the simulation of excavation transaction-level.Yet because the measured transaction-level simulator of this method SystemC realizes that its operation expense is relatively poor with flexibility, and this method does not have consideration how for the modeling of system-level model effective support to be provided.
But how to reduce the degree of coupling between partial model and the parallel transaction-level analogue system, improve the development efficiency of parallel transaction-level analogue system, reduce expense, become one of present problem demanding prompt solution partial model and the maintenance of parallel transaction-level analogue system.
Summary of the invention
The problem of the present invention's solution is the degree of coupling that reduces between partial model and the parallel transaction-level analogue system, improves the development efficiency of parallel transaction-level analogue system, reduces the expense to partial model and the maintenance of parallel transaction-level analogue system.
For addressing the above problem, the invention provides a kind of analogy method of communicating by letter between partial model of setting up, comprising:
Said partial model is distributed with matrix form, confirm the dimension of said matrix;
Type according to said partial model; Said matrix is divided into submatrix; Dimension and the position of said submatrix in said matrix based on said matrix generate the distribution and expression formula, and said distribution and expression formula is described the position coordinates of said partial model in said matrix;
Generate annexation based on position coordinates and the annexation between partial model to be simulated of said partial model in said matrix and express formula, said annexation expression formula is described the annexation between the said partial model;
Whether the logic of checking said distribution and expression formula and annexation expression formula is correct; If correctly then express formula based on said distribution and expression formula and annexation; Generate the description document of parallel transaction-level analogue system, said description document comprises the position coordinates and the annexation of said partial model, and said annexation is with the Name & Location coordinate of source end pieces model; The Name & Location coordinate representation of destination partial model, said position coordinates are the sign of said partial model;
The logically true position coordinates of said partial model that is meant of said distribution and expression formula is corresponding one by one with partial model; Said annexation is expressed the logically true of formula and is meant the annexation that comprises each partial model in the said annexation expression formula, and said partial model does not have redundant annexation.
Optional; Said dimension and the position generation distribution and expression formula of said submatrix in said matrix based on said matrix comprises: based on the dimension and the position of said submatrix in said matrix of said matrix; Parameter in the distribution formula of confirming to set up in advance; Obtain said distribution and expression formula, said 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>Represent the position coordinates of said partial model in said matrix, x
mThe expression abscissa, y
nThe expression ordinate, x
mBe the function of i, i confirms span based on the dimension of said matrix; y
nBe the function of j, j confirms span based on the dimension of said matrix, and k representes constant, confirms that based on the position of said submatrix in said matrix N representes integer.
Optional, the distribution formula that generates two-dimensional matrix based on said distribution formula 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 said two-dimensional matrix comprises the line number of said two-dimensional matrix and the columns of said two-dimensional matrix, and wherein A representes the columns of said two-dimensional matrix, and B representes the line number of said two-dimensional matrix; A is the coefficient of i, and c is the coefficient of j, and b, d are constant, a, and b, c, d confirms that based on span and the position of said submatrix in said matrix of i and j N is an integer.
Optional; Saidly generate annexation expression formula based on position coordinates and the annexation between partial model to be simulated of said partial model in said matrix and comprise: parameter in the annexation formula of confirming to set up in advance based on the position coordinates of said partial model in said matrix, said submatrix position and the annexation between partial model to be simulated in said matrix; Obtain said annexation and express formula, said annexation formula is:
n∈N,l∈N,p∈N,v∈N,u∈N
<x
l, y
p>With<x
v, y
u>Expression has the position coordinates of two partial models of annexation, and n representes constant, and N representes natural number.
Optional, said distribution and expression formula of inspection and annexation express the logic of formula whether correct before, also comprise: check whether said distribution and expression formula and annexation expression formula meets preset grammatical information; Said syntactic information comprises the spelling requirement and the algorithm of said distribution formula and annexation formula.
Optional, the said analogy method of communicating by letter between partial model of setting up also comprises: if said distribution and expression formula and annexation expression formula do not meet said syntactic information and/or logic error, then feed back error message.
Optional, the type of said partial model comprises: processor type, type of memory, router type.
Optional, said matrix is two-dimensional grid, two-dimentional looped network or three-dimensional grid.
The method for routing of communicating by letter between a kind of partial model comprises:
Utilize described analogy method to generate the description document of parallel transaction-level analogue system;
The title of obtaining communication source end, said communication sources end are source end pieces model to be established a communications link;
In the description document of said parallel transaction-level analogue system, search the title of the communication objective end corresponding with said communication sources end, said communication objective end is the destination partial model corresponding with source end to be established a communications link;
The record communication port information, said COM1 information comprises the Name & Location coordinate of said communication sources end, the Name & Location coordinate of communication objective end;
Based on said COM1 information is that said communication sources end and communication objective end are set up COM1 and configuration communication passage.
Optional, said description document also comprises the type of said partial model, and the type of said partial model is the type of said communication sources end, and the type of said partial model comprises: processor type, type of memory, router type.
Optional, the method for routing of communicating by letter between partial model also is included in the type of searching in the said description document with the corresponding partial model of type of said communication sources end; Said COM1 information also comprises the type of said communication sources end.
A kind of communication module comprises port router, port queue administration module and communication controler;
Said port router, in order to obtaining the description document of utilizing the parallel transaction-level analogue system that described analogy method generates, and the title of obtaining communication source end, said communication sources end is a source end pieces model to be established a communications link; Also in order in said description document, to search the title of the communication objective end corresponding with said communication sources end, said communication objective end is the destination partial model corresponding with source end to be established a communications link; Also in order to the record communication port information, said COM1 information comprises the Name & Location coordinate of said communication sources end, the Name & Location coordinate of communication objective end;
Said communication controler, in order to obtain the incident bag, said incident bag comprises the title of the event content and the port of the communication sources end that sends this incident bag;
Said port queue administration module in order to obtaining the COM1 information corresponding with said communication sources end from said port router, and is set up COM1 based on said COM1 information;
Said COM1 comprises:
The port arrangement module in order to obtaining said COM1 information, and is communication sources end and corresponding communication objective end configuration communication passage based on said COM1 information;
Message transmission module in order to obtain said incident bag from said communication controler, adds said event content with said COM1 information and forms message and send said message through said communication port.
Optional, said communication controler is also in order to receive the message of being sent by the communication sources end.
Optional, said port queue administration module also in order to resolve the message that said communication controler receives, obtains the title of event content with the port of the communication objective end that receives this message of this message.
Optional, said COM1 also comprises: message processing module, and resolve the event content that obtains in order to receive and to handle said port queue administration module, and send result.
A kind of partial model that comprises described communication module.
Optional, also comprise component logic, the result that is used to send the incident bag or receives event content.
A kind of parallel transaction-level analogue system that comprises aforesaid partial model.
Optional, said parallel transaction-level analogue system also comprises parallel host network, transmits in order to realize the message between partial model.
Compared with prior art, the present invention has the following advantages:
The form of said partial model with matrix distributed; And this matrix is divided into submatrix according to the type of partial model; Dimension and the position of said submatrix in said matrix based on said matrix generate the distribution and expression formula, and said distribution and expression formula has been described the position coordinates of said partial model in said matrix; Generate annexation based on position coordinates and the annexation between partial model to be simulated of said partial model in said matrix and express formula.Express formula based on said distribution and expression formula and annexation, generate the description document of parallel transaction-level analogue system.Said description document has comprised the annexation and the position coordinates thereof of said partial model.
Said description document has been simulated the annexation between the partial model, and the communication of setting up between the partial model through said description document connects.This has not only simplified the development procedure of parallel transaction-level analogue system, and has improved the development efficiency of parallel transaction-level analogue system.
If parallel transaction-level analogue system changes; Cause the distribution mode or the connection of partial model to change; Can or adopt new annexation formula according to the distribution mode after the change, recomputate the new distribution mode and the annexation of said partial model, obtain new description document.This can not remodify or design whole parallel transaction-level analogue system, only need recomputate or change the annexation formula and obtain new description document, just can realize whole parallel transaction-level design of simulating system.
Owing to revise separately or the apparatus of repair parts model, can not influence the operation of parallel transaction-level analogue system; Revise separately or safeguard parallel transaction-level analogue system, also can not influence the operation of partial model, thus this bigger simplification to the modification of partial model and parallel transaction-level analogue system and the work of maintenance.In addition, recomputate or change the annexation formula and obtain new description document, also reduced expense partial model and the maintenance of parallel transaction-level analogue system.
Description of drawings
Fig. 1 is a flow chart of setting up a kind of execution mode of the analogy method of communicating by letter between partial model provided by the invention;
Fig. 2 is the sketch map that distribution and expression formula provided by the invention and annexation are expressed a kind of execution mode of formula logical check;
Fig. 3 is the matrix structure diagram intention 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 of communicating by letter 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 a kind of flow chart of execution mode of the method for routing of COM1 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 a kind of flow chart of execution mode of the message method of COM1 provided by the invention;
Fig. 9 is a kind of flow chart of execution mode of the message receival method of COM1 provided by the invention;
Figure 10 is the structure chart of a kind of execution mode of COM1 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 is the flow graph that sends of message provided by the invention;
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 parallel transaction-level analogue system provided by the invention;
Figure 16 is that the communication of partial model in the parallel transaction-level analogue system provided by the invention connects sketch map;
Figure 17 is the structure chart of a kind of execution mode of incident 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 make above-mentioned purpose of the present invention, feature and advantage can be more obviously understandable, does detailed explanation below in conjunction with the accompanying drawing specific embodiments of the invention.
Because in existing parallel transaction-level modeling method; That gives partial model reusablely provides enough supports; Cause the modeling person of component-level model need be concerned about the design of system-level model; The modeling person of system-level model also need be concerned about the inside realization of component-level model on the other hand, so the degree of coupling of partial model and parallel transaction-level analogue system is higher, and both designs and modification can't independently be accomplished.This will cause the development efficiency of parallel transaction-level analogue system lower, and to its safeguard and the expense revised also bigger.
Fig. 1 is a flow chart of setting up a kind of execution mode of the analogy method of communicating by letter between partial model provided by the invention, comprising:
S11 distributes said partial model with matrix form, confirm the dimension of said matrix;
S12 according to the type of said partial model, is divided into submatrix with said matrix, based on the dimension and the position generation distribution and expression formula of said submatrix in said matrix of said matrix;
S13 generates annexation based on position coordinates and the annexation between partial model to be simulated of said partial model in said matrix and expresses formula;
S14 checks whether the logic of said distribution and expression formula and annexation expression formula is correct;
S15 expresses formula based on said distribution and expression formula and annexation, generates the description document of parallel transaction-level analogue system.
Fig. 2 is the flow chart that distribution and expression formula provided by the invention and annexation are expressed a kind of execution mode of formula logical check, comprising:
S31 checks whether said annexation expression formula comprises the annexation of each partial model;
S32 checks whether said annexation expression formula comprises the annexation of the redundancy of said partial model;
S33 checks whether position coordinates is corresponding one by one with partial model in the said distribution and expression formula.
Specify the said analogy method of communicating by letter between partial model of setting up below in conjunction with Fig. 1 and Fig. 2.At first referring to Fig. 1:
Among the S11, said partial model being distributed with matrix form, generally be that the form of said partial model with two-dimensional grid, two-dimentional looped network or three-dimensional grid distributed, and the partial model of same type is placed on the zone of closing on more.For two-dimensional matrix, the dimension of said matrix comprises the line number and the columns of matrix.
Among the S12,, said matrix is divided into submatrix, is meant that generally the partial model with same type is divided in the sub-matrices according to the type of said partial model.The position of said submatrix in said matrix generally is meant which row and column in the corresponding original matrix of row and column that said submatrix comprises.For example, after being divided into submatrix, first of submatrix is listed as the 3rd row in the corresponding original matrix.
Partial model distributes with matrix form, and its position coordinates in matrix is represented its abscissa and ordinate respectively with matrix column and row, and position coordinates is the sign of this partial model.
Among the S13, represent this partial model, generate annexation based on position coordinates and the annexation between partial model to be simulated of said partial model in said matrix and express formula with position coordinates.For example, the position coordinates of partial model A does<x
l, y
p>, the position coordinates of partial model B does<x
v, y
u>, if having annexation between the two, its annexation is expressed formula and can be write as
Among the S13, all correct if said distribution and expression formula and annexation are expressed the logic of formula, then generate the description document among the S14.The logically true position coordinates of said partial model that is meant of said distribution and expression formula is corresponding one by one with partial model; Said annexation is expressed the logically true of formula and is meant the annexation that comprises each partial model in the said annexation expression formula, and said partial model does not have redundant annexation.
Referring to Fig. 2; Wherein among the S31; Check whether said annexation expression formula comprises that the annexation of each partial model is meant, said annexation expression formula comprises the annexation of each partial model, that is to say; Whether the situation whether inspection occurs missing has the annexation of certain partial model not to be included in the said annexation expression formula.In parallel transaction-level analogue system, there is not isolated partial model, that is to say to have an annexation between partial model and the miscellaneous part model at least.Among the S31, comprise the inspection that whether has isolated partial model, isolated partial model occurs and belong to logic error.In addition, if partial model A has three annexations, but only comprised two annexations in the said annexation expression formula, this also belongs to situation about missing, and also belongs to logic error.
Check whether said annexation expression formula comprises that the annexation of the redundancy of said partial model is meant; Check whether said partial model has unnecessary annexation, for example, partial model A has annexation with partial model B; But through annexation being expressed the logical check of formula; Having obtained that annexation has occurred twice between these two partial models, once is redundant obviously in this twice, belongs to logic error.
Check whether position coordinates is corresponding one by one with partial model in the said distribution and expression formula; Be meant that a position coordinates can only a unique corresponding partial model; And a partial model also has only a unique position coordinates corresponding with it, and position coordinates is the sign of partial model.If the corresponding a plurality of partial models of a position coordinates occur, perhaps a partial model has a plurality of position coordinateses and all belongs to logic error.
In above-mentioned logical check, any one or a few logic error appears, and then said distribution and expression formula or annexation are expressed the logic mistake of formula, can't generate description document.
Among the S14, all correct if said distribution and expression formula and annexation are expressed the logic of formula, then generate description document.Said description document comprises the position coordinates and the annexation of said partial model, and said annexation is with the Name & Location coordinate of source end pieces model, the Name & Location coordinate representation of destination partial model.Because position coordinates and partial model are one to one, therefore said position coordinates can be used as the sign of said partial model.
The matrix that said partial model forms is divided into submatrix according to type, therefore also comprises the type of said partial model in the said description document.The type of said partial model is except comprising: processor type, type of memory, the router type, can also comprise type of hardware, external memory type, switch type etc.
The said analogy method of communicating by letter between partial model of setting up, also be included in inspection said distribution and expression formula and annexation express the logic of formula whether correct before, check whether said distribution and expression formula and annexation expression formula meets preset grammatical information; Said syntactic information comprises the spelling requirement and the algorithm of said distribution formula and annexation formula.
Also comprise,, then feed back error message if said distribution and expression formula and annexation expression formula do not meet in said syntactic information, the logic error one or more.Said error message comprises: reason of makeing mistakes and the position of makeing mistakes are concrete:
Said reason of makeing mistakes comprises: said distribution and expression formula or annexation express formula misspelling, do not meet in the said algorithm one or more, said position of makeing mistakes comprises: the position of misspelling or do not meet the position of said algorithm.For example, the title misspelling of partial model, parameter title misspelling, multiplying is write as add operation etc.
Said reason of makeing mistakes also comprises: if said annexation expression formula lacks in the corresponding a plurality of partial models of the position coordinates of partial model in the annexation of said partial model, the annexation that comprises the redundancy of said partial model, the said distribution and expression formula and the corresponding a plurality of position coordinates of partial model one or more.Feeding back said information of makeing mistakes comprises: title, the feedback of the partial model of the said annexation of feedback disappearance have the title of the partial model of redundant annexation.If corresponding a plurality of partial models of position coordinates in the said distribution and expression formula, the information that feedback is made mistakes comprises: feed back the title of the corresponding a plurality of partial models of this position coordinates, feedback has the title of the partial model of a plurality of position coordinateses.
Said matrix generally is two-dimensional grid, two-dimentional looped network and/or three-dimensional grid.The distribution formula of two-dimensional grid, two-dimentional looped network and/or three-dimensional grid and the expression mode of annexation formula have certain similitude; These formula are represented with the form of formula system; Be created as the reference representation storehouse, can directly apply mechanically formula so in use.
Said reference representation storehouse comprises parameter distributions formula to be determined and annexation formula; During use based on the dimension and the position of said submatrix in said matrix of said matrix; Parameter in the distribution formula of confirming to set up in advance obtains said distribution and expression formula; Parameter in the annexation formula of confirming to set up in advance based on the position coordinates of said partial model in said matrix, said submatrix position and the annexation between partial model to be simulated in said matrix obtains said annexation and expresses formula.
Said 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>Represent the position coordinates of said partial model in said matrix, x
mThe expression abscissa, y
nThe expression ordinate, x
mBe the function of i, i confirms span based on the dimension of said matrix; y
nBe the function of j, j confirms span based on the dimension of said matrix, and k representes constant, confirms that based on the position of said submatrix in said matrix N representes 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 said two-dimensional matrix comprises the line number of said two-dimensional matrix and the columns of said two-dimensional matrix, and wherein A representes the columns of said two-dimensional matrix, and B representes the line number of said two-dimensional matrix; A is the coefficient of i, and c is the coefficient of j, and b, d are constant, a, and b, c, d confirms that based on span and the position of said submatrix in said matrix of i and j N is an integer.
Said annexation formula is:
n∈N,l∈N,p∈N,v∈N,u∈N
<x
l, y
p>With<x
v, y
u>Expression has the position coordinates of two partial models of annexation, and n representes constant, and N representes natural number.
The target of parallel transaction-level modeling is exactly farthest to realize separating of partial model and parallel transaction-level analogue system, both design processes of de or modeling process.During the partial model modeling, need not to be concerned about the structure of parallel transaction-level analogue system; And during parallel transaction-level analogue system modeling, can directly utilize the existing parts model, set up the annexation between partial model through structure description file.
In parallel transaction-level modeling, if partial model is carried out appropriate design, can be so that it has reusable characteristic; Briefly; Be exactly the information that this partial model does not comprise system-level model, externally it seems to be exactly a receiving inputted signal, return " flight data recorder " of output signal.Based on this " flight data recorder ", the connection that the process of system-level modeling just only needs to describe these " flight data recorders " gets final product.
Fig. 3 is the matrix structure diagram intention of the distribution mode of partial model provided by the invention, specifies below in conjunction with Fig. 1, Fig. 2 and Fig. 3.
Shown in Figure 3 is the initial matrix of one 5 * 5 two-dimensional grid, and two base part model: sample_m1 and sample_m2 are wherein arranged, and sample_m1 representes processor, and sample_m2 representes internal memory.Type according to partial model is different, can this initial matrix be divided into a few sub-matrices pieces: N1, N2 and N3.Wherein N1 forms one 3 * 3 matrix, and matrix-block N2 forms one 2 * 3 matrix, and matrix N 3 forms one 5 * 2 matrix respectively.
The reference representation storehouse of setting 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 said two-dimensional matrix comprises the line number of said two-dimensional matrix and the columns of said two-dimensional matrix, and wherein A representes the columns of said two-dimensional matrix, and B representes the line number of said two-dimensional matrix; A is the coefficient of i, and c is the coefficient of j, and b, d are constant, a, and b, c, d confirms that based on span and the position of said submatrix in said matrix of i and j N is an integer.
The annexation formula of the partial model that two-dimensional matrix distributes is:
i∈[0,N],j∈[0,N],
n∈N,l∈N,p∈N,v∈N,u∈N
<x
l, y
p>With<x
v, y
u>Expression has the position coordinates of two partial models of annexation, and n representes constant, and N representes natural number.
The syntactic information of above-mentioned two formula comprises:
Algorithm comprises:
1, at first by ltr and dig constructed variable (var), the rule (beginning of letter, any a plurality of letters of followed or digit) according to var can construct two variable a1, a2.
2, by dig structure numeral (num),, can construct numeral 10 according to the rule (digit beginning, any a plurality of digits of followed) of Num.
3, by the definition of formula (fom) (between numeral, variable or the numerical variable according to oper combination), can obtain formula: a1+a2-10.
Three sub-matrices as shown in Figure 3: N1, N2 and N3 are that example specifies with submatrix N1, for describing conveniently, abscissa in the position coordinates and ordinate be not there to be < x, y>expression of footnote here.
Because submatrix N1 is 3 * 3, in the upper left corner of initial matrix, the triplex row and three row of the corresponding initial matrix of data of triplex row that comprises and three row.Abscissa x can get three values between 0 to 2, and is same, and ordinate y can get three values between 0 to 2, and three kinds of values of the three kinds of values of x 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 dimension 2 * 3 of submatrix N2 in like manner, in the lower left corner of initial matrix, preceding two row 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, the five-element's of corresponding initial matrix back two row.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,0), (2,1) to be positioned at tertial three partial models with submatrix N1; (2,2)), with submatrix N3 be positioned at the 4th row three partial models (position coordinates is respectively (3,0); (3,1), (3,2)) between annexation be that example explanation annexation is expressed formula.
If among the submatrix N1 the 3rd row first with submatrix N3 in first be listed as first and have annexation; Among the submatrix N1 among second of the 3rd row and the submatrix N3 second of first row have annexation, among the submatrix N1 the 3rd be listed as the 3rd with submatrix N3 in first be listed as the 3rd and have annexation.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 first row of submatrix N3 are the 4th row of initial matrix.Its annexation expression formula is:
In the said connection formula, the span of v and n is consistent, therefore can represent with identical parameter i.
In the said annexation expression formula, the part of numeral " 2 " and numeral " 3 " is to represent with predetermined syntactic information.For example, dig::=0|3|, num::=dig
*, num representes numeral " 3 ", DIG::=0|2|, NUM::=DIG so
*, NUM representes numeral " 2 ", so above-mentioned annexation expression formula becomes:
Wherein, NUM and num are the parameter according to the numeric type of preset grammatical information definition.
According to preset grammatical information, inspection distribution and expression formula and annexation express whether the grammer of formula is correct, and comprising: whether the spelling of parameter title is correct, and whether algorithm is correct.For example: num is made up of one or multidigit dig, and dig is Arabic numerals, and as 3 being 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.
The num spelling of representing the 6th row makes mistakes.
Inspection distribution and expression formula and annexation are expressed the logic of formula, comprising:
Check whether said annexation expression formula comprises the annexation of each partial model;
Check whether said annexation expression formula comprises the annexation of the redundancy of said partial model;
Check whether position coordinates is corresponding one by one with partial model in the said distribution and expression formula.
For example, in the annexation expression formula that the annexation of partial model A does not comprise, then can feed back following error message:
Erro:model?A?is?miss。
Expression has lacked the annexation of partial model A.
If it is correct and logically true that said distribution and expression formula and annexation are expressed the syntactic information of formula, then generate description document.Said description document comprises the position coordinates and the annexation of said partial model, and said annexation is with the Name & Location coordinate of source end pieces model, the Name & Location coordinate representation of destination partial model.Said position coordinates and partial model are one to one, and therefore said position coordinates is the sign of said partial model, with said position coordinates representative and its corresponding components model.
Annexation between partial model A and the partial model B can show with the form of text description, for example, and [partial model A: the sign < 2 of source end pieces model; 1 >, partial model B: the sign of destination partial model < 3,1 >], have annexation between this expression partial model A and the partial model B; A is the title of source end pieces model, and it is designated < 2,1 >; B is the title of destination partial model, and it is designated < 3,1 >; Also can be with program code, the performance of forms such as graphic symbol, for example, code form: (modleA < 2 for R; 1 >, modleB < 3,1 >), R representes to have annexation between partial model modleA and the partial model modleB; ModleA is the title of source end pieces model, and its position coordinates (sign) is < 2,1 >; ModleB is the title of destination partial model, and its position coordinates (sign) is < 3,1 >.
Annexation between the partial model can be classified, and generally has two kinds: unidirectional connection and two-way annexation.For example, be unidirectional annexation between partial model A and the partial model B, expression partial model A is to unidirectional transmission message of partial model B or event content, and perhaps partial model B is to unidirectional transmission message of partial model A or event content; Be two-way annexation between partial model A and the partial model B, expression partial model A sends message or event content to partial model B, and partial model B also sends message or event content to partial model A.
The number of the annexation between the partial model and the type of annexation also can add in the said description document.For example, be two-way annexation between R (modleA < 2,1 >, modleB < 3,1 >) expression modleA and the modleB, S (modleA < 2,1 >, modleB < 3,1 >) expression modleA is to the unidirectional annexation of modleB.R (modleA < 2,1 >, modleB < 3,1 >), (modleA < 2 for R; 1 >, modleC < 4,1 >), R (modleA < 2,1 >; ModleD < 5,1 >), expression modleA has two-way annexation respectively with modleB, modleC, modleD respectively, and modleA has 3 annexations.ModleA has two-way annexation respectively with modleB, modleC, modleD respectively, and modleA has 3 annexations and also can be kept in the description document.
Because different parallel transaction-level model implementation method is different, the design is the method for expressing of limiting part model not.Said description document is applicable to the parallel transaction-level modeling method of various systems and partial model loose coupling.The description document that generates can the time to the system model of physical simulation device code is described, also can be texts such as txt, word.
Fig. 4 is the flow chart of a kind of execution mode of the method for routing of communicating by letter between partial model provided by the invention, comprising:
S21, the description document of the parallel transaction-level analogue system of generation;
S22, the title of obtaining communication source end, said communication sources end is a source end pieces model to be established a communications link;
S23, the title of in the description document of said parallel transaction-level analogue system, searching the communication objective end corresponding with said communication sources end, said communication objective end is the destination partial model corresponding with source end to be established a communications link;
S24, the record communication port information, said COM1 information comprises the Name & Location coordinate of said communication sources end, the Name & Location coordinate of communication objective end;
S25 is that said communication sources end and communication objective end are set up COM1 and configuration communication passage based on said COM1 information.
In the modeling or design process of the parallel transaction-level analogue system of reality, the structure of partial model is very complicated, and said partial model comprises communication module, also comprises component logic, in order to realize logic function.
Said communication module comprises port router (also claiming router), communication controler and port queue administration module etc., and the port queue administration module is generally used for setting up COM1 according to COM1 information.The port router comprises the routing iinformation administration module, and said routing iinformation administration module comprises routing table cache module, enquiry module etc.COM1 comprises port arrangement module, message transmission module, message processing module etc.
The port queue administration module obtains the port number of these parts model from enquiry module, and obtains the COM1 information of each port successively.Annexation between partial model generally has three kinds: COM1 generally can be divided into three types: only send message COM1, receive only the COM1 of message or event content, not only sent but also received the COM1 of message or event content.The type of COM1 and number are generally speaking by the type and the decision of the annexation of this partial model.For example, partial model A and partial model B, partial model C, partial model D have two-way annexation respectively, and partial model A has three COM1s so, and this COM1 is for not only sending but also receive the COM1 of message or event content.If partial model A is to the unidirectional transmission message of partial model B, then partial model A has a COM1 that only sends message, and partial model B has a COM1 that receives only message or event content.
A COM1 has a COM1 information, that is to say, the number of COM1 information is consistent with the number of COM1.The port queue administration module obtains will in communication module, to create a new COM1 after the new COM1 information of each bar, with numeral or this COM1 of letter designation, and the corresponding communication port information is inserted the port information administration module.
The type of the annexation of partial model, number generally also can be included in the description document, and the title of COM1 generally is defaulted as numeral or letter in addition, when generating description document, can automatic ranked package be contained in the description document.
Fig. 5 to Figure 18 is the detailed applications method of the description document that provides in the embodiment of the invention; Said description document is also referred to as the topological structure description document; In the present embodiment, the communication module of partial model is set up COM1 according to COM1 information, correspondingly; Also comprise the port information (like title, sign etc.) of partial model in the description document, COM1 information also comprises the port information of communication sources end and the port information of communication objective end.Specify below in conjunction with Fig. 5 to Figure 18.
Fig. 5 is the structure list of the topological structure description document that provides of the embodiment of the invention, and the structure of topological structure description document is as shown in Figure 5.The topological structure description document is main unit with partial model, has described the essential information of each partial model, and the annexation of the port of this partial model.In order to avoid a conflict, the topological structure description document requires being designated of partial model 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 need guarantee in the partial model unique, and this port is carried out just can not making a mistake when topological structure is described.
Partial model is generally the transmitting terminal or the receiving terminal of message, so partial model can be used as communication sources end or communication objective end.For describing conveniently, if no special indicating promptly represented communication sources end or communication objective end with partial model in the following content.
What this topological structure description document was described is the annexation between partial model, and has specifically noted annexation between the port of port and miscellaneous part model of a partial model.
As shown in Figure 5, the annexation of the port of whole partial models of representing to comprise in the parallel transaction-level analogue system.Comprise the annexation of the port of several partial models in this topological structure description document, each partial model comprises two parts content, and the one, module information M1, the 2nd, channel information M2.Among the module information M1, comprise title, sign, type and the number of active lanes of partial model, type generally is finger processor, internal memory, hard disk etc., and number of active lanes is the number of the communication port between this partial model and the miscellaneous part model.Itemize has write down the information of each port among the channel information M2; The port information of a port of every record record; Comprise sign, title that the partial model of annexation is arranged with this port, annexation is arranged, the title of this port, type, time of delay with which port of this partial model.The title of port generally is defaulted as Arabic numerals or letter, and according to numeral or alphabetical rank order.Port type generally comprises transmission types, type of receipt and the transmission type of receipt of holding concurrently.Be meant that this port sends a message and how long needs time of delay.
For example, 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 the miscellaneous part model.The module information of partial model A comprises, the name of partial model is called A, is designated < 2,1 >, type is processor and number of active lanes is 4.Channel information comprises 4 records, and the information of a port of every record record is if port a in order to initiate a message, (is designated < 3 with partial model B; 1>port f) has communication and connects, and then the record of port a comprises: the sign of source end < 2,1 >; Being designated of destination < 3,1 >, the port name of source end is called a; The port name of destination is called f, and channel type is a transmission types, and be 0.04s time of delay.
The general communication according to parallel transaction-level analogue system to be simulated of topological structure description document connects, and sets up the annexation of source end and destination.When establishing a connection, the type of the port of said source end is a transmission types, and then the type of the port of the destination corresponding with it can only be for type of receipt or receive the transmission types of holding concurrently, and same partial model both can be that the source end also can be a destination.
According to the annexation between each partial model of parallel transaction-level analogue system to be simulated; Annexation in said topological structure description document between the analog component model; After partial model obtains said topological structure description document; According to content wherein, set up the annexation between the partial model, then realized the modeling of parallel transaction-level analogue system.
Fig. 6 is a kind of flow chart of execution mode of the method for routing of COM1 provided by the invention, comprising:
S101 obtains the topological structure description document, and said topological structure description document comprises the title of port of title and destination of port of sign, the source end of sign, the destination of source end;
S102, the title of the port of obtaining communication source end, said communication sources end is a source end to be established a communications link, the port of said communication sources end is the port of source end to be established a communications link;
S103, title and the sign of communication objective end of in said topological structure description document, searching the port of the communication objective end corresponding with the port of said communication sources end;
S104, the record communication port information, said COM1 information comprises the sign of said communication sources end, the title of the port of communication sources end, the sign of communication objective end, the title of the port of communication objective end;
S105 is that said communication sources end and communication objective end are set up COM1 and configuration communication passage based on said COM1 information.
The analogy method that the topological structure description document of step S101 can utilize shown in Figure 1 setting up to communicate by letter between partial model generates, and said source end is the partial model that end initiates a message in other words conj.or perhaps that sends of message, and the port of said source end is in order to send said message; Said destination is the partial model that the receiving terminal of said message receives message in other words conj.or perhaps, and the port of said destination is in order to receive said message, and promptly source end and destination have annexation.Because the transmission of message moves in circles with reception, thus the source end of message transmission, also can be the destination of message sink next time, in other words, source end and destination can change according to the flow direction of message.In parallel transaction-level analogue system, partial model is communication sources end or communication objective end normally.
Said communication sources end is a source end to be established a communications link, the partial model in the just parallel transaction-level analogue system.After the partial model design was accomplished, the communication of setting up between the partial model connected, and disposed parallel host network again, and parallel transaction-level analogue system is just calculated completion.For preventing that in the process that establishes a communications link the situation that occurs missing designs the partial model of accomplishing, and when establishing a communications link, regards this partial model as source end to be established a communications link.
The port of said communication objective end is the port of the destination corresponding with the port of source end said to be established a communications link, and said communication objective end is the destination corresponding with source end to be established a communications link.Message flows through port in whole system; When establishing a communications link; Need to confirm the communication sources end and the communication objective end of message; Guarantee that both are corresponding, confirm that then which port of communication sources end is corresponding with which port of communication objective end, guarantee that message flows in corresponding port.
Based on said COM1 information is after said communication sources end and communication objective end are set up COM1 and configuration communication passage; The COM1 of setting up for the communication sources end is the port of communication sources end in the corresponding COM1 information, and the COM1 of setting up for communication objective end is the port of corresponding communication objective end.Message sends to communication objective end through the COM1 of communication sources end, the communication port of configuration, and the COM1 of communication objective end receives the message (parsing to message will be elaborated follow-up) after resolving.
Generally speaking, the port of transmission types is corresponding with the port of type of receipt or the double transmission types of reception; The port of type of receipt is corresponding with the port of transmission types or the double transmission types of reception; Send the port of the type of receipt of holding concurrently, if send message, then the port with transmission types is identical, if receive message, then the port with type of receipt is identical.
The module information and the channel information that comprise this partial model in the topological structure description document; Wherein module information comprises title, sign, type and the number of active lanes of this partial model, and number of active lanes is the number of the communication port between this partial model and the miscellaneous part model.Itemize has write down the information of each port in the channel information, comprises sign, title that the partial model of annexation is arranged with this port, annexation is arranged, the title of this port, type, time of delay with which port of this partial model.
Among the S104, the record communication port information can selectively be noted these information according to actual conditions, and generally COM1 information only writes down the information of port commonly used, like this can conserve storage.
Said communication port is used for transmitting message, and communication port is generally realized through parallel host network.
Fig. 7 is the structure chart of a kind of execution mode of port router provided by the invention, specifies below in conjunction with Fig. 1, Fig. 2 and Fig. 7.
The structure of port router-A 1 is as shown in Figure 7, mainly contains two parts and forms: 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 obtaining the topological structure description document, said topological structure description document comprises the title of port of title and destination of port of sign, the source end of sign, the destination of source end; The title that also is used for the port of obtaining communication source end, said communication sources end are source end to be established a communications link, and the port of said communication sources end is the port of source end to be established a communications link; Also in order to the record communication port information, said COM1 information comprises the sign of said communication sources end, the title of the port of communication sources end, the sign of communication objective end, the title of the port of communication objective end.
Enquiry module A12; In order to the title of the port of in said topological structure description document, searching the communication objective end corresponding and the sign of communication objective end with the port of said communication sources end; The port of said communication objective end is the port of the destination corresponding with the port of source end said to be established a communications link, and said communication objective end is the destination corresponding with source end to be established a communications link.
Enquiry module A12 generally provides two interfaces: interface is in order to the title of the port of the sign of query communication destination, communication objective end; Another interface is in order to the sign of query communication source end, the title of the port of communication sources end.
If said topological structure description document also comprises the number of title, type and the communication port of said source end; The type and the time of delay of the port of said source end; The type of the port of said source end comprises: type of receipt, transmission types and the reception transmission types of holding concurrently, and enquiry module A12 then is also in order to search the type and the time of delay of the port of said source end in said topological structure description document; And with the type of the port of said source end with add time of delay in the COM1 information.
After routing table cache modules A 112 is obtained the topological structure description document, this document is preserved into a router cache table, deposit in the routing table cache modules A 112, the content of router cache table is identical with the topological structure description document.The structure of router cache table is the annexation formation by the row tissue; Article one, annexation is described the connection of a pair of port, comprises: " sign of source end ", " sign of destination "; " title of the port of source end "; " title of the port of destination ", " type ", " time of delay " six fields.
Routing table cache modules A 112 mainly has the following advantages; When parallel transaction-level analogue system to be simulated is huge; The annexation of in partial model or other simulators, preserving huge system is to need a large amount of internal memories; Therefore, in order to reduce memory cost, routing table cache modules A 112 will only be preserved part routing iinformation commonly used.Said routing iinformation mostly is meant COM1 information; That is to say; Routing table cache modules A 112 is kept at the port commonly used or the COM1 information of partial model in the router cache table from the topological structure description document, has practiced thrift memory space like this.
Routing iinformation administration module A11 also comprises update module A111, and the routing iinformation of searching when needs is in routing table cache the time, with direct acquired information; If the routing iinformation of searching is not in routing table cache; 112 needs of routing table cache modules A read the 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 the preservation in the routing table cache modules A 112 before replacing.
That is to say that update module A111 upgrades the router cache table and safeguards.If enquiry module A12 is in the router cache table; Search COM1 information less than the port of communication sources end; Then routing table cache modules A 112 is obtained the topological structure description document again; Obtain corresponding information, update module A111 preserves new information in the old router cache table, forms new router cache table.That is to say that update module A111 is 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 a kind of flow chart of execution mode of the message method of COM1 provided by the invention, comprising:
S201 reads the COM1 information corresponding with the port of said communication sources end from said port router, and is the communication sources end and corresponding communication objective end is set up COM1 and configuration communication passage based on said COM1 information;
S202 obtains the incident bag, and said incident bag comprises the title of the event content and the port of the communication sources end that sends this incident bag;
S203 adds said event content with said COM1 information and forms message;
S204 sends said message through said communication port.
Because the traffic volume of message is generally bigger; Therefore said message method also comprised according to the time of sending message, set up the transmission buffer queue of message, and this prevents to pour in message at one time; Strengthen the live load of COM1, cause situation when machine or clogged with messages.Message is issued to communication objective end through communication port, and communication port is generally realized through parallel host network.
Said incident bag is sent by component logic, and this is in order better to divide the function of component logic.Component logic is used for sending the incident bag or receives the result of event content, that is to say that said component logic is in order to accomplish the logic function except that contacts with overseas parties.COM1 is used to receive event content, incident bag or the incident of transmission bag, message or result.The service area of component logic with COM1 separated, prevent both functions intersections, lump together, improve the reusability of partial model.
Fig. 9 is a kind of flow chart of execution mode of the message receival method of COM1 provided by the invention, comprising:
S301 is through receiving said message with the corresponding communication port of said communication sources end;
S302 resolves said message, obtains the title of the event content and the port of the communication objective end that receives this message.
The message that communication objective termination is received is to send through the message method of COM1 shown in Figure 9, and according to the time sequencing that receives said event content, sets up the reception buffer queue of said event content.Because event content is included in the message, therefore the reception buffer queue of said event content generally comprises the time sequencing foundation of the message of this event content according to reception, therefore is also referred to as the message sink buffer queue.
After communication objective termination is received said message, it is resolved, obtain concrete COM1 information, carry out follow-up work.When resolving said message,, resolve said message one by one according to receiving putting in order of buffer queue.
Follow-up work comprises, handles said event content, and the feedback processing result, and said result feeds back to the component logic of communication objective end.When handling said message, can also obtain title and the sign of communication objective end of port of sign, the communication sources end of the communication sources end of said message as required.
Figure 10 is the structure chart of a kind of execution mode of COM1 A2 provided by the invention, comprising:
Port arrangement modules A 21 in order to obtaining the COM1 information corresponding with the port of said communication sources end from the port router, and is communication sources end and corresponding communication objective end configuration communication passage based on said COM1 information;
Message transmission module A22, in order to obtain the incident bag, said incident bag comprises the title of the event content and the port of the communication sources end that sends this incident bag, said COM1 information is added said event content form message and send said message.
COM1 A2 also comprises:
Message processing module A23, the event content in order in the message of obtaining and handle other COM1s transmissions feeds back to component logic A4 with result;
Message is sent cache module A24, in order to the time sequencing according to the message of sending, sets up the transmission buffer queue of said message;
Message sink cache module A25 in order to the time sequencing according to event content in the message that receives, sets up the reception buffer queue of said event content;
Port information administration module A26 is in order to preserve the COM1 information corresponding with the port of said communication sources end.
The structure of COM1 is as shown in Figure 6.Comprise port arrangement modules A 21, message transmission module A22 and message sink cache module A25 among the COM1 A2, message is sent cache module A24, message processing module A23, port information administration module A26.
Wherein port arrangement modules A 21 is obtained the COM1 information corresponding with the port of said communication sources end, and is the communication objective end configuration communication passage of communication sources end and correspondence based on said COM1 information.Behind the port arrangement modules A 21 obtaining communication port informations, will said communication port configuration be accomplished, to guarantee carrying out smoothly of message transmission or reception.
Message transmission module A22 and message processing module A23 are used for transmission, reception and the processing of control messages; Port information administration module A26 is used for link information, COM1 information of minute book port etc.; The link information of the port comprises that there are annexation in this port and which port, which communication objective end to have annexation etc. with.COM1 information comprises the title of the port, the title of the port of destination, the type of port (transmission types, type of receipt send the type of receipt of holding concurrently).
COM1 can also only be used for receiving and processing messages, and this COM1 comprises message processing module, in order to obtain said event content; Said message processing module is also in order to handling said event content, and the feedback processing result is to the component logic of communication objective end.This COM1 that is used to receive with processing messages also comprises: the message sink cache module, in order to according to the time sequencing of obtaining said event content, set up the reception buffer queue of said event content.
COM1 can be divided into three kinds according to its function: only send message COM1, receive only the COM1 of message, not only sent but also received the COM1 of message.The COM1 that had not only sent but also received message is identical or close with the structure of COM1 A2; Receive only the COM1 of message, the message processing module that generally only comprises and message sink cache module or with the identical or similar module of above-mentioned two kinds of functions of modules; The COM1 that only sends message generally comprises the port arrangement module, message transmission module, and message is sent cache module and port information administration module.
Figure 11 is the structure chart (having omitted the concrete structure of COM1 A2 among the figure) of a kind of execution mode of communication module provided by the invention, comprising: port router-A 1, port queue administration module A32 and communication controler A31;
Communication controler A31, in order to obtain the incident bag, said incident bag comprises the title of the event content and the port of the communication sources end that sends this incident bag;
Port queue administration module A32 in order to obtaining the COM1 information corresponding with the port of said communication sources end from port router-A 1, and sets up COM1 A2 based on said COM1 information;
COM1 A2 comprises:
The port arrangement module in order to obtaining said COM1 information from port router-A 1, and is communication sources end and corresponding communication objective end configuration communication passage based on said COM1 information;
Message transmission module in order to obtain said incident bag from said communication controler, adds said event content with said COM1 information and forms message and send said message through said communication port.
Communication module A3 generally is used for receiving or initiating a message, so the message also sent in order to the port that receives by the communication sources end of communication controler A31, and this message comprises the COM1 information and the event content of the port of the communication sources end that sends this message.That is to say that communication controler A31 is used for receiving the message that the miscellaneous part model sends.
If communication controler A31 is also in order to receive message, then port queue administration module A32 also in order to resolve the message that said communication controler receives, obtains the title of event content with the port of the communication objective end that receives this message of this message.
COM1 A2 also comprises message processing module, resolve the event content that obtains in order to receive and to handle said port queue administration module, and the feedback processing result is to the component logic of communication objective end; Message is sent cache module, in order to according to the time sequencing of sending said message, sets up the transmission buffer queue of said message; The message sink cache module in order to the time sequencing according to the event content of the message that receives, is set up the reception buffer queue of said event content; The port information administration module is in order to preserve the port information of said COM1.
Message is sent cache module and the message sink cache module can also be set up buffer queue according to the priority of message or event content, the capacity of message etc.
Port queue administration module A32 also in order to monitoring communications port A2, when COM1 A2 is idle, controls this COM1 and receives said event content or send said message.By port queue administration module A32 monitoring communications port A2; The free time, controlling this COM1 receives said event content or sends said message; This is in order to prevent clogged with messages; Further, this COM1 of sequential control according to buffer queue receives said event content or sends said message.
Figure 12 is the flow graph that sends of message provided by the invention, and Figure 13 is the reception flow graph of message provided by the invention.Specify below in conjunction with Fig. 8, Fig. 9, Figure 10, Figure 11, Figure 12 and Figure 13.
After parallel transaction-level analogue system starts, communication module A3 will dispose automatically.At first port router-A 1 will read the topological structure description document, and the topological structure description document that reads is kept in the routing table cache modules A 112, form the route-caching table.Then enquiry module A12 searches title and the sign of communication objective end of the port of the communication objective end corresponding with the port of said communication sources end in the route-caching table.
Communication module A3 incites somebody to action own affiliated partial model as the communication sources end; Obtain the COM1 information corresponding from port router-A 1, and set up COM1 and be communication sources end and corresponding communication objective end configuration communication passage based on said COM1 information with the port of said communication sources end.Specifically, port queue administration module A32 inquires about through the enquiry module A12 in the port router-A 1, obtains the COM1 information that communication module A3 needs, and sets up COM1 A2 based on said COM1 information.COM1 information comprises the sign of destination, the title of the port of destination, and the type of this port be single transmission, receive, or transceiver port.COM1 information will be kept among the port information administration module A26 of each COM1.Port queue administration module A32 obtaining communication port information is therefrom confirmed to set up several COM1s.
Port arrangement modules A 21 finds the sign of communication sources end and the sign of communication objective end from COM1 information, configuration communication port between the two.When component logic A4 need send message, need message to be sent to communication objective end from the communication sources end through communication port.Communication port generally is to rely on parallel host network to realize, sends message through communication port, also can regard as through parallel host network and send message.
Message transmitting process is shown in figure 12, when component logic A4 outwards sends message through COM1 A2, only need indicate and use which COM1 to get final product, and need not to provide the connection situation of this port in system.Shown in figure 12, the incident bag that component logic A4 sent only comprises " title of transmit port " and " event content " two substances, and " title of transmit port " be the title of the COM1 of communication sources end just.When the incident bag gets into communication module A3, at 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 incident bag after resolving is temporarily stored in message sends among the cache module A24.The control that obtains respective communications port is meant whether monitor this port idle, when this port is idle, controls this port and sends message.Message transmission module A22 sends incident bag of taking-up the cache module A24 from message when external communication port is idle, the COM1 information that adds the corresponding port according to " title of transmit port " forms message.Generally speaking; For the incident bag increases " sign of communication sources end "; " title of the port of communication sources end ", " sign of communication objective end ", " title of the port of communication objective end " four fields; Based on the content of these four fields, message can be sent on parallel host network A 61.
The receiving course of message is shown in figure 13, after the partial model that the message of being sent by the communication sources end is arrived as communication objective end by parallel host network A 61, will at first pass to communication controler A31, is resolved the message of receiving by communication controler A31.This moment, message comprised the COM1 information and the event content of the port of the communication sources end that sends this message; Comprise " sign of communication sources end " particularly; " title of the port of communication sources end "; " sign 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 "; Port queue administration module A32 simplifies the message bag for having only " title of receiving port " and " event content " two parts; And obtain the control of corresponding receiving port; Just monitor this port, when this port is idle, controls this port and receive." title of receiving port " just " title of the COM1 of communication objective end " wherein.Message after simplifying will pass to the message sink cache module A25 of COM1 A2, when this port is idle, will pass to message processing module A23 and will handle, and 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 parallel transaction-level analogue system provided by the invention.Specify 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 is used to send the incident bag or receives result.
Figure 11 is the structure chart of a kind of execution mode of parallel transaction-level analogue system provided by the invention, and parallel transaction-level analogue system A6 comprises partial model A62 and parallel host network A 61.
Each partial model A62 simulates the part among the parallel transaction-level analogue system A6 independently, and carries out the transmission of message through parallel host network A 61.When carrying out between the partial model A62 when mutual, will transmit message through parallel host network A 61.When simulation walks abreast transaction-level analogue system A6, realize comprising event content or incident bag in the message alternately through message between two partial model A62.The incident bag is the packet of User Defined structure.In this packet, the user is with being the event content of granularity with the sequential between the abstract realization hardware module.
The interaction protocol that the process of interacting message is common and partial model A62 adopts is irrelevant; Usually do not relate to concrete details such as bus timing; That is to say that component logic A4 sends or receive result, communication module A3 is responsible for becoming message to send through its COM1 A2 the incident collation package.Component logic A4 is indifferent to message and by whom is sent, and only is concerned about and has sent what message, has received what result.Accordingly, communication module A3 is indifferent to and sends or received what message, only is concerned about whose transmission whom to send to.This has been divided into two parts with partial model A62, and component logic A4 is responsible for sending the incident bag or receives result, and communication module A3 is responsible for sending or receiving message.During design part model A62; Which kind of communication no longer is entangled with in parallel transaction-level analogue system needs connect; How annexation between the partial model designs; When design walked abreast the transaction-level analogue system, how the annexation of also no longer being entangled with between partial model designed the communication connection that could satisfy parallel transaction-level analogue system.These annexations or communication connection are preset in the topological structure description document; Only need obtain this document; Communicate the configuration of passage according to the content of this document, just can satisfy the demand that the communication of parallel transaction-level analogue system connects, and also realize the annexation between the partial model.
This not only reduces the degree of coupling between partial model and the parallel transaction-level analogue system, and improves the development efficiency of parallel transaction-level analogue system.If when the annexation between the partial model or the changing of communication link sending and receiving of parallel transaction-level analogue system; Only need to revise content corresponding in the topological structure description document; Then route cache table and COM1 information are upgraded, just can be accomplished the modification that the communication of annexation or parallel transaction-level analogue system between the partial model connects.The expense that this reduces partial model and the maintenance of parallel transaction-level analogue system no longer needs design part model or parallel transaction-level analogue system again, has strengthened the reusability of partial model, reduces the wasting of resources, has practiced thrift cost.
Figure 16 is that the communication of partial model in the parallel transaction-level analogue system provided by the invention connects sketch map.Figure 12 is described in the correspondence between the partial model A62 of two parallel runnings in the parallel transaction-level analogue system, has omitted and other structures here.The structure of the communication module A3 of parallel transaction-level simulation and the applied environment in parallel transaction-level analogue system thereof are shown in figure 16, and communication module A3 mainly comprises: COM1 A2, communication controler A31, port queue modules A 32, port router-A 1.Port router-A 1 obtains outside topological structure description document.
COM1 A2 is connected with port router-A 1 through port queue modules A 32, can obtain the information in the port router-A 1 through port queue modules A 32.
Shown in figure 16, carry out through communication module A3 alternately between two partial models, when component logic A4 need carry out PERCOM peripheral communication, will at first pass to communication module A3 to the incident bag, be responsible for incident sealed by communication module A3 and dress up message and transmit; Equally, when receiving message, the message of receiving will at first be responsible for processing by communication module A3, passes to component logic A4 again.Under this design; Component logic A4 carries out with the outside communication module A3 that will rely on fully alternately; Can under the situation of not considering external condition, realize the internal logic of partial model A62 independently, this design has improved the development efficiency of partial model effectively.
Each partial model A62 can be divided into two parts, and a part is not relate to externally mutual component logic A4, and another part is the communication module A3 that is responsible for outside mutual.Figure 16 is the structure chart of a kind of execution mode of incident bag provided by the invention, and Figure 17 is the structure chart of a kind of execution mode of message provided by the invention.
Incident bag B1 shown in Figure 17 comprises the title B11 and the event content B10 of transmit port, and the title B11 of transmit port is the title of the port of communication sources end just.Incident bag B1 is sent by component logic A4.Message B2 shown in Figure 18 comprises event content B10, the sign B12 of communication sources end, the title B11 ' of the port of communication sources end, the sign B13 of communication objective end, the title B14 of the port of communication objective end.Wherein the title B11 ' of the port of communication sources end is identical with the title B11 of transmit port among Figure 17.Message B2 is after receiving incident bag B1 by communication module A3, adds that ingress port information forms, and is finally sent by COM1.
In sum, the disclosed technical scheme of the embodiment of the invention, the development efficiency of the parallel transaction-level analogue system of raising reduces the expense to partial model and the maintenance of parallel transaction-level analogue system.
Though the present invention with preferred embodiment openly as above; But it is not to be used for limiting the present invention; Any those skilled in the art are not breaking away from the spirit and scope of the present invention; Can utilize the method and the technology contents of above-mentioned announcement that technical scheme of the present invention is made possible change and modification, therefore, every content that does not break away from technical scheme of the present invention; To any simple modification, equivalent variations and modification that above embodiment did, all belong to the protection range of technical scheme of the present invention according to technical spirit of the present invention.
Claims (19)
1. set up the analogy method of communicating by letter between partial model for one kind, it is characterized in that, comprising:
Said partial model is distributed with matrix form, confirm the dimension of said matrix;
Type according to said partial model; Said matrix is divided into submatrix; Dimension and the position of said submatrix in said matrix based on said matrix generate the distribution and expression formula, and said distribution and expression formula is described the position coordinates of said partial model in said matrix;
Generate annexation based on position coordinates and the annexation between partial model to be simulated of said partial model in said matrix and express formula, said annexation expression formula is described the annexation between the said partial model;
Whether the logic of checking said distribution and expression formula and annexation expression formula is correct; If correctly then express formula based on said distribution and expression formula and annexation; Generate the description document of parallel transaction-level analogue system; Said description document comprises the position coordinates and the annexation of said partial model, and said annexation is with the Name & Location coordinate of source end pieces model, the Name & Location coordinate representation of destination partial model;
The logically true position coordinates of said partial model that is meant of said distribution and expression formula is corresponding one by one with partial model; Said annexation is expressed the logically true of formula and is meant the annexation that comprises each partial model in the said annexation expression formula, and said partial model does not have redundant annexation.
2. the analogy method of communicating by letter between partial model of setting up as claimed in claim 1; It is characterized in that; Said dimension and the position generation distribution and expression formula of said submatrix in said matrix based on said matrix comprises: based on the dimension and the position of said submatrix in said matrix of said matrix; Parameter in the distribution formula of confirming to set up in advance obtains said distribution and expression formula, and said 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>Represent the position coordinates of said partial model in said matrix, x
mThe expression abscissa, y
nThe expression ordinate, x
mBe the function of i, i confirms span based on the dimension of said matrix; y
nBe the function of j, j confirms span based on the dimension of said matrix, and k representes constant, confirms that based on the position of said submatrix in said matrix N representes integer.
3. the analogy method of communicating by letter between partial model of setting up as claimed in claim 2 is characterized in that, the distribution formula that generates two-dimensional matrix based on said 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 said two-dimensional matrix comprises the line number of said two-dimensional matrix and the columns of said two-dimensional matrix, and wherein A representes the columns of said two-dimensional matrix, and B representes the line number of said two-dimensional matrix; A is the coefficient of i, and c is the coefficient of j, and b, d are constant, a, and b, c, d confirms that based on span and the position of said submatrix in said matrix of i and j N is an integer.
4. the analogy method of communicating by letter between partial model of setting up as claimed in claim 1; It is characterized in that; Saidly generate annexation expression formula based on position coordinates and the annexation between partial model to be simulated of said partial model in said matrix and comprise: parameter in the annexation formula of confirming to set up in advance based on the position coordinates of said partial model in said matrix, said submatrix position and the annexation between partial model to be simulated in said matrix; Obtain said annexation and express formula, said annexation formula is:
n∈N,l∈N,p∈N,v∈N,u∈N
<x
l, y
p>With<x
v, y
u>Expression has the position coordinates of two partial models of annexation, and n representes constant, and N representes natural number.
5. the analogy method of communicating by letter between partial model of setting up as claimed in claim 1; It is characterized in that; Inspection said distribution and expression formula and annexation express the logic of formula whether correct before, also comprise: check whether said distribution and expression formula and annexation expression formula meets preset grammatical information; Said syntactic information comprises the spelling requirement and the algorithm of said distribution formula and annexation formula.
6. the analogy method of communicating by letter between partial model of setting up as claimed in claim 5 is characterized in that, also comprises: if said distribution and expression formula and annexation expression formula do not meet said syntactic information and/or logic error, then feed back error message.
7. the analogy method of communicating by letter between partial model of setting up as claimed in claim 1 is characterized in that the type of said partial model comprises: processor type, type of memory, router type.
8. like each described analogy method of communicating by letter between partial model of setting up of claim 1-7, it is characterized in that said matrix is two-dimensional grid, two-dimentional looped network or three-dimensional grid.
9. the method for routing of communicating by letter between a partial model is characterized in that, comprising:
Utilize each described analogy method of claim 1 to 8 to generate the description document of parallel transaction-level analogue system;
The title of obtaining communication source end, said communication sources end are source end pieces model to be established a communications link;
In the description document of said parallel transaction-level analogue system, search the title of the communication objective end corresponding with said communication sources end, said communication objective end is the destination partial model corresponding with source end to be established a communications link;
The record communication port information, said COM1 information comprises the Name & Location coordinate of said communication sources end, the Name & Location coordinate of communication objective end;
Based on said COM1 information is that said communication sources end and communication objective end are set up COM1 and configuration communication passage.
10. the method for routing of communicating by letter between partial model as claimed in claim 9; It is characterized in that; Said description document also comprises the type of said partial model; The type of said partial model is the type of said communication sources end, and the type of said partial model comprises: processor type, type of memory, router type.
11. the method for routing of communicating by letter between partial model as claimed in claim 10 is characterized in that, also is included in the type of searching in the said description document with the corresponding partial model of type of said communication sources end; Said COM1 information also comprises the type of said communication sources end.
12. a communication module is characterized in that, comprises port router, port queue administration module and communication controler;
Said port router, in order to obtaining the description document of utilizing the parallel transaction-level analogue system that each described analogy method of claim 1 to 8 generates, and the title of obtaining communication source end, said communication sources end is a source end pieces model to be established a communications link; Also in order in said description document, to search the title of the communication objective end corresponding with said communication sources end, said communication objective end is the destination partial model corresponding with source end to be established a communications link; Also in order to the record communication port information, said COM1 information comprises the Name & Location coordinate of said communication sources end, the Name & Location coordinate of communication objective end;
Said communication controler, in order to obtain the incident bag, said incident bag comprises the title of the event content and the port of the communication sources end that sends this incident bag;
Said port queue administration module in order to obtaining the COM1 information corresponding with said communication sources end from said port router, and is set up COM1 based on said COM1 information;
Said COM1 comprises:
The port arrangement module in order to obtaining said COM1 information, and is communication sources end and corresponding communication objective end configuration communication passage based on said COM1 information;
Message transmission module in order to obtain said incident bag from said communication controler, adds said event content with said COM1 information and forms message and send said message through said communication port.
13. communication module as claimed in claim 12 is characterized in that, said communication controler is also in order to receive the message of being sent by the communication sources end.
14. communication module as claimed in claim 13 is characterized in that, said port queue administration module also in order to resolve the message that said communication controler receives, obtains the title of event content with the port of the communication objective end that receives this message of this message.
15. communication module as claimed in claim 14 is characterized in that, said COM1 also comprises: message processing module, and resolve the event content that obtains in order to receive and to handle said port queue administration module, and send result.
16. partial model that comprises each described communication module of claim 12-15.
17. partial model as claimed in claim 16 is characterized in that, also comprises component logic, the result that is used to send the incident bag or receives event content.
18. parallel transaction-level analogue system that comprises claim 16 or 17 described partial models.
19. parallel transaction-level analogue system as claimed in claim 18 is characterized in that, also comprises parallel host network, transmits in order to realize the message between partial model.
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 true CN102761473A (en) | 2012-10-31 |
CN102761473B 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) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104656876A (en) * | 2013-11-25 | 2015-05-27 | 帝斯贝思数字信号处理和控制工程有限公司 | Method and device for automatically connecting components of a model of a technical system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000259636A (en) * | 1999-03-05 | 2000-09-22 | Hitachi Ltd | Graph structure inspection system |
CN1879110A (en) * | 2003-11-10 | 2006-12-13 | 罗伯特.博世有限公司 | Simulation system and computer-implemented method for simulation and verifying a control system |
JP2009282669A (en) * | 2008-05-21 | 2009-12-03 | Nec Corp | Circuit comparison apparatus, circuit comparison method, and program |
CN102354123A (en) * | 2011-07-18 | 2012-02-15 | 北京航空航天大学 | Cross-platform extendible satellite dynamic simulation test system |
-
2011
- 2011-04-29 CN CN201110110822.1A patent/CN102761473B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000259636A (en) * | 1999-03-05 | 2000-09-22 | Hitachi Ltd | Graph structure inspection system |
CN1879110A (en) * | 2003-11-10 | 2006-12-13 | 罗伯特.博世有限公司 | Simulation system and computer-implemented method for simulation and verifying a control system |
JP2009282669A (en) * | 2008-05-21 | 2009-12-03 | Nec Corp | Circuit comparison apparatus, circuit comparison method, and program |
CN102354123A (en) * | 2011-07-18 | 2012-02-15 | 北京航空航天大学 | Cross-platform extendible satellite dynamic simulation test system |
Non-Patent Citations (2)
Title |
---|
张昆、钱磊、李宏亮等: "《VCPPS:一种面向并行Verilog模拟的代码分割器》", 《计算机工程与科学》, 10 September 2009 (2009-09-10) * |
郑方、郑霄、李宏亮等: "《面向用户的并行计算***可用性建模研究》", 《计算机研究与发展》, 19 February 2008 (2008-02-19) * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104656876A (en) * | 2013-11-25 | 2015-05-27 | 帝斯贝思数字信号处理和控制工程有限公司 | Method and device for automatically connecting components of a model of a technical system |
CN104656876B (en) * | 2013-11-25 | 2019-06-14 | 帝斯贝思数字信号处理和控制工程有限公司 | The method and apparatus of the model component of model for automatic connection techniques system |
Also Published As
Publication number | Publication date |
---|---|
CN102761473B (en) | 2015-01-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105608088B (en) | A kind of database based on configuration file automatically creates and data dynamic recording method | |
CN101770479B (en) | Association relationship query method and device | |
CN100566357C (en) | Communication apparatus batch configuration managerial approach and device thereof | |
CN101102577B (en) | Incremental synchronization method for data in tables of frontground and background database of wireless communication base station system | |
CN105243067A (en) | Method and apparatus for realizing real-time increment synchronization of data | |
CN103473696A (en) | Method and system for collecting, analyzing and distributing internet business information | |
CN102164050A (en) | Log parsing method and log parsing node device | |
CN104090901A (en) | Method, device and server for processing data | |
CN110222323A (en) | A kind of voucher generation method, device, readable storage medium storing program for executing and terminal device | |
CN102567419B (en) | Mass data storage device and method based on tree structure | |
CN104898991A (en) | Automatic-RAL-based register access method and system | |
CN101903869B (en) | Hierarchical block-identified data communication for unified handling of structured data and data compression | |
CN104252416A (en) | Accelerator and data processing method | |
CN102761473A (en) | Simulating and routing method of communication between component models and concurrent transaction level simulation system | |
CN108959220A (en) | Templating data input management method and device | |
CN104702508A (en) | Method and system for dynamically updating table items | |
CN104239520A (en) | Historical-information-based HDFS (hadoop distributed file system) data block placement strategy | |
CN102004761B (en) | Data storage method and system | |
CN104023056B (en) | The method and relevant device updated the data | |
CN110221778A (en) | Processing method, system, storage medium and the electronic equipment of hotel's data | |
CN102571935A (en) | Data transmission method, client, server and system | |
CN102761472A (en) | Communication port and routing method thereof, communication module and concurrent transaction level simulation system | |
CN111241044B (en) | Method, device, equipment and readable storage medium for constructing heterogeneous database | |
CN113778995A (en) | Bank transaction detail data migration method and device | |
CN110264130B (en) | Data center storage medium warehousing system and data center storage medium retrieval method |
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 |