現在、VGA経由でビデオデータを送信するデバイスの場合、VHDLで画面バッファを作成しようとしています。私はザイリンクスISE 13.1を使用しています。私はVHDLの初心者です。合成中にクラッシュするvhdlの画面バッファ
私の考えは、各ピクセル(8ビット)のRGB値を含む大きな二次元配列を作成することでした。
私は問題なく配列に書き込むことができますが、読んでみるとさらに複雑になります。合成が非常に長くなり、コンピュータがシャットダウンするまでメモリが完全に飽和します。ここで
はちょうど赤45度線を引くしようとしている、私のコードの簡易版である:entity Pilotage_ecran is
port(clk25 : in std_logic; --25MHz clock
red_out : out std_logic; --Untill the problem is solved, i use only 1 bit to set colors
green_out : out std_logic;
blue_out : out std_logic;
hs_out : out std_logic;
vs_out : out std_logic);
end Pilotage_ecran;
architecture Behavioral of Pilotage_ecran is
signal horizontal_counter : std_logic_vector (9 downto 0);
signal vertical_counter : std_logic_vector (9 downto 0);
signal drawing : std_logic; --Signal that is set to 1 when the active video area is reached
signal busy : std_logic; --Signal to avoid launching the drawing process twice in parallel
--The array (actually containing single bits instead of vectors untill I solve the problem)
type TAB_BUFFER is array(0 to 1023, 0 to 1023) of std_logic;
signal Ecran : TAB_BUFFER := (others=>'0');
begin
メインプロセス:
process (clk25)
variable coordX : integer;
variable coordY : integer;
begin
if clk25'event and clk25 = '1' then
if (horizontal_counter >= "0010010000") -- 144 : limits of active video area
and (horizontal_counter < "1100010000") -- 784
and (vertical_counter >= "0000100111") -- 39
and (vertical_counter < "1100010000") -- 519
then
drawing <= '1';
coordX := conv_integer (horizontal_counter);
coordY := conv_integer (vertical_counter);
if Ecran(coordX,coordY) = '1' then --Here is the problem
red_out <= '1';
green_out <= '0';
blue_out <= '0';
else
red_out <= '0';
green_out <= '0';
blue_out <= '0';
end if;
else
drawing <= '0';
end if;
--Hsync and Vsync come after, but the code is safe and tested
end if;
end process;
描画処理(実際には醜いで線を引きます私はちょうどバッファに何かを得たいと思っていた)。その後、
Ecran(coordX、coordY)= '1' の場合
:draw : process (drawing, clk25, busy) --Coordinates of the starting point (actually random values...) variable i : integer; variable j : integer; begin if (drawing = '1') and clk25 = '1' and busy = '0' then busy <= '1'; i :=300; j :=300; --The loop setting the coordinates of the line to '1' loopx : while (i<=350) loop Ecran(i,j) <= '1'; i := i+1; j := j+1; end loop loopx; busy <='0'; end if; end process draw; end Behavioral;
私にトラブルを起こしラインiがバッファ内にいくつかの座標に値にアクセスしようとするものです
私はまた、このように実行しようとしました:< = Ecran(coordX、coordY)red_out
。
iは整数値でcoordXまたはcoordYのいずれかを交換する場合、それは(表示doesntのは、バッファに一致するが、それは動作します)正常に動作しますが、私はそれらの両方のための変数を使用する場合には、合成時にクラッシュします。私はかなりいくつかの作業コードに一致するように見えても、私は配列(私はちょうどそれらを使用する方法を学んだ)に何か間違っていたと確信しています。私はまた、(おそらく)大きすぎる配列を使用している可能性があります。
誰かが私が何をやったのか、またはvhdlでスクリーンバッファを作成する方法についてもっと良い方法があれば、どんな助けでも大歓迎です。
ありがとうございます。
ありがとうございます。これは私の最初の問題を解決しませんでしたが、それは私のプロセスとvhdlの理解を向上させるのに多大な助けとなりました。最後のパラグラフでは、描画プロセスは各ピクセルの値をバッファに保存しますが、メインプロセスはバッファ内の各ピクセルのRGB値を読み込み、VGAケーブルに送信してから次のピクセルに移動します。 –
最初の問題は、このコードを合成できないということですか?私はあなたが完全に無駄な箱にいない限り、配列のサイズは問題であるとは思わない。あなたの配列は128kbのメモリに相当します。これはいくつかのFPGAでは不可能かもしれませんが、あなたが1つを使用しているような音ではありません。あなたはそれが本当に合成不可能なものではないと確信していますか?物事が停止する前にエラーメッセージが出ますか? –
私はFPGA(スパルタン開発ボード)を使用して、入来データをビデオ信号に変換するので、メモリが問題になります。エラー/警告は表示されず、このログの後に合成がHDL分析に貼り付けられます。 ライブラリのエンティティの解析(アーキテクチャ)。 –