【问题标题】:How do I read the status register of a Virtex 5 in a JTAG chain?如何读取 JTAG 链中 Virtex 5 的状态寄存器?
【发布时间】:2015-04-07 06:05:15
【问题描述】:

我正在研究 XUPV5-LX110T,我正在尝试通过 JTAG 读取状态寄存器。我得到不正确的数据,但我不明白为什么。我似乎得到了全零。

我怀疑这与 JTAG 链的顺序有关,但我不确定应该如何调整我发送的命令的顺序。

我知道 TMS 坑会改变链上所有设备的状态,但是当 FPGA 是链上的最后一个设备时,如何将数据转移到 FPGA?

【问题讨论】:

    标签: fpga jtag virtex


    【解决方案1】:

    我实际上在同一台设备上工作过。如果我是正确的,当您查看 iMPACT 中的 JTAG 链时,您应该会看到 5 个设备:两个 PROM、一个 SystemAce 和一个 CPLD,然后是 Virtex 5 作为链上的最后一项。像这样:

    PROM -> PROM -> SysAce -> CPLD -> Virtex5

    为了成功读取状态寄存器,您需要了解 TAP 控制器的工作原理:


    (来源:fpga4fun.com

    如您所说,TMS 信号连接到 JTAG 链上的所有设备。也就是说,如果您处于 Test-Logic-Reset 状态并发送 0 1 1 0 0,那么所有设备现在都将处于 Shift-DR 状态。

    接下来,您需要知道 JTAG 链上器件的所有指令寄存器的大小。在这种情况下,两个 PROM 的 IR 大小为 16 位。 SysAce 和 CPLD 的 IR 大小为 8 位。您想知道这些大小,以便知道要向下传输多少数据。 Virtex 5 的 IR 大小为 10 位。

    使用 JTAG 的最后一个技巧是注意在发送命令时,它们在 TDI LSB-first 上传输。但是,将数据移入 DR 是 MSB 优先的。请务必检查Virtex 5 Configuration Guide中的哪个方式

    有了这些信息,你可以像下面的伪代码一样读取状态寄存器:

    unsigned int read_status_register {
      reset JTAG to Test-Logic-Reset by sending five 1s on TMS
    
      go into Shift-IR state
    
      // The order of this depends on your JTAG chain
      Send CONFIG_IN on TDI (these 10 bits will eventuall get pushed to the Virtex 5's IR)
    
      Send eight 1's to put the CPLD in BYPASS
    
      Send eight 1's to put the SysAce in BYPASS
    
      Send sixteen 1s to put the next PROM in bypass
    
      Send fifteen 1s to put the last PROM in bypass
    
      // As described in the configuration guide
      Send the last 1 on TDI while transitioning from Shift-IR to the Exit state
    
      Transition back to Test-Logic-Reset
    
      Transition to Shift-DR
    
      Shift in the command sequence (sync word, noop, read_status, noop, noop)
    
      Shift in 3 bits to push the command sequence past the other devices on the chain
    
      Shift in 1 more bit while transitioning to exit
    
      Transition to Shift-IR
    
      Shift in CONFIG_OUT
    
      Shift in 1's to put all devices in BYPASS like we did above
    
      Transition to Shift-DR
    
      Shift out 32-bits and save the data coming from TDO
    
      // Note that we can stop here because the FPGA is the last device
      // on the chain. Otherwise, you may need to shift in a couple of bits
      // to push the data past other devices on the chain
    
    }
    

    如您所见,基本上都是关于进行正确的状态转换,并了解发送内容的顺序。祝你好运!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-22
      • 1970-01-01
      • 1970-01-01
      • 2023-03-19
      • 1970-01-01
      • 2010-09-06
      • 1970-01-01
      • 2020-03-26
      相关资源
      最近更新 更多