延迟开始SEM功能的扫描 (一)

作者:Ivy Guo,AMD工程师;来源:AMD开发者社区

SEM IP默认是上电后配置完毕就开始工作的. 但是由于其工作的特殊性质, 需要对全部CRAM空间进行扫描, 这样就会干扰到其他逻辑模块的初始化工作, 比如MIG Core的BIST. 此时需要推迟SEM IP的工作, 使其他模块先完成相应的初始化工作。

之前在<几种常见的关于SEM IP的冲突>中, 已经提到我们可以使用BUFGCE来推迟IP的工作. 但是仍然有客户询问具体的做法. 此处我们给出一个示例. 在本blog的后续(二)中, 会讲述如何在Versal器件中推迟XilSEM的扫描工作。

本示例基于VCU108开发板, 软件版本为Vivado 2022.2.

根据PCB的设定, 对时钟和串口做如下约束. 时钟直接采用VCU108提供的90MHz的EMCCLK.

## icap_clk
create_clock -name clk -period 11.111 [get_ports clk]
set_property IOSTANDARD LVCMOS18 [get_ports clk]
set_property PACKAGE_PIN AL20 [get_ports clk]
##Uart
set_property IOSTANDARD LVCMOS18 [get_ports uart_rx]
set_property PACKAGE_PIN BC24 [get_ports uart_rx]
set_property IOSTANDARD LVCMOS18 [get_ports uart_tx]
set_property PACKAGE_PIN BE24 [get_ports uart_tx]

其余按照标准Example Design设定即可. 下载bitstream到FPGA, 可以看到Uart几乎立即打印出了SEM IP的初始化信息:

下面我们来修改example的顶层.v文件. 默认的时钟连接关系很简单,直接将EMCCLK用作icap_clk送入IP内部:

  IBUF example_ibuf (
    .I(clk),
.O(clk_ibufg));

sem_ultra_0_support_wrapper example_support_wrapper (
    .clk (clk_ibufg),
…..
…..

我们只要在上述通路中插入一个BUFGCE, 修改一下连接关系即可:

    // add BUFGCE to control SEM IP startup
  IBUF example_ibuf (
    .I(clk),
    .O(clk_ibufg));  

BUFGCE BUFGCE_icap_clk (
      .O(clk_ce),   // 1-bit output: Clock output
      .CE(bufg_ce), // 1-bit input: Clock enable input for I0
      .I(clk_ibufg)    // 1-bit input: Primary clock
   );

  sem_ultra_0_support_wrapper example_support_wrapper (
    // add BUFGCE to control SEM IP startup
.clk (clk_ce),
.status_heartbeat(status_heartbeat),
…..

将CE的控制绑定到VCU108的一个User Switch上面. 这里我们使用SW12的4# Switch.

## add BUFGCE to control SEM IP startup; SW12.4
set_property IOSTANDARD LVCMOS12 [get_ports bufg_ce]
set_property PACKAGE_PIN BC40 [get_ports bufg_ce]

将4#switch默认拨到OFF的位置, 下载修改后的bitstream. 可以发现串口没有任何打印信息. 同时由于默认的Example design里面有VIO, Vivado还报出了 no supported debug core(s)的错误. 这是因为VIO也是使用icap_clk转化出来的时钟工作的:

INFO: [Labtools 27-1434] Device xcvu095 (JTAG device index = 0) is programmed with a design that has no supported debug core(s) in it.
WARNING: [Labtools 27-3361] The debug hub core was not detected.
Resolution:
1. Make sure the clock connected to the debug hub (dbg_hub) core is a free running clock and is active.
2. Make sure the BSCAN_SWITCH_USER_MASK device property in Vivado Hardware Manager reflects the user scan chain setting in the design and refresh the device.  To determine the user scan chain setting in the design, open the implemented design and use 'get_property C_USER_SCAN_CHAIN [get_debug_cores dbg_hub]'.
For more details on setting the scan chain property, consult the Vivado Debug and Programming User Guide (UG908).
WARNING: [Labtools 27-3413] Dropping logic core with cellname:'example_vio_si1_so41' at location 'uuid_4CE668E72EFE561CB50EFC28A47537FB' from probes file, since it cannot be found on the programmed device.
WARNING: [Labtools 27-3413] Dropping logic core with cellname:'example_vio_si14' at location 'uuid_4EA403FEA61054B3A6D790C8D184892A' from probes file, since it cannot be found on the programmed device.
WARNING: [Labtools 27-3413] Dropping logic core with cellname:'example_vio_si1_so5' at location 'uuid_B061BC0F3922574195479A3918D143B2' from probes file, since it cannot be found on the programmed device.

此时只要将4#Switch拨到ON的位置, SEM IP就可以开始工作了, 并且顺利打印除log信息。

需要注意的是: 每个power cycle, 该CE信号切换只能使用一次!

换句话说,我们可以无限延迟SEM IP工作的开始, 但是一旦开始, 就不能使用切断其时钟的方式来使它’暂停工作’. icap_clk断开后再次恢复的情形, 我们认为是不可靠的, 无法保证SEM IP的工作状态。

最新文章

最新文章