Summary of the invention
The technical problem to be solved in the present invention is to provide a kind ofly can realize PCI Express interface chip frequency reducing hardware verification, compatible existing test code, realize the PCIe interface chip hardware verification method based on asynchronous physical layer interface simple and convenient, that versatility good, resources occupation rate is low.
In order to solve the problems of the technologies described above, the technical solution used in the present invention is:
A kind of PCIe interface chip hardware verification method based on asynchronous physical layer interface, implementation step is as follows:
1) build the FPGA hardware platform with Standard PC I Express interface, described FPGA hardware platform is connected with main frame with PCI Express root node equipment by Standard PC I Express interface;
2) insert between the soft core of PCI Express in PCI Express interface chip ASIC code to be verified and Physical layer for the poor asynchronous physical layer interface of matching frequency, described asynchronous physical layer interface comprises transmission buffer zone, reception buffer zone, frequency reducing PIPE interface and standard P IPE interface, and described asynchronous physical layer interface is connected with the FPGA hardware platform, is connected with Physical layer by standard P IPE interface by frequency reducing PIPE interface;
3) described PCI Express interface chip ASIC code to be verified is moved to described FPGA hardware platform and comprehensively realize, and according to PCI Express interface chip, the frequency of operation of frequency reducing PIPE interface is set by comprehensive highest frequency;
4) use test program is carried out functional test by described FPGA hardware platform to the soft core of PCI Express and the user logic of PCI Express interface chip, when the soft core of PCI Express sends PCI Express message by asynchronous physical layer interface to Physical layer, the soft core of PCI Express writes PCI Express message by frequency reducing PIPE interface the transmission buffer zone of asynchronous physical layer interface, asynchronous physical layer interface will send buffer cache PCI Express message and send to Physical layer by standard P IPE interface, simultaneously when the transmission buffer zone of asynchronous physical layer interface is sky, asynchronous physical layer interface detects the state of shaking hands of link, the success if shake hands compensate difference on the frequency between the soft core of PCI Express and Physical layer inserting SKP ordered set message on standard P IPE interface, the success if shake hands compensate difference on the frequency between the soft core of PCIExpress and Physical layer inserting the empty message of LIDLE logic on standard P IPE interface, when Physical layer sends PCI Express message by asynchronous physical layer interface to the soft core of PCI Express, asynchronous physical layer interface detects the state of shaking hands of link, the success if shake hands the PCIExpress message that receives is abandoned according to the ratio between the frequency of operation of the frequency of operation of frequency reducing PIPE interface and standard P IPE interface, and the PCI Express message that will not abandon writes the reception buffer zone of asynchronous physical layer interface, the success if shake hands the type of the PCI Express message that judgement receives, when being link layer message or transaction layer message, PCI Express message writes the reception buffer zone of asynchronous physical layer interface, when being the empty message of logic, PCI Express message all abandons, asynchronous physical layer interface sends to Physical layer with reception buffer zone buffer memory PCI Express message by frequency reducing PIPE interface.
As further improvement in the technical proposal of the present invention:
When by comprehensive highest frequency, the frequency of operation of frequency reducing PIPE interface being set according to PCI Express interface chip described step 3), the frequency of operation value rule of frequency reducing PIPE interface is suc as formula shown in (1);
fl/fs=1,4/5,3/4,7/10,2/3,3/5,1/2,2/5 (1)
In formula (1), flBe the frequency of operation of frequency reducing PIPE interface, fsFrequency of operation for standard P IPE interface.
The reception buffer zone capacity of described asynchronous physical layer interface satisfies the funtcional relationship of formula (2);
Cfifo>Ctlp*(1-(fl-fdllp)/fs) (2)
In formula (2), CFifoBe the capacity of reception buffer zone, CtlpBe the transaction layer message reception buffer zone capacity (concrete numerical value and soft caryogamy are equipped with the pass, generally are no more than 32KB) of the soft core of PCI Express, fDllpBe the maximum renewal frequency (concrete numerical value and soft caryogamy are equipped with the pass, generally are no more than 1MHz) of data link layer message, flBe the frequency of operation of frequency reducing PIPE interface, fsFrequency of operation for standard P IPE interface.
When described step 4), the PCI Express message that receives being abandoned according to the ratio between the frequency of operation of the frequency of operation of frequency reducing PIPE interface and standard P IPE interface, the ratio of abandoning satisfies the funtcional relationship of formula (3);
M/(M+N)=fl/fs (3)
In formula (3), M is the message number that receives continuously, the message number of N for abandoning continuously, flBe the frequency of operation of frequency reducing PIPE interface, fsFrequency of operation for standard P IPE interface;
Simultaneously describedly abandon the funtcional relationship that ratio also satisfies formula (4) and (5):
fl/fs=M/(M+N)>8/(delaytx+delaylink+delayrx+16) (4)
fl/fs>1/3 (5)
In formula (4), delaytxDelay, the delay of transmit legLinkDelay, the delay of physical linkrxTake over party's delay, delaytx, delayLink, delayrxAll to send the time of an ordered set message as the unit interval on standard P IPE interface.
The PCI Express interface chip verification method that the present invention is based on asynchronous physical layer interface has following advantage:
(1) the present invention can realize and the communicating by letter of Standard PC I Express equipment, the soft core of PCIExpress and the difference on the frequency between Physical layer realized by asynchronous physical layer interface mate, after employing the present invention, the transmission receiving velocity of serial link all changes, asynchronous physical layer interface has guaranteed compatibility with PCI Express agreement to the deletion insertion process of data, therefore can with the proper communication of PCIExpress equipment, can realize PCI Express interface chip frequency reducing hardware verification.
(2) the present invention is based on standard P IPE interface, do not increase or reduce any signal, FPGA code to be verified can directly be connected with it, do not need to do any change, therefore the soft core of PCI Express and user logic code to be verified do not need to make any modification, has advantages of to realize simple and convenient, compatible existing test code.
(3) the present invention does not need the support of special hardware, can comprehensively be implemented in general FPGA verification platform as module code direct and to be verified, has advantages of that versatility is good, it is simple to realize, resources occupation rate is low.
Embodiment
As shown in Figures 2 and 3, the present embodiment is as follows based on the implementation step of the PCIe interface chip hardware verification method of asynchronous physical layer interface:
1) build the FPGA hardware platform with Standard PC I Express interface, the PGA hardware platform is connected with main frame with PCI Express root node equipment by Standard PC IExpress interface;
2) insert between the soft core of PCI Express in PCI Express interface chip ASIC code to be verified and Physical layer for the poor asynchronous physical layer interface (as shown in Figure 3) of matching frequency, asynchronous physical layer interface comprises transmission buffer zone, reception buffer zone, frequency reducing PIPE interface and standard P IPE interface, and asynchronous physical layer interface is connected with the FPGA hardware platform, is connected with Physical layer by standard P IPE interface by frequency reducing PIPE interface;
3) PCI Express interface chip ASIC code to be verified is moved to the FPGA hardware platform and comprehensively realize, and according to PCI Express interface chip, the frequency of operation of frequency reducing PIPE interface is set by comprehensive highest frequency;
4) use test program is carried out functional test by the FPGA hardware platform to the soft core of PCI Express and the user logic of PCI Express interface chip, when the soft core of PCI Express sends PCI Express message by asynchronous physical layer interface to Physical layer, the soft core of PCI Express writes PCI Express message by frequency reducing PIPE interface the transmission buffer zone of asynchronous physical layer interface, asynchronous physical layer interface will send buffer cache PCI Express message and send to Physical layer by standard P IPE interface, simultaneously when the transmission buffer zone of asynchronous physical layer interface is sky, asynchronous physical layer interface detects the state of shaking hands of link, the success if shake hands compensate difference on the frequency between the soft core of PCI Express and Physical layer inserting SKP ordered set message on standard P IPE interface, the success if shake hands compensate difference on the frequency between the soft core of PCI Express and Physical layer inserting the empty message of LIDLE logic on standard P IPE interface, when Physical layer sends the PCIExpress message by asynchronous physical layer interface to the soft core of PCI Express, asynchronous physical layer interface detects the state of shaking hands of link, the success if shake hands the PCIExpress message that receives is abandoned according to the ratio between the frequency of operation of the frequency of operation of frequency reducing PIPE interface and standard P IPE interface, and the PCI Express message that will not abandon writes the reception buffer zone of asynchronous physical layer interface, the success if shake hands the type of the PCI Express message that judgement receives, when being link layer message or transaction layer message, PCI Express message writes the reception buffer zone of asynchronous physical layer interface, when being the empty message of logic, PCI Express message all abandons, asynchronous physical layer interface sends to Physical layer with reception buffer zone buffer memory PCI Express message by frequency reducing PIPE interface.
The present embodiment is (PHY Interface of PCI Express on PCI Express physical layer interface, abbreviation PIPE interface) realize frequency-dropping function, do not need to revise the soft core of PCI Express and user logic code, PCI Express after frequency reducing end equipment can and PCI Express root device between proper communication, adopt the mode of soft core to realize, resources occupation rate is low, can directly comprehensively realize to the FPGA verification platform with code to be verified.
As shown in Figure 4, the FPGA hardware platform with Standard PC I Express interface in the present embodiment is the FPGA card authentication, the FPGA card authentication is inserted on the PCI Express slot of server, thereby be connected with the Standard PC I Express equipment on server (with the main frame of PCI Express root node equipment) mainboard, consist of the FPGA hardware platform of a PCI Express interface chip FPGA verification system, so that the function of checking PCIExpress interface chip.
When by comprehensive highest frequency, the frequency of operation of frequency reducing PIPE interface being set according to PCI Express interface chip in the present embodiment, step 3), the frequency of operation value rule of frequency reducing PIPE interface is suc as formula shown in (1);
fl/fs=1,4/5,3/4,7/10,2/3,3/5,1/2,2/5 (1)
In formula (1), flBe the frequency of operation of frequency reducing PIPE interface, fsFrequency of operation for standard P IPE interface.In the present embodiment, the frequency of operation f of standard P IPE interfacesBe 125MHz, fl/ fsValue be 3/5,1/2,2/5 o'clock respectively the frequency of corresponding frequency reducing PIPE interface be 75MHz, 62.5MHz, 50MHz, can satisfy the soft core of PCI Express and use FPGA to carry out the frequency requirement of hardware verification.PCI Express interface chip ASIC code to be verified is moved to the FPGA hardware platform when comprehensively realizing, can adopt synthesis tool comprehensively to realize, the highest frequency that can be aggregated into according to PCI Express arranges the frequency of operation of frequency reducing PIPE interface.
In the present embodiment, the reception buffer zone capacity of asynchronous physical layer interface satisfies the funtcional relationship of formula (2);
Cfifo>Ctlp*(1-(fl-fdllp)/fs) (2)
In formula (2), CFifoBe the capacity of reception buffer zone, CtlpBe the transaction layer message reception buffer zone capacity (concrete numerical value and soft caryogamy are equipped with the pass, generally are no more than 32KB) of the soft core of PCI Express, fDllpBe the maximum renewal frequency (concrete numerical value and soft caryogamy are equipped with the pass, generally are no more than 1MHz) of data link layer message, flBe the frequency of operation of frequency reducing PIPE interface, fsFrequency of operation for standard P IPE interface.After the success of PCIe link handshake, only send the message of two types on the PIPE interface: transaction layer message (Transaction Layer Packet, be called for short TLP) and data link layer message (Data Link Layer Packet, be called for short DLLP), these two kinds of messages all write reception buffer zone as valid data, and the frequency that writes is fs, to be read by the soft core of the PCIe of frequency reducing again simultaneously, the frequency of reading is fl, because the speed that the velocity ratio of reading writes is slow, therefore have the part message buffering in asynchronous PIPE interface.The data link layer message is periodically to send, and maximum renewal frequency is fDllp, the speed that therefore is used for actual treatment TLP message is (fl-fDllp), and the transaction layer message total volume that the soft core of PCI Express can receive is received buffer capacity CtlpAs long as restriction is therefore the capacity C of reception buffer zoneFifo>Ctlp* (1-(fl-fDllp)/fs), just can prevent that reception buffer zone from overflowing.
When in the present embodiment, step 4), the PCI Express message that receives being abandoned according to the ratio between the frequency of operation of the frequency of operation of frequency reducing PIPE interface and standard P IPE interface, the ratio of abandoning satisfies the funtcional relationship of formula (3);
M/(M+N)=fl/fs (3)
In formula (3), M is the message number that receives continuously, the message number of N for abandoning continuously, flBe the frequency of operation of frequency reducing PIPE interface, fsFrequency of operation for standard P IPE interface;
The ratio that abandons simultaneously also satisfies the funtcional relationship of formula (4) and (5):
fl/fs=M/(M+N)>8/(delaytx+delaylink+delayrx+16) (4)
fl/fs>1/3 (5)
In formula (4), delaytxDelay, the delay of transmit legLinkDelay, the delay of physical linkrxTake over party's delay, delaytx, delayLink, delayrxAll to send the time of an ordered set message as the unit interval on standard P IPE interface.
In the present embodiment, when the transmission buffer zone is sky, asynchronous physical layer interface can insert the idle message of some PCIExpress normalized definitions on standard P IPE interface: asynchronous physical layer interface does not also insert SKP ordered set message before success in link handshake, insert the empty message of LIDLE logic after the link handshake success, compensate the difference on the frequency on asynchronous physical layer interface both sides with this, guarantee that the data on the standard asynchronous physical layer interface are not interrupted; According to PCI Express protocol specification, Standard PC I Express equipment can abandon it after receiving idle message, and therefore inserting these messages can not affect the normal operation of Standard PC I Express equipment.Asynchronous physical layer interface writes asynchronous physical layer interface reception buffer zone with the PCI Express message that receives by standard P IPE interface.According to PCI Express standard, the PCI Express message of receiving before the link handshake success is all the ordered set message, in order to mate the difference on the frequency on asynchronous PIPE interface both sides, need to abandon according to the ratio between the frequency of the frequency of frequency reducing PIPE interface and standard P IPE interface the ordered set message that receives, the ratio of abandoning satisfies the funtcional relationship of formula (3).Abandon the handshake procedure that the part message can have influence on PCI Express agreement, according to PCI Express protocol specification, state transitions need to satisfy two conditions in the link handshake process: (1) receives 8 continuous handshake message, and (2) have sent 16 same messages after receiving first handshake message of the other side continuously.Abandon in order to make the handshake procedure that the part message does not affect link, the highest ratio that can dropping packets satisfies the funtcional relationship of formula (4), in formula (4), and delaytx, delayLink, delayrxBeing respectively transmit leg, physical link, take over party's delay, is all to send an ordered set message as the unit interval (for standard P IPE interface unit interval of 16bit/125MHz as 64ns) on standard P IPE interface.DelayLinkAnd delayrxBe the receive delay of link delay and Standard PC I Express equipment, usually unadjustable, delaytxBe the delay (comprising the delay of asynchronous PIPE module) of transmit leg, therefore can change lowest operating frequency by the control lag umber of beats.Consider the factors such as the overtime and retransmission time out of the credit of PCI Express agreement, fl/ fsMinimum value should greater than 1/3 (the corresponding minimum frequency reducing frequency of the standard P IPE interface of 16bit/125MHz is 41.67MHz), enough satisfy the frequency requirement of the soft veritification card of PCI Express.
After the link handshake success, the PCIExpress message that asynchronous physical layer interface receives has three kinds: the empty message of link layer message, transaction layer message and logic, wherein link layer message and transaction layer message are effective PCI Express data, the empty message of logic is just in order to fill the free time on link, the message that guarantees the continuity of data and send, abandoning the empty message of logic can not affect the correctness of PCIExpress data transmission.Asynchronous physical layer interface writes inner reception buffer zone with link layer message and the transaction layer message that receives, the empty message of logic all abandons, the control that the link layer message that can send due to transmit leg and transaction layer message amount are received credit, in order to prevent that receiving FIFO overflows, the reception buffer zone capacity satisfies the funtcional relationship of formula (2).Asynchronous physical layer interface is read link layer message and transaction layer message from reception buffer zone, and sends to the soft core of PCI Experss by frequency reducing PIPE interface, when reception buffer zone is sky, sends the empty message of logic to the soft core of PCI Experss.Regulate in this way the ratio of the empty message of logic of filling between PCI Express link layer and transaction layer message, thus the difference on the frequency on asynchronous physical layer interface both sides when compensation receives.
As shown in Figure 5, in the present embodiment, asynchronous physical layer interface upwards connects the soft core of PCIExpress by frequency reducing PIPE interface, connects physical layer block by standard P IPE interface downwards, and asynchronous PLIM is made of four parts.
(1) clock module
Clock module carries out frequency division with the clock of inputting on standard P IPE interface by frequency synthesizer PLL, and the frequency reducing clock that obtains uses for the soft core of PCIExpress to be verified, and asynchronous PIPE both sides clock ratio can be got following value:
Frequency reducing PIPE clock fl/ standard P IPE clock fs=Isosorbide-5-Nitrae/5,3/4,7/10,2/3,3/5,1/2,2/5
The selection of these values is can insert uniformly and the deletion message according to ratio of integers in PCI Express handshake procedure in order to guarantee, prevents that the message amount of insert continually and deletion from too much affecting PCI Express link handshake process.
(2) state and control module
State and control module realize the control of physical layer block and the collection of status signal, in the PIPE interface standard, defined signal is except PHYSTATUS and RXSTATUS signal, to following signal (TXDETECTRX, POWERDOWN, TXELECIDLE, RXELECIDLE, RXPOLARITY, TXCOMPLIANCE, RXVLAID) be left intact, signal corresponding on frequency reducing PIPE interface and standard P IPE interface directly is connected; PHYSTATUS and RXSTATUS signal demand are expanded phystatus and the rxstatus signal of Physical layer output, to guarantee to adopt this signal at clock zone at a slow speed, should satisfy following relation (phystatus and rxstatus are postponed four to be clapped or can satisfy this condition together) after after expansion, deration of signal ratio rounds: [Tl/ Ts]>[fs/ fl], TlThe cycle of PHYSTATUS and RXSTATUS on expression frequency reducing interface, TsThe phystatus of expression physical layer interface output and the cycle of rxstatus.
(3) sending module
Sending module sends to the quick clock territory with the soft caryogenic data of PCI Express from clock zone at a slow speed, and sending module is divided into again following three submodules:
a) FIFO writing module: be used for to input data when the TXELECIDLE invalidating signal and write the transmission fifo module, the distinguishing mark that to input simultaneously data and PCI Express type of message compares that (ordered set is designated the COM symbol, the data link layer message be designated the SDP/ENDB/ENDG symbol, the transaction layer message be designated the STP/ENDB/ENDG symbol, the empty message of logic is complete zero), obtain the type of message PKT_TYPE of current data, can judge beginning and the end of message according to PKT_TYPE, when running into the message trailer sign, message total counter PKT_NUM adds 1 at every turn, PKT_NUM is converted to sends to the quick clock territory after gray code (Gray code) for the transmit control device module.
B) send fifo module: send the transmission buffer zone that fifo module is preceding method, be used for preserving data to be sent, sending fifo module has an empty sign prog_empty, and this empty sign prog_empty is set to 1 when remaining data bulk is less than 16 (maximum lengths of 2 ordered sets) in sending fifo module.At first the data that the transmit control device module is read from send fifo module also compare with the distinguishing mark of PCI Express type of message, obtain the type of message pkt_type of current data, according to beginning and the end of pkt_type judgement message, when running into the message trailer sign, message total counter pkt_num adds 1 at every turn.
C) transmit control device module: be used for from the FIFO sense data and send to Physical layer.
The course of work of transmit control device module is divided into following step:
The first step: will read useful signal and set to 0 (being rd_en=0), message is skipped total counter and is set to 0 (skp_num=0);
Second step: when the TXELECIDLE invalidating signal and when sending the empty sign of fifo module prog_empty and equaling 0, the transmit control device module enables to send reading useful signal (rd_en equals 1) beginning sense data and sending of fifo module, until prog_empty equal 1 and the data of current output be the head (type of message pkt_type equals ordered set sign COM) of an ordered set, will read useful signal and set to 0 (rd_en equals 0) and turned for the 3rd step; Perhaps run into the LIDL message and forwarded for the 4th step to.
The 3rd step: send continuously SKP ordered set message, until prog_empty equals 0, forward second step to;
the 4th step: (sending fifo module is asynchronous FIFO if pkt_num is less than PKT_NUM, packet counting will be carried out simultaneously at the end that writes and read of asynchronous FIFO, writing the end packet counting represents with PKT_NUM, reading the end packet counting represents with pkt_num, by comparing the size of these two counters, can know and whether also have message in asynchronous FIFO, therefore these two counters are with identical name, distinguish by capital and small letter) rd_en equal 1, sense data and send to Physical layer continuously from send FIFO, rd_en equals 0 and forwarded for the 5th step to when pkt_hum equals PKT_NUM,
The 5th step: send continuously the LIDL message, LIDL message skp_num of every transmission adds 1, inserts a SKP ordered set message and skp_num is clear 0 greater than 1000 the time as skp_num, until pkt_num turned for the 4th step during less than PKT_NUM;
In case in above-mentioned steps, the TXELECIDLE signal effectively get back to the first step.
(4) receiver module
Receiver module is divided into following three submodules:
A) receive controller module: receive and write the reception fifo module after controller module (RECV_CONTROLLER) filters the data that receive.
The course of work that receives controller module is divided into following step:
The first step: the distinguishing mark of receive data and type of message is compared (ordered set is designated the COM symbol, DLLP is designated the SDP/ENDB/ENDG symbol, TLP is designated the STP/ENDB/ENDG symbol, the empty message of logic is complete zero), thereby obtain the type of message rxpkt_type of current data, can judge that according to rxpkt_type the current data that receive are start of message (SOM), end or are in the middle of message;
Second step: if the current data of receiving are ordered set heading (being rxpkt_type=COM), beginning writes M ordered set message (write enable signal wt_en and equal 1) to receiving in fifo module continuously, then abandon N ordered set message (write enable signal wt_en and equal 0), if the data of receiving are logic sky messages forwarded for the 3rd step to;
The 3rd step: write continuously the empty message (write enable signal wt_en and equal 1) of M logic in FIFO to receiving, then abandon the empty message (write enable signal wt_en and equal 0) of N logic, forwarded for the 4th step to until current data is the data link layer heading;
The 4th step: if what receive is that the ordered set message forwards second step to, if data link layer message or transaction layer message write the reception fifo module, if the empty message of logic and current data are not that DLLP or transaction layer message abandon;
In case in the above-mentioned steps implementation, the rxelecidle of Physical layer output effectively directly get back to the first step.
B) receive fifo module: receive the reception buffer zone that fifo module is preceding method, receiving fifo module is the asynchronous FIFO of standard, receive the fifo module correspondence and be provided with a sky sign empty who is used for record storage dummy status, after the total data in receiving fifo module is read out, sky is indicated that empty puts 1.
C) FIFO reads module: receive when sky sign empty equals 0 FIFO to read enable signal effective, the data of reading from receive fifo module are directly exported, the empty message LIDL of output logic when sky sign empty equals 1.
The above is only the preferred embodiment of the present invention, and protection scope of the present invention also not only is confined to above-described embodiment, and all technical schemes that belongs under thinking of the present invention all belong to protection scope of the present invention.Should be pointed out that for those skilled in the art, in the some improvements and modifications that do not break away under principle of the invention prerequisite, these improvements and modifications also should be considered as protection scope of the present invention.