Synopsysのstd_logic_arithパッケージのバージョンではなく、srl、ror、sraなどを含むstd_logic_arithパッケージのメンター・バージョンに依存しているようです。
このパッケージを使用する際には2つの問題があります。最初に、elsif
の文字列がelse
である構文エラーがあります.2番目に、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文字列を連結することによって符号なし配列値に昇格されることに注意してください。修飾された式は、null文字列の型がそうでなければ容易には見えない連結演算子を区別することである。
これは、IEEE numeric_std由来パッケージを使用して行うこともできます。しかしsra
は-2008リビジョンの前にパッケージから抜け出しました。これはまた、Synopsysパッケージのstd_logic_arith_unsignedにある機能を提供するためにnumeric_std_unsignedパッケージを導入し、std_logic_vector値に符号なし算術を提供します。 (メンターは同等のパッケージを提供していません)。このコードはまた、分析し、numeric_std_unsignedで定義されたto_integer機能に依存
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;
:IEEEの標準パッケージの-2008のバージョンは次のようになりサポートするシミュレータまたは合成分析ツール(コンパイラ)を使用して
。 std_logic/std_ulogicの値である右のパラメータで他の連結演算子を表示することはできません。修飾された式は必要ありません。
エラーメッセージは何ですか? – Paebbels
(vcom-1078)識別子「署名なし」は直接表示されません。 中置式の式の型を解決できません。 **エラー:(vcom-1583)「不明」から「ieee.std_logic_1164.STD_LOGIC_VECTOR」への不正なタイプ変換(オペランドタイプは不明です)。 –
numeric_std.unsignedを隠している非標準ライブラリが多すぎます。 std_logic_arithおよびstd_logic_unsignedを削除します。 (また、ElseとElsifの間のいくつかの混乱) –