在实现function "or"
for 自定义数组类型时,我决定看一下 for 的"or"
实现std_logic_vector
。在那里我偶然发现了这样的代码:
(摘录,我不知道是否有版权之类的东西,因为每个供应商都可以有自己的实现)。
funciton "or" (Left, Right: std_logic_vector) is
...
begin
if Left'LENGTH /= Right'LENGTH then
assert FALSE report
"ErrorDifferentLengthVectors" severity failure;
else
...
end if;
end "or";
this over using the
条件-part of the
报告语句的优势在哪里?断言不会取消进一步的编译,还是需要将以下代码放在 else 分支中?
funciton "or" (Left, Right: std_logic_vector) is
...
begin
assert Left'LENGTH = Right'LENGTH report
"ErrorDifferentLengthVectors" severity failure;
...
end "or";