2

您可以在 Origen 中为寄存器添加别名吗?类似于引脚别名的工作方式?

dut.add_reg_alias :orig_reg, :new_reg
4

1 回答 1

2

不,在撰写本文时不支持,尽管应该支持。

同时,您可以通过以下方式解决:

# Define the reg as you normally would with a default name
add_reg :reg1, 0x0 do |reg|
  # Bit definitions here
end

# Add an alias method for it like this
def reg1_alias; reg1 end

这将允许您通过直接名称访问它,而不是通过 reg() 方法(我总是建议使用直接名称)。

dut.reg1 == dut.reg1_alias  # => true
于 2017-10-27T09:26:44.920 回答