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

我试图将std_logic_vector的某些部分复制到另一个位置(索引),具体取决于输入 . 这可以在Vivado中合成,但我想使用另一个工具(SymbiYosys,https://github.com/YosysHQ/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;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值