Synopsys 버전의 패키지 std_logic_arith가없는 동안 srl, ror, sra 등이 포함 된 std_logic_arith 패키지의 Mentor 버전에 의존하는 것처럼 보입니다.
해당 패키지를 사용할 때 두 가지 문제점이 있습니다. 먼저 elsif
이 else
이어야하고 두 번째로 회전 거리가 std_logic (또는 기본 유형 인 std_ulogic)으로 정의 된 ror
이 아닌 구문 오류가 있습니다.
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all; -- Mentor
entity partc_mentor is
generic (constant n: natural := 1);
port (
a: in std_logic_vector(15 downto 0);
s0, s1, cin: in std_logic;
f: out std_logic_vector(15 downto 0)
);
end entity partc_mentor;
architecture ccc of partc_mentor is
begin
f <= std_logic_vector(unsigned(a) srl n) when s1 = '0' and s0 = '0' else
std_logic_vector(unsigned(a) ror n) when s1 = '0' and s0 = '1' else
std_logic_vector(unsigned(a) ror conv_integer(unsigned'("") & cin))
when s1 = '1' and s0 = '0' else
std_logic_vector(unsigned(a) sra n);
end ccc;
그리고 당신의 코드는 다음 분석 :
그 수정. cin
은 널 문자열을 연결하여 부호없는 배열 값으로 승격됩니다. 정규 표현식은 널 (null) 문자열의 유형이 그렇지 않은 경우 쉽게 구별되지 않는 연결 연산자를 구별하는 것입니다.
이것은 IEEE numeric_std 파생 패키지를 사용하여 수행 할 수도 있습니다. 그러나 sra
은 -2008 개정 전에 패키지에서 빠져 나와 Synopsys 패키지 std_logic_arith_unsigned에있는 기능을 제공하기 위해 numeric_std_unsigned 패키지를 도입하고 std_logic_vector 값에 부호없는 산술을 제공합니다. (멘토는 비슷한 패키지를 제공하지 않습니다.)
이
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std_unsigned.all;
entity partc_ieee is
generic (constant n: natural := 1);
port (
a: in std_logic_vector(15 downto 0);
s0, s1, cin: in std_logic;
f: out std_logic_vector(15 downto 0)
);
end entity partc_ieee;
architecture ieee of partc_ieee is
begin
f <= a srl n when s1 = '0' and s0 = '0' else
a ror n when s1 = '0' and s0 = '1' else
a ror to_integer("" & cin) when s1 = '1' and s0 = '0' else
a sra n;
end architecture ieee;
이 코드는 분석하고 numeric_std_unsigned에 정의 된 to_integer 기능에 따라 달라집니다처럼 보일 것이다 IEEE 표준 패키지 -2008 버전을 지원하는 시뮬레이터 또는 합성 분석 도구 (컴파일러)를 사용하여
. 다른 연결 연산자가 std_logic/std_ulogic 값인 올바른 매개 변수로 표시되지 않으면 정규 표현식이 필요하지 않습니다.
오류 메시지가 무엇입니까? – Paebbels
(vcom-1078) "서명되지 않은"식별자는 직접 볼 수 없습니다. 중위 표현식의 표현식 유형을 해결할 수 없습니다. ** 오류 : (vcom-1583) 'unknown'에서 'ieee.std_logic_1164.STD_LOGIC_VECTOR'로의 잘못된 유형 변환 (피연산자 유형을 알 수 없음). –
numeric_std.unsigned를 숨기는 비표준 라이브러리가 너무 많습니다. std_logic_arith 및 std_logic_unsigned를 삭제하십시오. (또한 Else와 Elsif 사이의 약간의 혼란) –