Skip to content

Commit

Permalink
Add diagnostic on values that cannot be cast to int
Browse files Browse the repository at this point in the history
  • Loading branch information
FavoritoHJS committed Aug 27, 2024
1 parent 03503e2 commit e8933d2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
16 changes: 8 additions & 8 deletions src/project.v
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ module tt_um_favoritohjs_scroller (
.rst_n(rst_n),
.vsync(vsync),
.scanline(vcount),
.START_HEIGHT(116),
.LOOP_LENGTH(16),
.START_HEIGHT(10'd116),
.LOOP_LENGTH(5'd16),
.val(cutoff1),
.border(vborder1));

Expand All @@ -94,8 +94,8 @@ module tt_um_favoritohjs_scroller (
.rst_n(rst_n),
.vsync(vsync),
.scanline(vcount),
.START_HEIGHT(184),
.LOOP_LENGTH(8),
.START_HEIGHT(10'd184),
.LOOP_LENGTH(5'd8),
.val(cutoff2),
.border(vborder2));

Expand Down Expand Up @@ -175,7 +175,7 @@ module tt_um_favoritohjs_scroller (
//how it needs to be inlined with the main block to prevent
//conflicting drivers
if (visible) begin
if (l1 < cutoff1) begin
if ({1'b0, l1} < cutoff1) begin
if (border1) begin
rd <= 3'b011;
gd <= 3'b011;
Expand All @@ -185,7 +185,7 @@ module tt_um_favoritohjs_scroller (
gd <= 3'b110;
bd <= 3'b101;
end
end else if (l2 < cutoff2) begin
end else if ({1'b0, l2} < cutoff2) begin
if (border2) begin
rd <= 3'b010;
gd <= 3'b010;
Expand Down Expand Up @@ -224,7 +224,7 @@ module vertical_scheudler(
output wire border
);
reg started;
reg [3:0] blockline;
reg [4:0] blockline;
reg [4:0] blockval;
reg borderreg;
assign val = blockval;
Expand All @@ -237,7 +237,7 @@ module vertical_scheudler(
borderreg <= 1'b0;
end else begin
if (scanline == START_HEIGHT) begin
started <= 1;
started <= 1'b1;
end
if (started) begin
if (blockline == 0) begin
Expand Down
8 changes: 6 additions & 2 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async def test_project(dut):
dut.ui_in.value = 0
dut.uio_in.value = 0
dut.rst_n.value = 0
await ClockCycles(dut.clk, 100)
await ClockCycles(dut.clk, 10)
dut.rst_n.value = 1

dut._log.info("Test project behavior")
Expand All @@ -34,7 +34,11 @@ async def test_project(dut):
row = []
for j in range(800):
await ClockCycles(dut.clk, 1)
data = int(dut.uo_out)
try:
data = int(dut.uo_out)
except Exception:
dut._log.info(dut.uo_out.value)
raise
row.append(data)
frame.append(row)
if use_pillow:
Expand Down

0 comments on commit e8933d2

Please sign in to comment.