社区标签  xilinx-ChipDebug-第2页
标签

xilinx

帖子数
2W+
阅读量
25.5W+
热门评论
chipdebug的头像-ChipDebugchipdebug徽章-创作大使-ChipDebug等级-LV3-ChipDebug作者超级版主0

1.Xilinx ISE 查看子模块资源消耗(我的是14.7,可能跟你的版本略有差异)
先选中顶层,然后在流程的MAP这里右键打开属性对话框,勾上detail, 然后在报告的13项里面查看
Xilinx ISE 查看子模块资源消耗.jpg

FhJBjTQ8HytkYWjdFhQmtB4sM_a6.jpg

2.xilinx有一个专门的文档工具,在这里
https://www.xilinx.com/support/documentation-navigation/overview.html

Spi模式設定(PYNQ-Z2)-ChipDebugSpi模式設定(PYNQ-Z2)-ChipDebugSpi模式設定(PYNQ-Z2)-ChipDebug
热门评论
chipdebug的头像-ChipDebugchipdebug徽章-创作大使-ChipDebug等级-LV3-ChipDebug超级版主2
我看了pyznq的代码,你用spi_open_device这上函数打开应该就可以实现slave,

spi spi_open_device(unsigned int device) {
    int status;
    u16 dev_id;
    unsigned int base_address;
    u32 control;

    if (device < XPAR_XSPI_NUM_INSTANCES) {
        dev_id = (u16) device;
    }
    else {
        int found = 0;
        for (u16 i = 0; i < XPAR_XSPI_NUM_INSTANCES; ++i) {
            if (XSpi_ConfigTable[i].BaseAddress == device) {
                found = 1;
                dev_id = i;
                break;
            }
        }
        if (!found)
            return -1;
    }
    status = XSpi_Initialize(&xspi[dev_id], dev_id);
    if (status != XST_SUCCESS) {
        return -1;
    }
    base_address = xspi[dev_id].BaseAddr;
    // Soft reset SPI
    XSpi_WriteReg(base_address, XSP_SRR_OFFSET, 0xA);
    // Master mode
    control = XSpi_ReadReg(base_address, XSP_CR_OFFSET);
    // Master Mode
    control |= XSP_CR_MASTER_MODE_MASK;
    // Enable SPI
    control |= XSP_CR_ENABLE_MASK;
    // Slave select manually
    control |= XSP_INTR_SLAVE_MODE_MASK;
    // Enable Transmitter
    control &= ~XSP_CR_TRANS_INHIBIT_MASK;
    // Write configuration word
    XSpi_WriteReg(base_address, XSP_CR_OFFSET, control);

    return (spi) dev_id;
}
该帖子部分内容已隐藏
付费阅读
已售 2
3积分
此内容为付费阅读,请付费后查看
该帖子内容已隐藏,请评论后查看

登录后继续评论