Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions VideoBus.pro
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ analyze ./src/VideoBusRx_pkg.vhd
analyze ./src/VideoBusRx.vhd
analyze ./src/VideoBusTx_pkg.vhd
analyze ./src/VideoBusTx.vhd
analyze ./src/VideoBusPkg.vhd

analyze ./src/PassthroughDUT_pkg.vhd
analyze ./src/PassthroughDUT.vhd

analyze ./src/bmp_pack_pkg.vhd
analyze ./src/bmp_pack.vhd

analyze ./src/VideoBusContext.vhd
1 change: 1 addition & 0 deletions src/VideoBusContext.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ context VideoBusContext is
use osvvm_videobus.bmplibpack.all;
use osvvm_videobus.VideoBusRxPkg.all;
use osvvm_videobus.VideoBusTxPkg.all;
use osvvm_videobus.VideoBusPkg.all;

end context VideoBusContext;
30 changes: 30 additions & 0 deletions src/VideoBusPkg.vhd
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
--
-- File Name: VideoBusPkg.vhd
--
-- Maintainer: Louis Adriaens email: louisadriaens@outlook.com
-- Contributor(s):
-- Louis Adriaens louisadriaens@outlook.com
--
--
-- Description:
-- Package for VideoBus receiver Verification Component
-- Based on OSVVM Framework
--
--
--
-- Revision History:
-- Date Version Description
-- 08/2023 1.00 Initial revision
--

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.numeric_std_unsigned.all;
use ieee.math_real.all;

package VideoBusPkg is

type VideoDataArray is array (natural range <>) of std_logic_vector;

end VideoBusPkg;
12 changes: 6 additions & 6 deletions src/VideoBusRx.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -171,44 +171,44 @@ begin
wait for 0 ns; -- Allow ModelID to become valid
SetLogEnable(ModelID, PASSED, false); -- don't log passed affirmations

wait until rising_edge(vid_fval_in);
wait on Clk until rising_edge(Clk) and vid_fval_in = '1' ;
Log(ModelID, "New frame started in VideoBusRx!", INFO);
pixelCount := 0;
lineCount := 0;
while (vid_fval_in = '1') loop
wait until rising_edge(Clk);
if (vid_lval_in = '1') then
pixelCount := 0;
while (vid_lval_in = '1') loop
wait until rising_edge(Clk);
if (vid_dval_in = '1') then
for dataStream in 0 to NUM_DATA_STREAMS-1 loop
RxData := vid_data_in(dataStream);
Push(ReceiveFifo, RxData);
Increment(ReceiveCount);
pixelCount := pixelCount + 1;
end loop;
ReceiveCount <= ReceiveCount + NUM_DATA_STREAMS; -- accumulate values just pushed
end if;
wait until rising_edge(Clk);
end loop;
AffirmIf(ModelID, (pixelCount = VIDEO_WIDTH), "pixelCount: " & to_string(pixelCount) & " /= VIDEO_WIDTH: " & to_string(VIDEO_WIDTH));
-- Fill missing pixels
for i in 1 to (VIDEO_WIDTH - pixelCount) loop
RxData := (others => 'U');
Push(ReceiveFifo, RxData);
Increment(ReceiveCount);
end loop;
ReceiveCount <= ReceiveCount + (VIDEO_WIDTH - pixelCount); -- accumulate values just pushed
lineCount := lineCount + 1;
end if;
wait until rising_edge(Clk);
end loop;
AffirmIf(ModelID, (lineCount = VIDEO_HEIGHT), "lineCount: " & to_string(lineCount) & " /= VIDEO_HEIGHT: " & to_string(VIDEO_HEIGHT));
-- Fill missing pixels
for j in 1 to (VIDEO_HEIGHT - lineCount) loop
for i in 1 to VIDEO_WIDTH loop
RxData := (others => 'U');
Push(ReceiveFifo, RxData);
Increment(ReceiveCount);
end loop;
end loop;
ReceiveCount <= ReceiveCount + VIDEO_WIDTH*(VIDEO_HEIGHT - lineCount); -- accumulate values just pushed
end process VideoBusHandler;

end architecture SimpleBlockingReceive;
4 changes: 3 additions & 1 deletion src/VideoBusRx_pkg.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ library osvvm;
library osvvm_common;
context osvvm_common.OsvvmCommonContext;

library work;
use work.VideoBusPkg.all;

package VideoBusRxPkg is

type VideoDataArray is array (natural range <>) of std_logic_vector;

----------------------------------------
component VideoBusRx is
Expand Down
4 changes: 3 additions & 1 deletion src/VideoBusTx_pkg.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ library osvvm;
library osvvm_common;
context osvvm_common.OsvvmCommonContext;

library work;
use work.VideoBusPkg.all;

package VideoBusTxPkg is

type VideoBusOptionsType is (
Expand All @@ -42,7 +45,6 @@ package VideoBusTxPkg is
OPTIONS_MARKER
);

type VideoDataArray is array (natural range <>) of std_logic_vector;

procedure GetVideoBusParameter(variable Params : inout ModelParametersPType; Operation : in VideoBusOptionsType; OutValue : out integer);

Expand Down
Loading