Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated testbench #7

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
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: 1 addition & 1 deletion RunAllTests.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
TestSuite VideoBus
library osvvm_videobus

build ./VideoBus.pro
# build ./VideoBus.pro

# make the bmp_logs directory if it does not exist
set CURR_DIR [pwd]
Expand Down
3 changes: 2 additions & 1 deletion src/VideoBusRx.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
--
-- Revision History:
-- Date Version Description
-- 03/2024 2024.03 Updated SafeResize to use ModelID
-- 08/2023 1.00 Initial revision

library ieee;
Expand Down Expand Up @@ -116,7 +117,7 @@ begin
end if;
-- Put Data into record
RxData := Pop(ReceiveFifo);
TransRec.DataFromModel <= SafeResize(RxData, TransRec.DataFromModel'length);
TransRec.DataFromModel <= SafeResize(ModelID, RxData, TransRec.DataFromModel'length);

Log(ModelID,
"Received: " & to_hxstring(RxData) &
Expand Down
3 changes: 2 additions & 1 deletion src/VideoBusTx.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
--
-- Revision History:
-- Date Version Description
-- 03/2024 2024.03 Updated SafeResize to use ModelID
-- 08/2023 1.00 Initial revision

library ieee;
Expand Down Expand Up @@ -116,7 +117,7 @@ begin
case operation is
-- Model Transaction Dispatch
when SEND =>
TxData := SafeResize(TransRec.DataToModel, TxData'length);
TxData := SafeResize(ModelID, TransRec.DataToModel, TxData'length);
Push(TransmitFifo, TxData);
Log(ModelID,
"SEND Queueing Transaction: " & to_hxstring(TxData) &
Expand Down
4 changes: 2 additions & 2 deletions src/bmp_pack.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ begin
end if;
end loop;
-- Fill missing pixels with red color
for i in 1 to (VIDEO_WIDTH - pixelCount) loop
for pixelRedIndex in 1 to (VIDEO_WIDTH - pixelCount) loop
pixel := 24X"FF0000";
PutPixel(pic_file, pixel);
end loop;
Expand All @@ -524,7 +524,7 @@ begin
end loop;
-- Fill missing pixels with red color
for j in 1 to (VIDEO_HEIGHT - lineCount) loop
for i in 1 to VIDEO_WIDTH loop
for videoWidthIndex in 1 to VIDEO_WIDTH loop
pixel := 24X"FF0000";
PutPixel(pic_file, pixel);
end loop;
Expand Down
9 changes: 5 additions & 4 deletions testbench/TbVideoBus.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
--
-- Revision History:
-- Date Version Description
-- 07/2024 2024.07 Updated calls to CreateClock and CreateReset
-- 08/2023 1.00 Initial revision
--

Expand Down Expand Up @@ -99,14 +100,14 @@ architecture TestHarness of TbVideoBus is
);
end component;
begin
-- create Clock
Osvvm.TbUtilPkg.CreateClock (
-- create Clock (from OSVVM Library)
CreateClock (
Clk => Clk,
Period => Tperiod_Clk
);

-- create nReset
Osvvm.TbUtilPkg.CreateReset (
-- create nReset (from OSVVM Library)
CreateReset (
Reset => nReset,
ResetActive => '0',
Clk => Clk,
Expand Down
6 changes: 3 additions & 3 deletions testbench/TbVideoBus_SendGet.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ begin
for i in 1 to VIDEO_HEIGHT loop
for j in 1 to VIDEO_WIDTH loop
TxData := RV.RandSlv(24);
Send(VideoBusTxTransRec, TxData);
Push(TransmitFifo, TxData);
Send(VideoBusTxTransRec, TxData);
end loop;
end loop;

GetTransactionCount(VideoBusTxTransRec, TransactionCount);
AffirmIfEqual(ManagerId, TransactionCount, 4 * VIDEO_HEIGHT * VIDEO_WIDTH, "Transaction Count");

WaitForBarrier(sync1);
-- WaitForBarrier(sync1);

-- End of test
WaitForBarrier(TestDone);
Expand All @@ -131,7 +131,7 @@ begin
ManagerId := NewID("VideoBusReceiver", TbID);
SetLogEnable(PASSED, FALSE); -- Disable PASSED logs

WaitForBarrier(sync1);
-- WaitForBarrier(sync1);

-- Receive red frame
for i in 1 to VIDEO_HEIGHT loop
Expand Down