다음 코드에서 플레이어 1과 플레이어 2 버튼의 기록을 저장하려고합니다. 코드는 오류없이 컴파일되지만 경고가 있습니다. 나는이 경고를 풀 수 없다. 여기에 코드를 게시하고 있습니다.Xilinx에서 예기치 않은 경고가 발생했습니다.
module game(clk50,red,green,blue,hsync,vsync, button,led);
input [8:0] button;
input clk50;
output red;
output green;
output blue,led;
output hsync;
output vsync;
// divide input clock by two, and use a global
// clock buffer for the derived clock
reg clk25_int;
always @(posedge clk50) begin
clk25_int <= ~clk25_int;
end
wire clk25;
BUFG bufg_inst(clk25, clk25_int);
wire [9:0] xpos;
wire [9:0] ypos;
Grid_Display Grid_Displayinst(clk25,xpos, ypos, red, green, blue, button,led);
endmodule
module Grid_Display(clk25,xpos,ypos,red,green,blue, button,led);
input clk25;
input [9:0] xpos;//responsible for current pixel display location
input [9:0] ypos;// responsible for current display row
input [8:0] button;
//spartan 3 kit has 3-bits per pixel, so 2^3 means 8 colours can be selected.
output red; // colour 1
output green; // colour 2
output blue; // colur 3
output led;
//reg tempRed,tempGreen,tempBlue, GridRed,GridGreen,GridBlue;
reg player1,player2;
reg [8:0] player1History=0,player2History=0;
wire grid = ((xpos >= 4 && xpos <= 799 && ypos >= 160 && ypos <= 165) ||
(xpos >= 4 && xpos <= 790 && ypos >= 310 && ypos <= 315) ||
(xpos >= 200 && xpos <= 205 && ypos >= 0 && ypos <= 520) ||
(xpos >= 440 && xpos <= 445 && ypos >= 0 && ypos <= 520));
always @(posedge clk25)
begin
player1History= button^player2History;
player2History= button^player1History;
player1 = ((player1History[0] && (xpos >=50 && xpos<=150 && ypos >= 20 && ypos <=120)) || (player1History[1] && (xpos >=250 && xpos<=350 && ypos >= 20 && ypos <=120))
|| (player1History[2] && (xpos >=490 && xpos<=590 && ypos >= 20 && ypos <=120)) || (player1History[3] && (xpos >=50 && xpos<=150 && ypos >= 180 && ypos <=280))
|| (player1History[4] && (xpos >=250 && xpos<=350 && ypos >= 180 && ypos <=280)) || (player1History[5] && (xpos >=490 && xpos<=590 && ypos >= 180 && ypos <=280))
|| (player1History[6] && (xpos >=50 && xpos<=150 && ypos >= 330 && ypos <=430)) || (player1History[7] && (xpos >=250 && xpos<=350 && ypos >= 330 && ypos <=430))
|| (player1History[8] && (xpos >=490 && xpos<=590 && ypos >= 330 && ypos <=430)));
player2 = ((player2History[0] && (xpos >=50 && xpos<=150 && ypos >= 20 && ypos <=120)) || (player2History[1] && (xpos >=250 && xpos<=350 && ypos >= 20 && ypos <=120))
|| (player2History[2] && (xpos >=490 && xpos<=590 && ypos >= 20 && ypos <=120)) || (player2History[3] && (xpos >=50 && xpos<=150 && ypos >= 180 && ypos <=280))
|| (player2History[4] && (xpos >=250 && xpos<=350 && ypos >= 180 && ypos <=280)) || (player2History[5] && (xpos >=490 && xpos<=590 && ypos >= 180 && ypos <=280))
|| (player2History[6] && (xpos >=50 && xpos<=150 && ypos >= 330 && ypos <=430)) || (player2History[7] && (xpos >=250 && xpos<=350 && ypos >= 330 && ypos <=430))
|| (player2History[8] && (xpos >=490 && xpos<=590 && ypos >= 330 && ypos <=430)));
end
assign red = (grid || player1);
assign green = (grid || player2);
assign blue = (grid);
endmodule
어떻게 이러한 경고를 해결할 수 있습니까? FF/래치가 player2History은 항상 0이며, 같은 그것을 밖으로 최적화되고 있다는 문제로 귀결 기본적으로 트리밍에 대한
WARNING:Xst:2211 - "grid.v" line 104: Instantiating black box module <dummyModule>.
WARNING:Xst:1710 - FF/Latch <player2> (without init value) has a constant value of 0 in block <Grid_Display>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <player2History_0> has a constant value of 0 in block <Grid_Display>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <player2History_1> has a constant value of 0 in block <Grid_Display>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <player2History_2> has a constant value of 0 in block <Grid_Display>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <player2History_3> has a constant value of 0 in block <Grid_Display>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <player2History_4> has a constant value of 0 in block <Grid_Display>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <player2History_5> has a constant value of 0 in block <Grid_Display>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <player2History_6> has a constant value of 0 in block <Grid_Display>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <player2History_7> has a constant value of 0 in block <Grid_Display>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <player2History_8> has a constant value of 0 in block <Grid_Display>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:2036 - Inserting OBUF on port <led> driven by black box <dummyModule>. Possible simulation mismatch.
안부
-1 엄청난 양의 코드와 컴파일러 출력물을 우리에게 공정하게 보여주지 않으면 서. 문제를 재현하는 가장 작은 예제로 질문의 범위를 좁혀주십시오. VETSMOD가 되십시오. – Philippe