hamidkavianathar
Member level 5
Hi guys
I am working on a project with fpga (spartan 6 xc6slx9 tqg144). my input is parallel video stream. it consist of 8 bits data and a 27 MHz clock signal. I want to store 4 frames of video and then read it with another 27 MHz clock signal. it is shown in below image.
as these clocks are not the same clock sometimes I should read a frame twice and some times I should overwrite a frame. my problem is that the output image has a lot of jitter.
although my is design is very small and it does not span a lot of fpga resource, it does not work properly. for example when I add chipscope to my design it shows some unrelated data. I am totally confused. I don't know what I am missing. could anyone tell me what I should do?
thanks.
here is my ucf file and verilog code.
the top.v file:
and this my ucf file:
I apologize for my bad English.
I am working on a project with fpga (spartan 6 xc6slx9 tqg144). my input is parallel video stream. it consist of 8 bits data and a 27 MHz clock signal. I want to store 4 frames of video and then read it with another 27 MHz clock signal. it is shown in below image.
as these clocks are not the same clock sometimes I should read a frame twice and some times I should overwrite a frame. my problem is that the output image has a lot of jitter.
although my is design is very small and it does not span a lot of fpga resource, it does not work properly. for example when I add chipscope to my design it shows some unrelated data. I am totally confused. I don't know what I am missing. could anyone tell me what I should do?
thanks.
here is my ucf file and verilog code.
the top.v file:
Code:
`timescale 1ns / 1ps
`default_nettype none
module top(
output wire [7:0] data_out_sdi,
output wire clk_out_sdi,
input wire [7:0] data_in_sdi_c,
input wire clk_in_sdi_in,
input wire clk_in,
//output wire [3:0] led,
input wire reset, // active low
// SDRAM
output wire SDRAM_CLK,
output wire SDRAM_CKE,
output wire SDRAM_WEn,
output wire SDRAM_CASn,
output wire SDRAM_RASn,
output wire SDRAM_CSn,
output wire [12:0] SDRAM_A,
output wire [1:0] SDRAM_BA,
output wire [1:0] SDRAM_DQM,
inout wire [15:0] SDRAM_DQ);
localparam [2:0] idle = 3'h4;
localparam [2:0] write = 3'h1;
localparam [2:0] read = 3'h2;
localparam [2:0] write_into_memory = 3'h3;
localparam [2:0] wait_for_fifo_in = 3'h0;
localparam [2:0] write_1 = 3'h5;
localparam [2:0] read_1 = 3'h6;
localparam state_wait_for_trs = 0;
localparam state_trs_found = 1;
reg RdReq;
wire WrGnt;
wire RdGnt;
wire RdDataValid;
reg WrReq;
wire clk_140;
wire clk_140_inv;
reg next_state_top;
reg current_state_top;
reg [2:0] next_state_controller;
reg [2:0] current_state_controller;
reg reset_active_high;
reg reset_active_high1;
reg reset_27_meg1;
reg reset_27_meg2;
wire start_of_frame_detected;
reg [7:0] data_in_sdi_r1;
reg [7:0] data_in_sdi_r2;
reg [7:0] data_in_sdi_r3;
reg [7:0] data_in_sdi_r4;
reg [7:0] data_in_sdi_r5;
reg [7:0] data_in_sdi_r6;
wire [15:0] dout_fifo_in;
wire wr_en_fifo_in;
reg rd_en_fifo_in;
wire valid_fifo_in;
wire prog_empty_fifo_in;
wire [15:0] RdData;
wire clk_in_sdi;
reg [15:0] dout_fifo_in_reg;
reg [6:0] count_read;
reg [6:0] count_write;
wire valid;
wire clk_27_out;
wire full_fif0o_out;
wire empty_fifo_out;
wire [7:0] dout_fifo_out;
wire clk_27_out_inv;
wire prog_full_fifo_out;
reg rst_count_read;
reg rst_count_write;
reg [24:0] read_address_0;
reg [24:0] write_address_0;
wire [24:0] write_address;
wire [24:0] read_address;
wire frame_write_finished;
wire [24:0] address_start_read;
wire [24:0] address_start_write;
reg [1:0] frame_select_rd;
reg [1:0] frame_select_wr;
wire frame_read_finished;
//reg en_write_address;
reg rst_write_address;
//reg en_read_address;
reg rst_read_address;
ODDR2 #(
.DDR_ALIGNMENT("NONE"), // Sets output alignment to "NONE", "C0" or "C1"
.INIT(1'b0), // Sets initial state of the Q output to 1'b0 or 1'b1
.SRTYPE("ASYNC") // Specifies "SYNC" or "ASYNC" set/reset
) clk_out_27 (
.Q(clk_out_sdi), // 1-bit DDR output data
.C0(clk_27_out), // 1-bit clock input
.C1(clk_27_out_inv), // 1-bit clock input
.CE(1'b1), // 1-bit clock enable input
.D0(1'b0), // 1-bit data input (associated with C0)
.D1(1'b1), // 1-bit data input (associated with C1)
.R(1'b0), // 1-bit reset input
.S(1'b0) // 1-bit set input
);
ODDR2 #(
.DDR_ALIGNMENT("NONE"), // Sets output alignment to "NONE", "C0" or "C1"
.INIT(1'b0), // Sets initial state of the Q output to 1'b0 or 1'b1
.SRTYPE("SYNC") // Specifies "SYNC" or "ASYNC" set/reset
) memory_105 (
.Q(SDRAM_CLK), // 1-bit DDR output data
.C0(clk_140), // 1-bit clock input
.C1(clk_140_inv), // 1-bit clock input
.CE(1'b1), // 1-bit clock enable input
.D0(1'b0), // 1-bit data input (associated with C0)
.D1(1'b1), // 1-bit data input (associated with C1)
.R(1'b0), // 1-bit reset input
.S(1'b0) // 1-bit set input
);
SDRAM_ctrl sdram_controller(
.clk(clk_140),
.RdReq(RdReq),
.RdGnt(RdGnt),
.RdAddr(read_address_0),
.RdData(RdData),
.RdDataValid(RdDataValid),
.WrReq(WrReq),
.WrGnt(WrGnt),
.WrAddr(write_address_0),
.WrData(dout_fifo_in),
.SDRAM_CKE(SDRAM_CKE),
.SDRAM_WEn(SDRAM_WEn),
.SDRAM_CASn(SDRAM_CASn),
.SDRAM_RASn(SDRAM_RASn),
.SDRAM_CSn(SDRAM_CSn),
.SDRAM_A(SDRAM_A),
.SDRAM_BA(SDRAM_BA),
.SDRAM_DQM(SDRAM_DQM),
.SDRAM_DQ(SDRAM_DQ)
);
fifo_in fifo_i (
.rst(reset_active_high), // input rst
.wr_clk(clk_in_sdi), // input wr_clk
.rd_clk(clk_140), // input rd_clk
.din(data_in_sdi_r6), // input [7 : 0] din
.wr_en(wr_en_fifo_in), // input wr_en
.rd_en(rd_en_fifo_in), // input rd_en
.dout(dout_fifo_in), // output [15 : 0] dout
.full(), // output full
.empty(), // output empty
.valid(valid_fifo_in), // output valid
.prog_empty(prog_empty_fifo_in) // output prog_empty
);
wire valid_fifo_out;
fifo_o fifo_out (
.rst(reset_active_high), // input rst
// .rst(reset_active_high), // input rst
.wr_clk(clk_140), // input wr_clk
.rd_clk(clk_27_out), // input rd_clk
.din(RdData), // input [15 : 0] din
.wr_en(RdDataValid), // input wr_en
.rd_en(1'b1), // input rd_en
.dout(dout_fifo_out), // output [7 : 0] dout
.full(), // output full
.empty(), // output empty
.valid(valid_fifo_out), // output valid
.prog_full(prog_full_fifo_out) // output prog_full
);
trs_detector start_of_frame_detector (
.clk(clk_in_sdi),
.rst(reset_27_meg2),
.data_in(data_in_sdi_r1),
.start_of_frame_detected(start_of_frame_detected)
);
dcm clock_wizard(// Clock in ports
.CLK_IN1(clk_in), // IN
// Clock out ports
.CLK_OUT1(clk_140), // OUT
.CLK_OUT2(clk_140_inv), // OUT
.CLK_OUT3(clk_27_out), // OUT
.CLK_OUT4(clk_27_out_inv)); // OUT
//assign clk_in_sdi = clk_in_sdi_in;
dcm2 clock_wizard2(// Clock in ports
.CLK_IN1(clk_in_sdi_in), // IN
// Clock out ports
.CLK_OUT1(clk_in_sdi)); // OUT
assign data_out_sdi = dout_fifo_out;
always @( posedge clk_140) begin
reset_active_high1 <= reset;
reset_active_high <= reset_active_high1;
end
always @( posedge clk_in_sdi) begin
reset_27_meg1 <= reset_active_high;
reset_27_meg2 <= reset_27_meg1;
end
always @( posedge clk_in_sdi) begin
data_in_sdi_r1 <= data_in_sdi_c;
data_in_sdi_r2 <= data_in_sdi_r1;
data_in_sdi_r3 <= data_in_sdi_r2;
data_in_sdi_r4 <= data_in_sdi_r3;
data_in_sdi_r5 <= data_in_sdi_r4;
data_in_sdi_r6 <= data_in_sdi_r5;
end
always @( posedge clk_in_sdi) begin
if (reset_27_meg2 == 1'b1)
current_state_top <= state_wait_for_trs;
else
current_state_top <= next_state_top;
end
always @* begin
case (current_state_top)
state_wait_for_trs: begin
if (start_of_frame_detected == 1'b1)
next_state_top = state_trs_found;
else
next_state_top = state_wait_for_trs;
end
state_trs_found:
next_state_top = state_trs_found;
endcase
end
assign wr_en_fifo_in = (current_state_top == state_trs_found) ? 1'b1: 1'b0;
assign address_start_read = ((frame_select_rd == 2'b00) ? 25'h0000000:
((frame_select_rd == 2'b01) ? 25'h0800000:
((frame_select_rd == 2'b10) ? 25'h1000000:
((frame_select_rd == 2'b10) ? 25'h1800000: 25'h1800000))));
assign address_start_write = ((frame_select_wr == 2'b00) ? 25'h0000000:
((frame_select_wr == 2'b01) ? 25'h0800000:
((frame_select_wr == 2'b10) ? 25'h1000000:
((frame_select_wr == 2'b10) ? 25'h1800000: 25'h1800000))));
always @( posedge clk_140) begin
if ((reset_active_high == 1'b1) || (rst_read_address == 1'b1))
read_address_0 <= 0;
else if (RdGnt == 1'b1)
read_address_0 <= read_address_0 + 1'b1;
else
read_address_0 <= read_address_0;
end
assign read_address = read_address_0 + address_start_read;
assign frame_read_finished = (read_address_0 == 25'h0107ABE) ? 1'b1: 1'b0;
always @( posedge clk_140) begin
if ((reset_active_high == 1'b1) || (rst_write_address == 1'b1))
write_address_0 <= 0;
else if (valid_fifo_in == 1'b1)
write_address_0 <= write_address_0 + 1'b1;
else
write_address_0 <= write_address_0;
end
assign write_address = write_address_0 + address_start_write;
assign frame_write_finished = (write_address_0 == 25'h0107ABE) ? 1'b1: 1'b0;
always @( posedge clk_140) begin
if (reset_active_high == 1'b1) begin
frame_select_rd <= 2'h2;
rst_read_address <= 1'b1;
end
else if (frame_read_finished == 1'b1) begin
rst_read_address <= 1'b1;
if ((frame_select_wr == 2'h0) && (frame_select_rd == 2'h0)) begin
frame_select_rd <= 2'h0; //don't care
end
else if ((frame_select_wr == 2'h0) && (frame_select_rd == 2'h1)) begin
frame_select_rd <= 2'h2;
end
else if ((frame_select_wr == 2'h0) && (frame_select_rd == 2'h2)) begin
frame_select_rd <= 2'h3;
end
else if ((frame_select_wr == 2'h0) && (frame_select_rd == 2'h3)) begin
frame_select_rd <= 2'h3;
end
else if ((frame_select_wr == 2'h1) && (frame_select_rd == 2'h0)) begin
frame_select_rd <= 2'h0;
end
else if ((frame_select_wr == 2'h1) && (frame_select_rd == 2'h1)) begin
frame_select_rd <= 2'h1; //don't care
end
else if ((frame_select_wr == 2'h1) && (frame_select_rd == 2'h2)) begin
frame_select_rd <= 2'h3;
end
else if ((frame_select_wr == 2'h1) && (frame_select_rd == 2'h3)) begin
frame_select_rd <= 2'h0;
end
else if ((frame_select_wr == 2'h2) && (frame_select_rd == 2'h0)) begin
frame_select_rd <= 2'h1;
end
else if ((frame_select_wr == 2'h2) && (frame_select_rd == 2'h1)) begin
frame_select_rd <= 2'h1;
end
else if ((frame_select_wr == 2'h2) && (frame_select_rd == 2'h2)) begin
frame_select_rd <= 2'h2; //don't care
end
else if ((frame_select_wr == 2'h2) && (frame_select_rd == 2'h3)) begin
frame_select_rd <= 2'h0;
end
else if ((frame_select_wr == 2'h3) && (frame_select_rd == 2'h0)) begin
frame_select_rd <= 2'h1;
end
else if ((frame_select_wr == 2'h3) && (frame_select_rd == 2'h1)) begin
frame_select_rd <= 2'h2;
end
else if ((frame_select_wr == 2'h3) && (frame_select_rd == 2'h2)) begin
frame_select_rd <= 2'h2;
end
else if ((frame_select_wr == 2'h3) && (frame_select_rd == 2'h3)) begin
frame_select_rd <= 2'h3; //don't care
end
else
frame_select_rd <= 2'h0;
end
else begin
frame_select_rd <= frame_select_rd;
rst_read_address <= 1'b0;
end
end
always @( posedge clk_140) begin
if (reset_active_high == 1'b1) begin
frame_select_wr <= 2'h0;
rst_write_address <= 1'b1;
end
else if (frame_write_finished == 1'b1) begin
rst_write_address <= 1'b1;
if ((frame_select_wr == 2'h0) && (frame_select_rd == 2'h0)) begin
frame_select_wr <= 2'h0; //don't care
end
else if ((frame_select_wr == 2'h0) && (frame_select_rd == 2'h1)) begin
frame_select_wr <= 2'h0;
end
else if ((frame_select_wr == 2'h0) && (frame_select_rd == 2'h2)) begin
frame_select_wr <= 2'h1;
end
else if ((frame_select_wr == 2'h0) && (frame_select_rd == 2'h3)) begin
frame_select_wr <= 2'h1;
end
else if ((frame_select_wr == 2'h1) && (frame_select_rd == 2'h0)) begin
frame_select_wr <= 2'h2;
end
else if ((frame_select_wr == 2'h1) && (frame_select_rd == 2'h1)) begin
frame_select_wr <= 2'h1; //don't care
end
else if ((frame_select_wr == 2'h1) && (frame_select_rd == 2'h2)) begin
frame_select_wr <= 2'h1;
end
else if ((frame_select_wr == 2'h1) && (frame_select_rd == 2'h3)) begin
frame_select_wr <= 2'h2;
end
else if ((frame_select_wr == 2'h2) && (frame_select_rd == 2'h0)) begin
frame_select_wr <= 2'h3;
end
else if ((frame_select_wr == 2'h2) && (frame_select_rd == 2'h1)) begin
frame_select_wr <= 2'h3;
end
else if ((frame_select_wr == 2'h2) && (frame_select_rd == 2'h2)) begin
frame_select_wr <= 2'h2; //don't care
end
else if ((frame_select_wr == 2'h2) && (frame_select_rd == 2'h3)) begin
frame_select_wr <= 2'h2;
end
else if ((frame_select_wr == 2'h3) && (frame_select_rd == 2'h0)) begin
frame_select_wr <= 2'h3;
end
else if ((frame_select_wr == 2'h3) && (frame_select_rd == 2'h1)) begin
frame_select_wr <= 2'h0;
end
else if ((frame_select_wr == 2'h3) && (frame_select_rd == 2'h2)) begin
frame_select_wr <= 2'h0;
end
else if ((frame_select_wr == 2'h3) && (frame_select_rd == 2'h3)) begin
frame_select_wr <= 2'h3; //don't care
end
else
frame_select_wr <= 2'h3;
end
else begin
frame_select_wr <= frame_select_wr;
rst_write_address <= 1'b0;
end
end
always @(posedge clk_140) begin
if (rst_count_write == 1'b1)
count_write <= 0;
else if (valid_fifo_in == 1'b1)
count_write <= count_write + 1'b1;
else
count_write <= count_write;
end
always @(posedge clk_140) begin
if (rst_count_read == 1'b1)
count_read <= 0;
else if (RdGnt == 1'b1)
count_read <= count_read + 1'b1;
else
count_read <= count_read;
end
always @(posedge clk_140) begin
if (reset_active_high == 1'b1)
current_state_controller <= wait_for_fifo_in;
else
current_state_controller <= next_state_controller;
end
//assign rd_en_fifo_in = (current_state_controller == write) ? 1'b1: 1'b0;
always @* begin
case (current_state_controller)
wait_for_fifo_in: begin
rst_count_read = 1'b1;
rst_count_write = 1'b1;
rd_en_fifo_in = 1'b0;
if (prog_empty_fifo_in != 1'b1) begin
next_state_controller = write_1;
WrReq = 1'b1;
RdReq = 1'b0;
end
else begin
next_state_controller = wait_for_fifo_in;
WrReq = 1'b0;
RdReq = 1'b0;
end
end
idle: begin
rst_count_read = 1'b1;
rst_count_write = 1'b1;
rd_en_fifo_in = 1'b0;
if (prog_empty_fifo_in != 1'b1) begin
next_state_controller = write_1;
WrReq = 1'b1;
RdReq = 1'b0;
end
else if (prog_full_fifo_out != 1'b1) begin
next_state_controller = read_1;
WrReq = 1'b0;
RdReq = 1'b1;
end
else begin
next_state_controller = idle;
WrReq = 1'b0;
RdReq = 1'b0;
end
end
write_1: begin
rst_count_read = 1'b1;
rst_count_write = 1'b1;
WrReq = 1'b1;
RdReq = 1'b0;
rd_en_fifo_in = 1'b0;
if (WrGnt == 1'b1)
next_state_controller = write;
else
next_state_controller = write_1;
end
write: begin
rst_count_read = 1'b1;
if (count_write >= 25'h20) begin
next_state_controller = idle;
rst_count_write = 1'b1;
WrReq = 1'b0;
RdReq = 1'b0;
rd_en_fifo_in = 1'b0;
end
else begin
next_state_controller = write;
rst_count_write = 1'b0;
WrReq = 1'b1;
RdReq = 1'b0;
rd_en_fifo_in = 1'b1;
end
end
read_1: begin
WrReq = 1'b0;
rd_en_fifo_in = 1'b0;
rst_count_write = 1'b1;
if (RdGnt == 1'b1) begin
next_state_controller = read;
rst_count_read = 1'b0;
RdReq = 1'b1;
end
else begin
next_state_controller = read_1;
rst_count_read = 1'b0;
RdReq = 1'b1;
end
end
read: begin
WrReq = 1'b0;
rst_count_write = 1'b1;
rd_en_fifo_in = 1'b0;
if (count_read >= 25'h20) begin
next_state_controller = idle;
rst_count_read = 1'b1;
RdReq = 1'b0;
end
else begin
next_state_controller = read;
rst_count_read = 1'b0;
RdReq = 1'b1;
end
end
default: begin
WrReq = 1'b0;
RdReq = 1'b0;
rd_en_fifo_in = 1'b0;
next_state_controller = idle;
rst_count_read = 1'b1;
rst_count_write = 1'b1;
end
endcase
end
endmodule
and this my ucf file:
Code:
NET "clk_in" LOC = P55;
NET "clk_in" IOSTANDARD = LVCMOS33;
NET "clk_in_sdi_in" LOC = P93;
NET "data_in_sdi_c[0]" LOC = P102;
NET "data_in_sdi_c[1]" LOC = P101;
NET "data_in_sdi_c[2]" LOC = P100;
NET "data_in_sdi_c[3]" LOC = P99;
NET "data_in_sdi_c[4]" LOC = P98;
NET "data_in_sdi_c[5]" LOC = P97;
NET "data_in_sdi_c[6]" LOC = P95;
NET "data_in_sdi_c[7]" LOC = P94;
NET "clk_in_sdi_in" IOSTANDARD = LVCMOS33;
NET "data_in_sdi_c[7]" IOSTANDARD = LVCMOS33;
NET "data_in_sdi_c[6]" IOSTANDARD = LVCMOS33;
NET "data_in_sdi_c[5]" IOSTANDARD = LVCMOS33;
NET "data_in_sdi_c[4]" IOSTANDARD = LVCMOS33;
NET "data_in_sdi_c[3]" IOSTANDARD = LVCMOS33;
NET "data_in_sdi_c[2]" IOSTANDARD = LVCMOS33;
NET "data_in_sdi_c[1]" IOSTANDARD = LVCMOS33;
NET "data_in_sdi_c[0]" IOSTANDARD = LVCMOS33;
NET "clk_out_sdi" LOC = P50;
NET "data_out_sdi[0]" LOC = P5;
NET "data_out_sdi[1]" LOC = P6;
NET "data_out_sdi[2]" LOC = P7;
NET "data_out_sdi[3]" LOC = P8;
NET "data_out_sdi[4]" LOC = P9;
NET "data_out_sdi[5]" LOC = P10;
NET "data_out_sdi[6]" LOC = P11;
NET "data_out_sdi[7]" LOC = P12;
NET "SDRAM_A[0]" LOC = P78;
NET "SDRAM_A[1]" LOC = P115;
NET "SDRAM_A[2]" LOC = P117;
NET "SDRAM_A[3]" LOC = P116;
NET "SDRAM_A[4]" LOC = P105;
NET "SDRAM_A[5]" LOC = P88;
NET "SDRAM_A[6]" LOC = P87;
NET "SDRAM_A[7]" LOC = P85;
NET "SDRAM_A[8]" LOC = P84;
NET "SDRAM_A[9]" LOC = P83;
NET "SDRAM_A[10]" LOC = P79;
NET "SDRAM_A[11]" LOC = P82;
NET "SDRAM_A[12]" LOC = P81;
NET "SDRAM_CASn" LOC = P22;
NET "SDRAM_CKE" LOC = P111;
NET "SDRAM_CLK" LOC = P132;
NET "SDRAM_CSn" LOC = P24;
NET "SDRAM_DQ[0]" LOC = P142;
NET "SDRAM_DQ[1]" LOC = P141;
NET "SDRAM_DQ[2]" LOC = P140;
NET "SDRAM_DQ[3]" LOC = P139;
NET "SDRAM_DQ[4]" LOC = P138;
NET "SDRAM_DQ[5]" LOC = P137;
NET "SDRAM_DQ[6]" LOC = P134;
NET "SDRAM_DQ[7]" LOC = P133;
NET "SDRAM_DQ[8]" LOC = P131;
NET "SDRAM_DQ[9]" LOC = P127;
NET "SDRAM_DQ[10]" LOC = P126;
NET "SDRAM_DQ[11]" LOC = P124;
NET "SDRAM_DQ[12]" LOC = P123;
NET "SDRAM_DQ[13]" LOC = P121;
NET "SDRAM_DQ[14]" LOC = P119;
NET "SDRAM_DQ[15]" LOC = P118;
NET "SDRAM_DQM[0]" LOC = P30;
NET "SDRAM_DQM[1]" LOC = P32;
NET "SDRAM_RASn" LOC = P23;
NET "SDRAM_WEn" LOC = P21;
NET "SDRAM_A[0]" IOSTANDARD = LVCMOS33;
NET "SDRAM_A[1]" IOSTANDARD = LVCMOS33;
NET "SDRAM_A[2]" IOSTANDARD = LVCMOS33;
NET "SDRAM_A[3]" IOSTANDARD = LVCMOS33;
NET "SDRAM_A[4]" IOSTANDARD = LVCMOS33;
NET "SDRAM_A[5]" IOSTANDARD = LVCMOS33;
NET "SDRAM_A[6]" IOSTANDARD = LVCMOS33;
NET "SDRAM_A[7]" IOSTANDARD = LVCMOS33;
NET "SDRAM_A[8]" IOSTANDARD = LVCMOS33;
NET "SDRAM_A[9]" IOSTANDARD = LVCMOS33;
NET "SDRAM_A[10]" IOSTANDARD = LVCMOS33;
NET "SDRAM_A[11]" IOSTANDARD = LVCMOS33;
NET "SDRAM_A[12]" IOSTANDARD = LVCMOS33;
NET "SDRAM_BA[0]" IOSTANDARD = LVCMOS33;
NET "SDRAM_BA[1]" IOSTANDARD = LVCMOS33;
NET "SDRAM_CASn" IOSTANDARD = LVCMOS33;
NET "SDRAM_CKE" IOSTANDARD = LVCMOS33;
NET "SDRAM_CLK" IOSTANDARD = LVCMOS33;
NET "SDRAM_CSn" IOSTANDARD = LVCMOS33;
NET "SDRAM_DQ[0]" IOSTANDARD = LVCMOS33;
NET "SDRAM_DQ[1]" IOSTANDARD = LVCMOS33;
NET "SDRAM_DQ[2]" IOSTANDARD = LVCMOS33;
NET "SDRAM_DQ[3]" IOSTANDARD = LVCMOS33;
NET "SDRAM_DQ[4]" IOSTANDARD = LVCMOS33;
NET "SDRAM_DQ[5]" IOSTANDARD = LVCMOS33;
NET "SDRAM_DQ[6]" IOSTANDARD = LVCMOS33;
NET "SDRAM_DQ[7]" IOSTANDARD = LVCMOS33;
NET "SDRAM_DQ[8]" IOSTANDARD = LVCMOS33;
NET "SDRAM_DQ[9]" IOSTANDARD = LVCMOS33;
NET "SDRAM_DQ[10]" IOSTANDARD = LVCMOS33;
NET "SDRAM_DQ[11]" IOSTANDARD = LVCMOS33;
NET "SDRAM_DQ[12]" IOSTANDARD = LVCMOS33;
NET "SDRAM_DQ[13]" IOSTANDARD = LVCMOS33;
NET "SDRAM_DQ[14]" IOSTANDARD = LVCMOS33;
NET "SDRAM_DQ[15]" IOSTANDARD = LVCMOS33;
NET "SDRAM_DQM[0]" IOSTANDARD = LVCMOS33;
NET "SDRAM_DQM[1]" IOSTANDARD = LVCMOS33;
NET "SDRAM_RASn" IOSTANDARD = LVCMOS33;
NET "SDRAM_WEn" IOSTANDARD = LVCMOS33;
NET "SDRAM_BA[0]" LOC = P26;
NET "SDRAM_BA[1]" LOC = P27;
NET "reset" LOC = P35;
NET "reset" IOSTANDARD = LVCMOS33;
# PlanAhead Generated IO constraints
NET "data_out_sdi[7]" IOSTANDARD = LVCMOS33;
NET "data_out_sdi[6]" IOSTANDARD = LVCMOS33;
NET "data_out_sdi[5]" IOSTANDARD = LVCMOS33;
NET "data_out_sdi[4]" IOSTANDARD = LVCMOS33;
NET "data_out_sdi[3]" IOSTANDARD = LVCMOS33;
NET "data_out_sdi[2]" IOSTANDARD = LVCMOS33;
NET "data_out_sdi[1]" IOSTANDARD = LVCMOS33;
NET "data_out_sdi[0]" IOSTANDARD = LVCMOS33;
NET "clk_out_sdi" IOSTANDARD = LVCMOS33;
#Created by Constraints Editor (xc6slx9-tqg144-3) - 2017/05/03
NET "clk_in" TNM_NET = clk_in;
TIMESPEC TS_clk_in = PERIOD "clk_in" 20 ns HIGH 50%;
NET "clk_in_sdi_in" TNM_NET = clk_in_sdi_in;
TIMESPEC TS_clk_in_sdi_in = PERIOD "clk_in_sdi_in" 37.037 ns HIGH 50%;
NET "clk_in_sdi" TNM_NET = clk_in_sdi;
TIMESPEC TS_clk_in_sdi = PERIOD "clk_in_sdi" 37.037 ns HIGH 50%;
NET "clk_140" TNM_NET = clk_140;
TIMESPEC TS_clk_140 = PERIOD "clk_140" 13.333 ns HIGH 50%;
NET "clk_27_out" TNM_NET = clk_27_out;
TIMESPEC TS_clk_27_out = PERIOD "clk_27_out" 37.037 ns HIGH 50%;
TIMESPEC "TS_CDC_1" = FROM "clk_140" TO "clk_in_sdi" TIG;
#TIMESPEC "TS_CDC_1" = FROM "clk_140" TO "clk_27_out" TIG;
#TIMESPEC "TS_CDC_1" = FROM "clk_in_sdi" TO "clk_27_out" TIG;
#PIN "clock_wizard/clkout3_buf.O" CLOCK_DEDICATED_ROUTE = FALSE;
I apologize for my bad English.