admin 管理员组

文章数量: 1086019

java logic赋予多个值,如何在VHDL中编写具有输入相关范围的std

我试图将std_logic_vector的某些部分复制到另一个位置(索引),具体取决于输入 . 这可以在Vivado中合成,但我想使用另一个工具(SymbiYosys,)进行形式验证 . SymbiYosys可以使用Verific作为前端来处理VHDL,但Verific不接受这一点 . 这是一小段代码,可以重现问题 . Verific抱怨"left range bound is not constant" . 那么,是否有一种解决方法可以让Verific接受这样的可变范围分配?

我已经找到了这篇文章VHDL: slice a various part of an array,它建议使用一个循环并为每位分配值,但我宁愿不改变我的代码,因为它适用于Vivado . 此外,我认为这样的循环会损害代码的可读性,也许会影响实现效率 . 因此,我正在寻找一种不同的方法(可能是将此错误转换为警告或不太严格的代码修改的方法) .

library IEEE;

use IEEE.STD_LOGIC_1164.all;

use IEEE.NUMERIC_STD.all;

entity test is

port(

clk : in std_logic;

prefix : in std_logic_vector( 8*8 -1 downto 0);

msgIn : in std_logic_vector(128*8 -1 downto 0);

msgLength : in integer range 1 to 128;

test_out : out std_logic_vector((128+8)*8 -1 downto 0)

);

end test;

architecture behav of test is

begin

process (clk)

begin

if rising_edge(clk) then

test_out <= (others => '0');

test_out((msgLength+8)*8 -1 downto msgLength*8) <= prefix;

test_out( msgLength *8 -1 downto 0) <= msgIn(msgLength*8 -1 downto 0);

end if;

end process;

end behav;

本文标签: java logic赋予多个值 如何在VHDL中编写具有输入相关范围的std