Embodiment
The allocation rule that the embodiment of the present invention foundation is scheduled to is divided into a plurality of checkings subtask with the validation task of bus architecture in the data transmission system, is carried out the data verification of transmitting between corresponding main equipment and the slave unit respectively by each checking subtask.
The demo plant of embodiment of the present invention data transmission system as shown in Figure 1, described data transmission system comprises at least one main equipment M0 and a plurality of slave unit S0, main equipment M0 and slave unit S0 are by bus 10 transmission data, described demo plant comprises allocation units 21 and unit, a plurality of subtask 22, the quantity of unit, described subtask 22 is determined based on predetermined allocation rule, wherein
Allocation units 21 based on described predetermined allocation rule, send to the data allocations that the data of bus 10 and main equipment M0 and slave unit S0 are received from bus 10 with main equipment M0 or slave unit S0 and give corresponding unit, subtask 22;
Unit, subtask 22 receives and also to store the data that send to bus 10 that allocation units 21 distribute, and receives data that are received from bus that allocation units 21 distribute and compares with the data that send to bus 10 of corresponding storage.
Described predetermined allocation rule can be the unit, address assignment subtask according to main equipment.Specifically, the quantity of unit, subtask 22 is identical with the quantity of main equipment M0, the data verification of transmitting between each unit, subtask 22 corresponding 1 main equipment M0 of management and all the slave unit S0 (receiving and comparing data).
Perhaps, described predetermined allocation rule can be the unit, address assignment subtask according to slave unit.Specifically, the quantity of unit, subtask 22 is identical with the quantity of slave unit S0, the data verification of transmitting between each unit, subtask 22 corresponding all main equipment M0 of management and the slave unit S0.
Perhaps, described predetermined allocation rule also can be according to the address of main equipment and the unit, address assignment subtask of slave unit.Specifically, the quantity of unit, subtask 22 equals (quantity of the quantity * slave unit S0 of main equipment M0), the data verification of transmitting between each unit, subtask 22 main equipment M0 of corresponding management and the slave unit S0.
In addition, described predetermined allocation rule is not to exceed with above-mentioned three kinds, also can be according to other unit, identification distribution subtask, for example, can also distribute the unit, subtask to the access type (for example writing or read operation) of slave unit according to the address of main equipment, the address and the main equipment of slave unit.
When main equipment M0 carries out write operation to slave unit S0, the described data that send to bus 10 comprise the data that will send to bus 10 that read from main equipment M0, and the described data that are received from bus 10 comprise the data that are received from bus 10 that read from slave unit S0.That is to say that unit, subtask 22 receives slave unit S0 by bus 10 data (data that write) are prepared to compare by the data (data that will write) that bus 10 sends with main equipment M0.
When main equipment M0 carries out read operation to slave unit S0, the described data that send to bus 10 comprise the data that will send to bus 10 that read from slave unit S0, and the described data that are received from bus 10 comprise the data that are received from bus 10 that read from main equipment M0.That is to say that the data (data that read from slave unit S0) that unit, subtask 22 receives main equipment M0 by bus 10 data (data that read from bus 10) and slave unit S0 prepare by bus 10 transmissions compare.
Below in conjunction with embodiment and accompanying drawing embodiment of the present invention is elaborated.
Please refer to Fig. 2, the data transmission system of present embodiment comprises: 2 main equipments, i.e. main equipment M1 and main equipment M2; 2 slave units, i.e. slave unit S1 and slave unit S2.The data transfer mode of bus is relevant with bus protocol, and present embodiment is to be that example describes with senior expansion interface (AXI) bus architecture, but is not in order to limit.In the present embodiment, the AXI bus architecture mainly comprises bus processing unit 11, bus arbiter unit 12, write bus 13 and read bus 14, write bus 13 comprises writes control/address tunnel and write data channel (not indicating among the figure), and read bus 14 comprises reads control/address tunnel and read data passage (not indicating among the figure).Main equipment M1, M2 and slave unit S 1, S2 send and receive by bus separately according to handshake.
Please refer to Fig. 3, the demo plant of the data transmission system of present embodiment comprises: allocation units 21 and 4 sub-TU task units, i.e. unit, subtask 22A, unit, subtask 22B, unit, subtask 22C and unit, subtask 22D.
Unit, subtask 22A is responsible for checking main equipment M1 and the slave unit S1 correctness by bus transfer data; Unit, subtask 22B is responsible for checking main equipment M1 and the slave unit S2 correctness by bus transfer data; Unit, subtask 22C is responsible for checking main equipment M2 and the slave unit S1 correctness by bus transfer data; Unit, subtask 22D is responsible for checking main equipment M2 and the slave unit S2 correctness by bus transfer data.
The demo plant of present embodiment also comprises storer 23, and storer 23 comprises a plurality of cell group, corresponds respectively to unit, a plurality of subtask, and promptly the quantity of cell group is identical with the quantity of unit, subtask.Each cell group is respectively applied for and stores the data that send to bus that unit, corresponding subtask receives from allocation units.In the present embodiment, storage unit 23 comprises 4 cell group, wherein, storage unit A 10 to A19 is the cell group of corresponding subtask unit 22A, storage unit B10 to B19 is the cell group of corresponding subtask unit 22B, storage unit C10 to C19 is the cell group of corresponding subtask unit 22C, and storage unit D10 to D19 is the cell group of corresponding subtask unit 22D.
In other embodiments, also can be that unit, subtask 22A, 22B, 22C and 22D comprise storer respectively, be used to store the data that send to bus that allocation units 21 distribute.
Below in conjunction with Fig. 2 and Fig. 3 data transmission and the bus verification process that main equipment carries out write operation to slave unit is described, wherein, Fig. 2 is the synoptic diagram of data transmission procedure, and Fig. 3 is the synoptic diagram of bus verification process.
Main equipment M1 and main equipment M2 send request of access to write bus 13 simultaneously, and wherein main equipment M1 will write first to slave unit S1 and write data, comprise that main equipment M1 writes handshake and first to 11 transmissions first of bus processing unit and writes control information; Main equipment M2 will write second to slave unit S2 and write data, comprises that main equipment M2 writes handshake and second to 11 transmissions second of bus processing unit and writes control information.First write the address that control information comprises main equipment M1, the address and second of slave unit S1 writes the length of data.Second write the address that control information comprises main equipment M2, the address and second of slave unit S2 writes the length of data.
Bus processing unit 11 receives first and writes handshake and second and write handshake, and through the arbitration of bus arbiter unit 12, main equipment M1 obtains write bus 13 right to occupations.Bus processing unit 11 sends first to main equipment M1 and writes the answer signal of shaking hands, and obtains first and write control information by writing control/address tunnel; Main equipment M1 sends first by write data channel and writes data to bus processing unit 11.
Allocation units 21 read to be write first of control/address tunnel and writes control information, according to first address of writing main equipment M1 in the control information, read first of transmission from main equipment M1 and write data, and with the address of the address of main equipment M1, slave unit S1 and read first write data allocations and give unit, subtask 22A.Unit, subtask 22A receives the address of the main equipment M1 of allocation units 21 distribution, the address and first of slave unit S1 writes data, and is stored in the storage unit A 10 of storer 23.
Bus processing unit 11 stores main equipment M1 and writes control information and first and write data by writing first of control/address tunnel and write data channel transmission, and sends the 3rd to slave unit S1 and write handshake and first and write control information.
Write bus 13 is in idle condition, and main equipment M2 obtains write bus 13 right to occupations, and bus processing unit 11 sends second to main equipment M2 and writes the answer signal of shaking hands, and obtains second and write control information by writing control/address tunnel; Main equipment M2 sends second by write data channel and writes data to bus processing unit 11.
Allocation units 21 read to be write second of control/address tunnel and writes control information, according to second address of writing main equipment M2 in the control information, read second of transmission from main equipment M2 and write data, and with the address of the address of main equipment M2, slave unit S2 and read second write data allocations and give unit, subtask 22D.Unit, subtask 22D receives the address of the main equipment M2 of allocation units 21 distribution, the address and second of slave unit S2 writes data, and is stored among the storage unit D10 of storer 23.
Bus processing unit 11 stores main equipment M2 and writes control information and second and write data by writing second of control/address tunnel and write data channel transmission, and sends the 4th to slave unit S2 and write handshake and second and write control information.
Slave unit S1 receives the 3rd and writes handshake, and affirmation is write the answer signal of shaking hands to 11 transmissions the 3rd of bus processing unit after can receiving data; Slave unit S2 receives the 4th and writes handshake, and affirmation is write the answer signal of shaking hands to 11 transmissions the 4th of bus processing unit after can receiving data.In the present embodiment, bus processing unit 11 receive simultaneously that slave unit S1 sends the 3rd write that shake hands answer signal and slave unit S2 send the 4th write the answer signal of shaking hands.
Arbitration through bus arbiter unit 12, slave unit S 1 obtains write bus 13 right to occupations, slave unit S1 obtains first and writes control information by writing control/address tunnel, and bus processing unit 11 first writes data to slave unit S1 by what write data channel sent that bus processing unit 11 stores.
Allocation units 21 read to be write first of control/address tunnel and writes control information, according to first address of writing slave unit S1 in the control information, that reads that slave unit S1 receives first writes data, and with the address of the address of main equipment M1, slave unit S1 and read first write data allocations and give unit, subtask 22A.Unit, subtask 22A receives the address of the main equipment M1 of allocation units 21 distribution, the address and first of slave unit S1 writes data, first write data and compare what receive with the data that are stored in the storage unit A 10 of storer 23, if identical then checking is passed through, if difference authentication failed then.
Write control/address tunnel and write data channel to slave unit S1 send first write control information and first and write data and finish after, write bus is in idle condition, slave unit S2 obtains write bus 13 right to occupations, slave unit S2 obtains second and writes control information by writing control/address tunnel, and bus processing unit 11 second writes data to slave unit S2 by what write data channel sent that bus processing unit 11 stores.
Allocation units 21 read to be write second of control/address tunnel and writes control information, according to second address of writing slave unit S1 in the control information, that reads that slave unit S1 receives second writes data, and with the address of the address of main equipment M1, slave unit S1 and read second write data allocations and give unit, subtask 22C.Unit, subtask 22C receives the address of the main equipment M1 of allocation units 21 distribution, the address and second of slave unit S1 writes data, second write data and compare what receive with the data that are stored among the storage unit D10 of storer 23, if identical then checking is passed through, if difference authentication failed then.
Illustrate that below in conjunction with Fig. 4 and Fig. 5 main equipment carries out the data transmission and the bus verification process of read operation to slave unit, wherein, Fig. 4 is the synoptic diagram of data transmission procedure, and Fig. 5 is the synoptic diagram of bus verification process.
Main equipment M1 and main equipment M2 send request of access to read bus 14 simultaneously, wherein main equipment M1 will read the data of slave unit S2, comprise that main equipment M1 reads handshake and first to 11 transmissions first of bus processing unit and reads control information, first reads control information comprises the address of main equipment M1 and the address of slave unit S2; Main equipment M2 will read the data of slave unit S1, comprises that main equipment M2 sends second reading handshake and second reading control information to bus processing unit 11, and the second reading control information comprises the address of main equipment M2 and the address of slave unit S1.
Bus processing unit 11 receives first and reads handshake and second reading handshake, arbitration through bus arbiter unit 12, main equipment M1 obtains read bus 14 right to occupations, bus processing unit 11 sends first to main equipment M1 and reads the answer signal of shaking hands, and obtains first and read control information by reading control/address tunnel; Bus processing unit 11 sends third reading handshake and first to slave unit S2 and reads control information.
Read bus 14 is in idle condition, and main equipment M2 obtains read bus 14 right to occupations, and bus processing unit 11 sends the second reading answer signal of shaking hands to main equipment M2, and obtains first and read control information by reading control/address tunnel; Bus processing unit 11 sends the 4th to slave unit S1 and reads handshake and second reading control information.
Slave unit S2 receives the third reading handshake, and affirmation can send after the data to bus processing unit 11 and send the third reading answer signal of shaking hands; Slave unit S1 receives the 4th and reads handshake, and affirmation is read the answer signal of shaking hands to 11 transmissions the 4th of bus processing unit after can sending data.In the present embodiment, what bus processing unit 11 received simultaneously that third reading that slave unit S2 sends shakes hands that answer signal and slave unit S1 send the 4th reads the answer signal of shaking hands.
Arbitration through bus arbiter unit 12, slave unit S1 obtains read bus 14 right to occupations, slave unit S1 obtains the second reading control information by reading control/address tunnel, and will fetch data and the second reading response message that returns to main equipment M2 sends to bus processing unit 11 by the read data passage corresponding to the second reading of second reading control information, the second reading response message comprises the address of main equipment M2 and the address of slave unit S1.Bus processing unit 11 stores the second reading that slave unit S1 send and fetches data and the second reading response message, and sends the 5th to main equipment M2 and read handshake.
Allocation units 21 read and control/the second reading control information of address tunnel, address according to slave unit S1 in the second reading control information, read the second reading of transmission from slave unit S1 and fetch data, and the address of the address of main equipment M2, slave unit S1 and the second reading that reads fetched data distribute to unit, subtask 22C.Unit, subtask 22C receives the address of the main equipment M2 of allocation units 21 distribution, address and the second reading of slave unit S1 fetched data, and be stored among the storage unit C10 of storer 23.
After slave unit S 1 sends by the read data passage that second reading is fetched data and the second reading response message finishes to bus processing unit 11, slave unit S2 obtains read bus 14 right to occupations, slave unit S2 obtains first and reads control information by reading control/address tunnel, and will read first reading of data of control information and return to first of main equipment M2 to read response message and send to bus processing unit 11 by the read data passage corresponding to first.Bus processing unit 11 stores first reading of data and first that slave unit S2 send and reads response message, and sends the 6th to main equipment M2 and read handshake.
Allocation units 21 read and control/address tunnel first read control information, according to first address of reading slave unit S2 in the control information, read first reading of data of transmission from slave unit S2, and the address of the address of main equipment M1, slave unit S2 and the second reading that reads fetched data distribute to unit, subtask 22B.Unit, subtask 22B receives the address of the main equipment M1 of allocation units 21 distribution, the address and first reading of data of slave unit S2, and is stored among the storage unit B10 of storer 23.
Main equipment M2 receives the 5th and reads handshake, and affirmation is read the answer signal of shaking hands to 11 transmissions the 5th of bus processing unit after can receiving data.Bus processing unit 11 receives the 5th and reads to shake hands behind the answer signal, by the read data passage send that the second reading that stores is fetched data and the second reading response message to main equipment M2.
Allocation units 21 read the second reading response message of read data passage, address according to main equipment M2 in the second reading response message, read the second reading that main equipment M2 receives and fetch data, and the address of the address of main equipment M2, slave unit S1 and the second reading that reads fetched data distribute to unit, subtask 22C.Unit, subtask 22C receives the address of the main equipment M2 of allocation units 21 distribution, address and the second reading of slave unit S1 fetched data, the data of the second reading that receives being fetched data and being stored among the storage unit C10 of storer 23 compare, if identical then checking is passed through, if difference authentication failed then.
Main equipment M1 receives the 6th and reads handshake, and affirmation is read the answer signal of shaking hands to 11 transmissions the 6th of bus processing unit after can receiving data.Bus processing unit 11 receives the 6th and reads to shake hands behind the answer signal, sends first reading of data and first that stores by the read data passage and reads response message to main equipment M1.
Allocation units 21 read first of read data passage and read response message, according to first address of reading main equipment M1 in the response message, read first reading of data that main equipment M1 receives, and the address of main equipment M1, the address of slave unit S2 and first reading of data that reads are distributed to unit, subtask 22B.Unit, subtask 22B receives the address of the main equipment M1 of allocation units 21 distribution, the address and first reading of data of slave unit S2, data among first reading of data that receives and the storage unit B10 that is stored in storer 23 are compared, if identical then checking is passed through, if difference authentication failed then.
Accordingly, embodiment of the present invention also provides a kind of verification method of data transmission system, and described data transmission system comprises at least one main equipment and a plurality of slave unit, and described main equipment and slave unit are by bus transfer data, and described verification method comprises:
Produce a plurality of subtasks based on predetermined allocation rule;
Based on described predetermined allocation rule, described main equipment or slave unit are sent to the data allocations that the data of bus and described main equipment or slave unit are received from bus give corresponding subtask;
The data that are received from bus that the subtask of described correspondence will receive compare with the corresponding data that send to bus that receive.
Optionally, described predetermined allocation rule comprises: according to the address of main equipment and/or the address assignment subtask of slave unit.
Optionally, when main equipment carries out write operation to slave unit, the described data that send to bus comprise the data that will send to bus that read from described main equipment, and the described data that are received from bus comprise the data that are received from bus that read from described slave unit.
Optionally, when main equipment carries out read operation to slave unit, the described data that send to bus comprise the data that will send to bus that read from described slave unit, and the described data that are received from bus comprise the data that are received from bus that read from described main equipment.
Optionally, described bus comprises write bus, described write bus comprises writes control/address tunnel and write data channel, when main equipment carries out write operation to slave unit, described control/the address tunnel of writing transmits the address of main equipment and the address of slave unit, and the write data passage is sent to slave unit with the data that write of main equipment.
Optionally, described bus comprises read bus, described read bus comprises reads control/address tunnel and read data passage, when main equipment carries out read operation to slave unit, describedly read to control/address tunnel transmits the address of main equipment and the address of slave unit, and described read data passage will be sent to main equipment from the data that slave unit reads.
In sum, technique scheme has the following advantages:
The allocation rule that foundation is scheduled to is divided into a plurality of checkings subtask with a validation task of bus architecture in the data transmission system, big than validation task data volume to be processed of prior art, data management and control complexity Gao Eryan, the data volume that handle each checking subtask significantly reduces, data management and control complexity reduce greatly, have therefore reduced the management and the control complexity of bus verification process relatively.
In the prior art, owing to have only a validation task, the checking (comparisons of data) of transmission data is that order is carried out between each main equipment and the slave unit, and the time of finishing proof procedure is long; And technique scheme is owing to be divided into a plurality of checkings subtask, each checking subtask can executed in parallel, the checking (comparisons of data) that is transmission data between each main equipment and the slave unit can walk abreast and carries out, and has therefore shortened the time of bus verification process relatively.
A validation task is divided into a plurality of checkings subtask, and the storer than low capacity can be used in each checking subtask, and is therefore also relatively easy for the data management and the control of storer, and also can reduce the possibility of data overflow storage.
A validation task is divided into a plurality of checkings subtask, the area decreases that each checking subtask is in charge of, therefore when the proof procedure appearance was wrong, error correction was also simple, only needed to analyze the responsible zone, checking subtask of makeing mistakes and got final product.
Though the present invention discloses as above with preferred embodiment, the present invention is defined in this.Any those skilled in the art without departing from the spirit and scope of the present invention, all can do various changes and modification, so protection scope of the present invention should be as the criterion with claim institute restricted portion.