pcie_dma:xapp1052 Study Notes

Source: Internet
Author: User

Moselsim Simulation:

    

EP is the endpoint part of the implementation code, the routine master code. The other is to build the simulation environment, the main purpose is to imitate the driving behavior, the PCIe soft core used, mainly to do PC-side behavior simulation, such as DMA configuration, DMA read and write operation and master clock, reset and so on. After adding testbench structure such as.

Board: Top-level file + system reset

Part of the Rp:root complex. Where Rport is the PCIe port portion, Rx_usrapp is the RX part, is responsible for sending data, Tx_usrapp is the TX part, is responsible for receiving data, Cfg_usrapp is the configuration section, configuration read-write enable, error control, and some common tasks to facilitate other module calls Com_usrapp is to load Rx/tx file, save rx/tx data as DAT file, load/overwrite when needed. Pl_usrapp physical layer control and State section.

CLK_GEN_RP/EP: Two-port clock generates signals respectively.

In fact, the structure of the EP and RP is very similar, the basic is the corresponding relationship, so understanding the workload is not very large.

Grammar notes:

Because the CLK_GEN_RP/EP is very simple, there is no need to grilled, so minutes passed. Next is a note on some of the grammar that the RP (Testbench) does not normally see.

1.module XXX # (

Parameter xxxx1 = XX,

Parameter xxxx2 = XX,

......

)

(

Input XXXXXX,

Output XXXX,

.......

);

This is the normal module definition. The preceding parenthesis is the definition of the preparation for the parameter passing, and the following parenthesis is the common input-output port definition.

XXX # (

. xxxx1 (XX),

. XXXX2 (XX),

......

)

Module_usrname (

. XXXXXX (xxxxxxx),

. xxxx (xxxx),

.......

);

This is the statement that invokes the module XXX, where the preceding parenthesis is used for parameter passing, followed by a parenthesis for the input and output port reference.

In 2.rport, there is a clear definition of RP bar0-bar5 that needs to be recorded:

BAR0 = "Hffffff00",
BAR1 = "hffff0000",
BAR2 = "hffff000c",
BAR3 = "Hffffffff",
BAR4 = "h00000000",
BAR5 = "h00000000",

The output in 3.rx_usrapp is Trn_rdst_rdy_n and Trn_rnp_ok_n, respectively, and these two signals are generated by ramdom. However, the original code inside the Trn_rdst_rdy_n is always 0, the actual addition of DMA operation can be used to control the trn_rdst_rdy_toggle_count to make it effective. One of the state machines makes the store of the data in the RX by invoking the task in usrapp_com.

4. Call the Task method:

Eg:board. Rp.com_usrapp. Tsk_read_data (0, ' Rx_log, Trn_rd, trn_rrem_n);--refers to the Board-rp-com_usrapp task in the Tsk_read_data, where the pass variable is inside the parentheses, The variables are passed according to the input order within the TSK_READ_DATA definition inside the Usrapp.

5. $value $plusargs: Pass the parameter value in the Run command (run-options) to the specified signal or character
Usage:

if ($value $plusargs ("testname=%s", testname))
$display ("Running Test {%0s} ...", testname);

Then, when the Run command used is: <run-options>+testname=tst_name, the result is: Running Test {tst_name} ...

6. If you want to use the DMA function, call the function in PCI_EXP_USRAPP_TX.V, write the address, length and other data to the DMA control register, and then start the DMA read or write.

pcie_dma:xapp1052 Study Notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.