diff --git a/Artix-7-HDMI-processing.xpr b/Artix-7-HDMI-processing.xpr
index 4c354c1..156c674 100644
--- a/Artix-7-HDMI-processing.xpr
+++ b/Artix-7-HDMI-processing.xpr
@@ -42,7 +42,7 @@
-
+
diff --git a/src/top.v b/src/top.v
index e943da8..8f1742c 100644
--- a/src/top.v
+++ b/src/top.v
@@ -182,7 +182,6 @@ wire [11:0] win_w;
wire [11:0] win_h;
wire out_data_en;
wire out_data_valid;
-wire [23:0] out_data;
wire [7:0] matcher_debug;
assign debug = {matcher_debug[3:2], win_blank, win_locked, out_data_en, out_data_valid};
@@ -224,7 +223,7 @@ always @(posedge clk) begin
if (out_data_valid) begin
if (payload_w_idx != PAYLOAD_BUF_SIZE) begin
- payload_buf[payload_w_idx] <= out_data;
+ payload_buf[payload_w_idx] <= {in_red, in_green, in_blue};
payload_w_idx <= payload_w_idx + 1;
end
end
@@ -356,7 +355,6 @@ window_matcher window_matcher_i (
.out_data_en(out_data_en),
.out_data_valid(out_data_valid),
- .out_data(out_data),
.win_red(win_red),
.win_green(win_green),
diff --git a/src/window_matcher.v b/src/window_matcher.v
index 6157979..4bb542b 100644
--- a/src/window_matcher.v
+++ b/src/window_matcher.v
@@ -49,7 +49,6 @@ module window_matcher(
/* Extracted data output */
output reg out_data_en,
output reg out_data_valid,
- output [23:0] out_data,
output [7:0] debug,
output [7:0] match_dbg,
@@ -232,15 +231,14 @@ module window_matcher(
assign win_w_dbg = win_w_int;
assign win_h_dbg = win_h_int;
- localparam ST_MAT_WAITING = 6'b000000,
- ST_MAT_RX0 = 6'b000001,
- ST_MAT_RX1 = 6'b000010,
- ST_MAT_RX2 = 6'b000100,
- ST_MAT_RX3 = 6'b001000,
- ST_MAT_MATCHED = 6'b010000,
- ST_MAT_DATA = 6'b100000;
- reg [5:0] matcher_state;
- wire matched = matcher_state[5];
+ localparam ST_MAT_WAITING = 5'b00000,
+ ST_MAT_RX0 = 5'b00001,
+ ST_MAT_RX1 = 5'b00010,
+ ST_MAT_RX2 = 5'b00100,
+ ST_MAT_RX3 = 5'b01000,
+ ST_MAT_DATA = 5'b10000;
+ reg [4:0] matcher_state;
+ wire matched = matcher_state[4];
reg [11:0] dval_x_reg;
reg [11:0] dval_y_reg;
@@ -288,14 +286,11 @@ module window_matcher(
win_w_int <= in_pxd;
end
ST_MAT_RX3: begin
- matcher_state <= ST_MAT_MATCHED;
- win_h_int <= in_pxd;
- end
- ST_MAT_MATCHED: begin
matcher_state <= ST_MAT_DATA;
+ win_h_int <= in_pxd;
out_data_valid <= 1;
out_data_en <= 1;
- dval_x_reg <= 9;
+ dval_x_reg <= 13;
dval_y_reg <= 0;
end
endcase
@@ -410,8 +405,6 @@ module window_matcher(
reg [23:0] in_pxd_last;
always @(posedge clk) in_pxd_last <= rst ? 0 : in_pxd;
- assign out_data = out_data_en ? in_pxd_last : 0;
-
/* Compositor */
assign out_pxd = (!win_blank && !bypass) ? win_pxd : in_pxd_reg;
endmodule
diff --git a/test_bench/window_matcher_tb.v b/test_bench/window_matcher_tb.v
index b79cd98..4f0d6c6 100644
--- a/test_bench/window_matcher_tb.v
+++ b/test_bench/window_matcher_tb.v
@@ -41,7 +41,6 @@ module window_matcher_tb();
wire out_data_en;
wire out_data_valid;
- wire [23:0] out_data;
localparam period = 4;
@@ -94,7 +93,6 @@ module window_matcher_tb();
.out_data_en(out_data_en),
.out_data_valid(out_data_valid),
- .out_data(out_data),
.win_red(8'haa),
.win_green(8'haa),
diff --git a/test_bench/window_matcher_tb_gen.ipynb b/test_bench/window_matcher_tb_gen.ipynb
index a01ee65..ff72018 100644
--- a/test_bench/window_matcher_tb_gen.ipynb
+++ b/test_bench/window_matcher_tb_gen.ipynb
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
- "id": "antique-bearing",
+ "id": "minor-spank",
"metadata": {},
"source": [
"# Window Matcher Testcase Generator"
@@ -11,7 +11,7 @@
{
"cell_type": "code",
"execution_count": 1,
- "id": "descending-variety",
+ "id": "distinct-smell",
"metadata": {},
"outputs": [],
"source": [
@@ -33,7 +33,7 @@
{
"cell_type": "code",
"execution_count": 2,
- "id": "animated-startup",
+ "id": "preliminary-virus",
"metadata": {},
"outputs": [],
"source": [
@@ -132,18 +132,19 @@
},
{
"cell_type": "code",
- "execution_count": 3,
- "id": "flying-picking",
+ "execution_count": 25,
+ "id": "scheduled-respondent",
"metadata": {},
"outputs": [],
"source": [
- "Image.fromarray(add_window(zero_pixbuf(300, 200), 0, 0, 300, 200)[:,:,:3].astype(np.uint8)).save('test.png')"
+ "#Image.fromarray(add_window(zero_pixbuf(300, 200), 0, 0, 300, 200)[:,:,:3].astype(np.uint8)).save('test.png')\n",
+ "#add_window(zero_pixbuf(300, 200), 0, 0, 300, 200)[:,:,:3].astype(np.uint8)[0,:,:]"
]
},
{
"cell_type": "code",
"execution_count": 4,
- "id": "african-exclusive",
+ "id": "exceptional-ceremony",
"metadata": {},
"outputs": [],
"source": [
@@ -153,7 +154,7 @@
{
"cell_type": "code",
"execution_count": 5,
- "id": "frequent-terminal",
+ "id": "protecting-holly",
"metadata": {},
"outputs": [],
"source": [
@@ -177,7 +178,7 @@
{
"cell_type": "code",
"execution_count": 6,
- "id": "modular-shell",
+ "id": "different-consensus",
"metadata": {},
"outputs": [
{
@@ -247,7 +248,7 @@
{
"cell_type": "code",
"execution_count": 7,
- "id": "narrow-congress",
+ "id": "divided-hopkins",
"metadata": {},
"outputs": [],
"source": [
@@ -268,8 +269,8 @@
},
{
"cell_type": "code",
- "execution_count": 8,
- "id": "comfortable-puppy",
+ "execution_count": 27,
+ "id": "subtle-ending",
"metadata": {},
"outputs": [
{
@@ -327,13 +328,6 @@
" if (!(in_blank || win_w == 0)) $finish;\n",
" if (!(in_blank || win_h == 0)) $finish;\n",
" if (!(!out_data_valid || out_data_en)) $finish;\n",
- " if (read_pos > 1) begin\n",
- " //if (!(out_data_valid == ( win_hsync_exp_last && ~win_header_last))) $finish;\n",
- " if (!(!out_data_valid || out_data == expected_data_last)) begin\n",
- " $display(\"Expected: %h actual: %h\", expected_data_last, out_data);\n",
- " $finish;\n",
- " end\n",
- " end\n",
" \n",
" in_blank = ~{{mem}}[read_pos][{{ FLAG_BLANK }}];\n",
" in_hsync = {{mem}}[read_pos][{{ FLAG_HSYNC }}];\n",
@@ -403,7 +397,7 @@
{
"cell_type": "code",
"execution_count": 9,
- "id": "sized-memphis",
+ "id": "native-council",
"metadata": {},
"outputs": [],
"source": [
@@ -415,7 +409,7 @@
{
"cell_type": "code",
"execution_count": 10,
- "id": "thick-depth",
+ "id": "divine-prince",
"metadata": {},
"outputs": [
{
@@ -438,7 +432,7 @@
{
"cell_type": "code",
"execution_count": 11,
- "id": "adverse-banner",
+ "id": "crazy-watson",
"metadata": {},
"outputs": [
{
@@ -461,7 +455,7 @@
{
"cell_type": "code",
"execution_count": 12,
- "id": "unlike-semester",
+ "id": "musical-physiology",
"metadata": {},
"outputs": [
{
@@ -482,7 +476,7 @@
{
"cell_type": "code",
"execution_count": 13,
- "id": "velvet-grocery",
+ "id": "random-lying",
"metadata": {},
"outputs": [
{
@@ -505,7 +499,7 @@
{
"cell_type": "code",
"execution_count": 14,
- "id": "thick-stake",
+ "id": "falling-arrival",
"metadata": {},
"outputs": [
{
@@ -528,7 +522,7 @@
{
"cell_type": "code",
"execution_count": 16,
- "id": "psychological-variance",
+ "id": "pretty-thumb",
"metadata": {},
"outputs": [],
"source": [
@@ -538,7 +532,7 @@
{
"cell_type": "code",
"execution_count": 17,
- "id": "spread-prize",
+ "id": "found-endorsement",
"metadata": {},
"outputs": [
{
@@ -561,7 +555,7 @@
{
"cell_type": "code",
"execution_count": 18,
- "id": "fitted-blame",
+ "id": "banner-yemen",
"metadata": {},
"outputs": [
{
@@ -599,7 +593,7 @@
{
"cell_type": "code",
"execution_count": 19,
- "id": "peripheral-foundation",
+ "id": "unique-netherlands",
"metadata": {},
"outputs": [
{
@@ -639,7 +633,7 @@
{
"cell_type": "code",
"execution_count": 20,
- "id": "communist-context",
+ "id": "pleasant-perception",
"metadata": {},
"outputs": [
{
@@ -679,7 +673,7 @@
{
"cell_type": "code",
"execution_count": 22,
- "id": "stunning-nothing",
+ "id": "varying-large",
"metadata": {},
"outputs": [
{
diff --git a/window_matcher_tb_behav.wcfg b/window_matcher_tb_behav.wcfg
index 9c054cc..7913cef 100644
--- a/window_matcher_tb_behav.wcfg
+++ b/window_matcher_tb_behav.wcfg
@@ -11,15 +11,15 @@
-
-
+
+
-
+
-
+
clk
clk
@@ -68,6 +68,10 @@
out_green[7:0]
out_green[7:0]
+
+ out_blue[7:0]
+ out_blue[7:0]
+
win_blank
win_blank
@@ -80,10 +84,6 @@
win_locked
win_locked
-
- out_blue[7:0]
- out_blue[7:0]
-
win_blank_exp
win_blank_exp
@@ -100,12 +100,6 @@
#FFA500
true
-
- out_data[23:0]
- out_data[23:0]
- #FFA500
- true
-
in_pxd[23:0]
in_pxd[23:0]
@@ -119,12 +113,12 @@
out_pxd[23:0]
- in_pxd_match[3:0]
- in_pxd_match[3:0]
+ in_pxd_match[7:0]
+ in_pxd_match[7:0]
- in_pxd_match_sr[2:0][3:0]
- in_pxd_match_sr[2:0][3:0]
+ in_pxd_match_sr[6:0][7:0]
+ in_pxd_match_sr[6:0][7:0]
in_pxd_pattern_match
@@ -160,6 +154,16 @@
win_y_int[11:0]
UNSIGNEDDECRADIX
+
+ dval_x_reg[11:0]
+ dval_x_reg[11:0]
+ UNSIGNEDDECRADIX
+
+
+ dval_y_reg[11:0]
+ dval_y_reg[11:0]
+ UNSIGNEDDECRADIX
+
win_w_int[11:0]
win_w_int[11:0]
@@ -186,16 +190,16 @@
UNSIGNEDDECRADIX
- matcher_state[5:0]
- matcher_state[5:0]
+ matcher_state[4:0]
+ matcher_state[4:0]
matched
matched
- scan_x_reg[3:0][11:0]
- scan_x_reg[3:0][11:0]
+ scan_x_reg[7:0][11:0]
+ scan_x_reg[7:0][11:0]
in_hsync_reg