首页 > 解决方案 > vunit_lib.array_pkg 中的 data_width 限制(32 位)是否有解决方法

问题描述

我正在运行 array_axis_vcs VUNIT 示例。现在我想根据我的需要自定义示例,增加 data_width 大小(示例中为 32 位)。

这样做会出现以下错误。包中的 AXIS 数据宽度似乎有 32 位的限制。

这是有根本原因的吗?也许是一种解决方法?

实际上,我想每个时钟周期传输 32 个有符号(9 到 0)值,然后我会将其映射到 std_logic_vector(319 到 0)。我希望 AXIS 代码只是将此有效负载视为 std_logic_vector,但在某处它会尝试将其转换为已签名。

# Stack trace result from 'tb' command
#  /usr/lib/python2.7/site-packages/vunit/vhdl/data_types/src/integer_array_pkg-body.vhd 220 return [address 0x7feff05dbae7] Subprogram set_word_size
# called from  /usr/lib/python2.7/site-packages/vunit/vhdl/data_types/src/integer_array_pkg-body.vhd 273 return [address 0x7feff05d8215] Subprogram new_3d
# called from  /usr/lib/python2.7/site-packages/vunit/vhdl/array/src/array_pkg.vhd 210 return [address 0x7feff0b9a75b] Subprogram array_t.init_3d
# called from  /usr/lib/python2.7/site-packages/vunit/vhdl/array/src/array_pkg.vhd 196 return [address 0x7feff0b9a642] Subprogram array_t.init_2d
# called from  /hsdtlvob/impala/design_sources/dpu_common/axis_buffer/src/test/tb_axis_loop.vhd 122 return [address 0x7feff0ba5ddb] Process save
# 
# 
# Surrounding code from 'see' command
#   215 :   procedure set_word_size(variable arr : inout integer_array_t;
#   216 :                           bit_width : natural := 32;
#   217 :                           is_signed : boolean := true) is
#   218 :   begin
#   219 :     assert (1 <= bit_width and bit_width < 32) or (bit_width = 32 and is_signed)
# ->220 :       report "Unsupported combination of bit_width and is_signed";
#   221 :     arr.bit_width := bit_width;
#   222 :     arr.is_signed := is_signed;
#   223 : 
#   224 :     if arr.is_signed then

标签: vhdlvunit

解决方案


您遇到的问题与 AXI Stream 验证组件无关,而是与文件读取/写入刺激/结果时使用的数组类型有关。数组类型基于 32 位整数,不能处理更大的向量。要处理更大的向量,您必须在 CSV 文件中为每个刺激/结果向量使用多个整数,例如 2 个整数用于 64 位向量。

我还建议您使用较新的integer_array_t而不是array_t. array_t基于受保护的类型,它有许多没有的限制integer_array_t。还有一些工作正在支持任意类型的动态数组,以便您可以std_logic_vector(319 downto 0)直接使用您的数组,或者甚至更好地创建一个包含 32 的数组数组signed(9 downto 0)。请查看此问题以获取有关该工作的更多信息。


推荐阅读