Fix data_valid alignment

This commit is contained in:
jaseg 2021-07-14 18:12:06 +02:00
parent 44ec442958
commit e4613c2145
6 changed files with 63 additions and 76 deletions

View file

@ -42,7 +42,7 @@
<Option Name="IPUserFilesDir" Val="$PIPUSERFILESDIR"/>
<Option Name="IPStaticSourceDir" Val="$PIPUSERFILESDIR/ipstatic"/>
<Option Name="EnableBDX" Val="FALSE"/>
<Option Name="WTXSimLaunchSim" Val="549"/>
<Option Name="WTXSimLaunchSim" Val="560"/>
<Option Name="WTModelSimLaunchSim" Val="0"/>
<Option Name="WTQuestaLaunchSim" Val="0"/>
<Option Name="WTIesLaunchSim" Val="0"/>

View file

@ -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),

View file

@ -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

View file

@ -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),

View file

@ -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": [
{

View file

@ -11,15 +11,15 @@
</db_ref>
</db_ref_list>
<zoom_setting>
<ZoomStartTime time="5694498416fs"></ZoomStartTime>
<ZoomEndTime time="5694759517fs"></ZoomEndTime>
<ZoomStartTime time="5377246000fs"></ZoomStartTime>
<ZoomEndTime time="5758210001fs"></ZoomEndTime>
<Cursor1Time time="5694716000fs"></Cursor1Time>
</zoom_setting>
<column_width_setting>
<NameColumnWidth column_width="175"></NameColumnWidth>
<ValueColumnWidth column_width="162"></ValueColumnWidth>
<ValueColumnWidth column_width="158"></ValueColumnWidth>
</column_width_setting>
<WVObjectSize size="48" />
<WVObjectSize size="49" />
<wvobject fp_name="/window_matcher_tb/window_matcher_i/clk" type="logic">
<obj_property name="ElementShortName">clk</obj_property>
<obj_property name="ObjectShortName">clk</obj_property>
@ -68,6 +68,10 @@
<obj_property name="ElementShortName">out_green[7:0]</obj_property>
<obj_property name="ObjectShortName">out_green[7:0]</obj_property>
</wvobject>
<wvobject fp_name="/window_matcher_tb/window_matcher_i/out_blue" type="array">
<obj_property name="ElementShortName">out_blue[7:0]</obj_property>
<obj_property name="ObjectShortName">out_blue[7:0]</obj_property>
</wvobject>
<wvobject fp_name="/window_matcher_tb/win_blank" type="logic">
<obj_property name="ElementShortName">win_blank</obj_property>
<obj_property name="ObjectShortName">win_blank</obj_property>
@ -80,10 +84,6 @@
<obj_property name="ElementShortName">win_locked</obj_property>
<obj_property name="ObjectShortName">win_locked</obj_property>
</wvobject>
<wvobject fp_name="/window_matcher_tb/window_matcher_i/out_blue" type="array">
<obj_property name="ElementShortName">out_blue[7:0]</obj_property>
<obj_property name="ObjectShortName">out_blue[7:0]</obj_property>
</wvobject>
<wvobject fp_name="/window_matcher_tb/win_blank_exp" type="logic">
<obj_property name="ElementShortName">win_blank_exp</obj_property>
<obj_property name="ObjectShortName">win_blank_exp</obj_property>
@ -100,12 +100,6 @@
<obj_property name="CustomSignalColor">#FFA500</obj_property>
<obj_property name="UseCustomSignalColor">true</obj_property>
</wvobject>
<wvobject fp_name="/window_matcher_tb/window_matcher_i/out_data" type="array">
<obj_property name="ElementShortName">out_data[23:0]</obj_property>
<obj_property name="ObjectShortName">out_data[23:0]</obj_property>
<obj_property name="CustomSignalColor">#FFA500</obj_property>
<obj_property name="UseCustomSignalColor">true</obj_property>
</wvobject>
<wvobject fp_name="/window_matcher_tb/window_matcher_i/in_pxd" type="array">
<obj_property name="ElementShortName">in_pxd[23:0]</obj_property>
<obj_property name="ObjectShortName">in_pxd[23:0]</obj_property>
@ -119,12 +113,12 @@
<obj_property name="ObjectShortName">out_pxd[23:0]</obj_property>
</wvobject>
<wvobject fp_name="/window_matcher_tb/window_matcher_i/in_pxd_match" type="array">
<obj_property name="ElementShortName">in_pxd_match[3:0]</obj_property>
<obj_property name="ObjectShortName">in_pxd_match[3:0]</obj_property>
<obj_property name="ElementShortName">in_pxd_match[7:0]</obj_property>
<obj_property name="ObjectShortName">in_pxd_match[7:0]</obj_property>
</wvobject>
<wvobject fp_name="/window_matcher_tb/window_matcher_i/in_pxd_match_sr" type="array">
<obj_property name="ElementShortName">in_pxd_match_sr[2:0][3:0]</obj_property>
<obj_property name="ObjectShortName">in_pxd_match_sr[2:0][3:0]</obj_property>
<obj_property name="ElementShortName">in_pxd_match_sr[6:0][7:0]</obj_property>
<obj_property name="ObjectShortName">in_pxd_match_sr[6:0][7:0]</obj_property>
</wvobject>
<wvobject fp_name="/window_matcher_tb/window_matcher_i/in_pxd_pattern_match" type="logic">
<obj_property name="ElementShortName">in_pxd_pattern_match</obj_property>
@ -160,6 +154,16 @@
<obj_property name="ObjectShortName">win_y_int[11:0]</obj_property>
<obj_property name="Radix">UNSIGNEDDECRADIX</obj_property>
</wvobject>
<wvobject fp_name="/window_matcher_tb/window_matcher_i/dval_x_reg" type="array">
<obj_property name="ElementShortName">dval_x_reg[11:0]</obj_property>
<obj_property name="ObjectShortName">dval_x_reg[11:0]</obj_property>
<obj_property name="Radix">UNSIGNEDDECRADIX</obj_property>
</wvobject>
<wvobject fp_name="/window_matcher_tb/window_matcher_i/dval_y_reg" type="array">
<obj_property name="ElementShortName">dval_y_reg[11:0]</obj_property>
<obj_property name="ObjectShortName">dval_y_reg[11:0]</obj_property>
<obj_property name="Radix">UNSIGNEDDECRADIX</obj_property>
</wvobject>
<wvobject fp_name="/window_matcher_tb/window_matcher_i/win_w_int" type="array">
<obj_property name="ElementShortName">win_w_int[11:0]</obj_property>
<obj_property name="ObjectShortName">win_w_int[11:0]</obj_property>
@ -186,16 +190,16 @@
<obj_property name="Radix">UNSIGNEDDECRADIX</obj_property>
</wvobject>
<wvobject fp_name="/window_matcher_tb/window_matcher_i/matcher_state" type="array">
<obj_property name="ElementShortName">matcher_state[5:0]</obj_property>
<obj_property name="ObjectShortName">matcher_state[5:0]</obj_property>
<obj_property name="ElementShortName">matcher_state[4:0]</obj_property>
<obj_property name="ObjectShortName">matcher_state[4:0]</obj_property>
</wvobject>
<wvobject fp_name="/window_matcher_tb/window_matcher_i/matched" type="logic">
<obj_property name="ElementShortName">matched</obj_property>
<obj_property name="ObjectShortName">matched</obj_property>
</wvobject>
<wvobject fp_name="/window_matcher_tb/window_matcher_i/scan_x_reg" type="array">
<obj_property name="ElementShortName">scan_x_reg[3:0][11:0]</obj_property>
<obj_property name="ObjectShortName">scan_x_reg[3:0][11:0]</obj_property>
<obj_property name="ElementShortName">scan_x_reg[7:0][11:0]</obj_property>
<obj_property name="ObjectShortName">scan_x_reg[7:0][11:0]</obj_property>
</wvobject>
<wvobject fp_name="/window_matcher_tb/window_matcher_i/in_hsync_reg" type="logic">
<obj_property name="ElementShortName">in_hsync_reg</obj_property>