|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
`define ROWSTART 9
`define ROWSIZE 13
`define COLSTART 0
`define COLSIZE 9
`define BANKSTART 22
`define BANKSIZE 2
// Address and Data Bus Sizes
`define ASIZE 25 // total address width of the SDRAM
`define DSIZE 16 // Width of data bus to SDRAMS
`timescale 1ps / 1ps
module top_sdram(
clk_50,
//clk_28,
reset_n,
switch,
SA,
BA,
CS_N,
CKE,
RAS_N,
CAS_N,
WE_N,
DQ,
DQM,
clk_vga,
clk_vga0,
clk_sdram,
hsync_o,
vsync_o,
valid_o,
r_o,
g_o,
b_o
);
input clk_50;
//input clk_28;
input reset_n;
input switch;
output [12:0] SA;
output [1:0] BA;
output [1:0] CS_N;
output CKE;
output RAS_N;
output CAS_N;
output WE_N;
inout [`DSIZE-1:0] DQ;
output [`DSIZE/8-1:0] DQM;
output clk_vga;
output clk_vga0;
output clk_sdram;
output hsync_o;
output vsync_o;
output valid_o;
output [7 : 0] r_o;
output [7 : 0] g_o;
output [7 : 0] b_o;
wire clk_50;
wire reset_n;
wire switch;
wire [12:0] SA;
wire [1:0] BA;
wire [1:0] CS_N;
wire CKE;
wire RAS_N;
wire CAS_N;
wire WE_N;
wire [`DSIZE-1:0] DQ;
wire [`DSIZE/8-1:0] DQM;
wire [2:0] CMD;
wire [`ASIZE - 1 : 0] addr;
wire [`DSIZE - 1 : 0] datain;
wire [`DSIZE/8 - 1 : 0] dm;
wire cmdack;
wire [`DSIZE - 1 : 0] dataout;
wire clk_vga;
wire clk_vga0;
wire clk_sdram;
wire hsync_o;
wire vsync_o;
wire valid_o;
wire [7 : 0] r_o;
wire [7 : 0] g_o;
wire [7 : 0] b_o;
wire locked_sig;
sdr_sdram sdr_sdram_1(
.CLK(clk_ctrl),
.RESET_N(reset_n),
.ADDR(addr),
.CMD(CMD),
.CMDACK(cmdack),
.DATAIN(datain),
.DATAOUT(dataout),
.DM(dm),
.SA(SA),
.BA(BA),
.CS_N(CS_N),
.CKE(CKE),
.RAS_N(RAS_N),
.CAS_N(CAS_N),
.WE_N(WE_N),
.DQ(DQ),
.DQM(DQM)
);
sdr_sdram_rd sdr_sdram_rd_1(
.clk_ctrl(clk_ctrl),
.clk_vga0(clk_vga),
.reset_n(reset_n),
.switch(switch),
.cmdack(cmdack),
.dataout(dataout),
.CMD(CMD),
.addr(addr),
.datain(datain),
.dm(dm),
.hsync_o(hsync_o),
.vsync_o(vsync_o),
.valid_o(valid_o),
.r_o(r_o),
.g_o(g_o),
.b_o(b_o));
pll_vga pll_vga_inst (
.areset (0),
.inclk0 ( clk_50 ),
.c0 ( clk_vga ),
.locked ( locked_sig )
);
pll_vga0 pll_vga0_inst (
.areset (0),
.inclk0 ( clk_50 ),
.c0 ( clk_vga0 ),
.locked ( locked_sig )
);
pll_ctrl_sdram pll_ctrl_sdram_inst (
.areset (0),
.inclk0 ( clk_50 ),
.c0 ( clk_ctrl ),
.c1 ( clk_sdram ),
.locked ( locked_sig )
);
endmodule
这是我写的程序的顶层模块,sdr_sdram是SDRAM控制器模块,sdr_sdram_rd是对SDRAM读写的时序控制模块,这个整体框架中要用到的4个时钟,我用了3个PLL,可是以上面例化的PLL来综合的话,报错:Error: Input clock "clk_50" cannot feed more than one PLL
看起来的意思是clk_50不能同时接到多于一个pll上,然后我就把锁相环三个中的一个pll_vga 的输出管脚中的c1,c2输出clk_50一样频率的时钟结果报错:
Error: Can't fit fan-out of node pll_vga:pll_vga_inst|altpll:altpll_component|_clk1 into a single clock region
Error: Can't fit fan-out of node pll_vga:pll_vga_inst|altpll:altpll_component|_clk2 into a single clock region
关于PLL的使用中以上设计是违反了什么规则么?好纠结,求大手指点一二呀!?? |
|