阅读:2715回复:0
ISE 编译的问题请教
ERROR:NgdBuild:605 - logical root block 'ConfigChip' with type 'ConfigChip' is
unexpanded. Symbol 'ConfigChip' is not supported in target 'xpla3'. 这个错误是什么原因造成的?怎样解决他? 下面的这个模块编译就是通不过,老出上面的错误。请高手帮忙看看上哪个地方有问题?多谢! 我用的是ISE6。2, XL3032的片子, 是一个自动波特率检测的模块。 module ConfigChip(Clk,dtrWire,rtsWire,txdWire, Sel); input Clk; input dtrWire; input rtsWire; input txdWire; output [1 : 0] Sel; reg [1 : 0] Sel; parameter SAMPLE = 256; parameter DTRCODE = 34; parameter RTSCODE = 56; parameter BAUD1200 = 12288; //the value calculrate by Fosc 14.745600 Mhz,the follow same parameter BAUD2400 = 6144; parameter BAUD4800 = 3072; parameter BAUD9600 = 1536; parameter BAUD19200 = 768; parameter BAUD38400 = 384; parameter BAUD57600 = 256; parameter BAUD115200 = 128; parameter BAUD230400 = 64; //define flag register reg DetectStart; //sample the dtr and rts signal flag reg SampleStart; //sample the txd signal flag , in order to confirm the baudrate reg ConfigStart; //the config start flag reg UsartStart; //the usart start flag ,used by config the chip //define register reg [15 : 0] BaudReg; //save the baudrate constant reg [15 : 0] BaudCnt; //use to baudrate count reg [7 : 0] DtrReg; //use to save the dtr start code reg [7 : 0] RtsReg; //use to save the rts start code reg [3 : 0] Count; //use to count sample times reg [15 : 0] SampleCnt; //the calculate baudrate count reg [2 : 0] Repeat; //sample baudrate repeat time reg baudWire; reg [7 : 0] ConfigReg; //use to config the chip register reg [15 : 0] ConfigCnt; //initialize the register and flag initial begin DetectStart = 0; SampleStart = 0; ConfigStart = 0; UsartStart = 0; BaudReg = 128; //the initial value use to sample dtr and rts signal BaudCnt = 0; DtrReg = 0; RtsReg = 0; Count = 0; SampleCnt = 0; Repeat = 0; baudWire = 0; ConfigReg = 0; ConfigCnt = 0; end //generate the sample baudrate signal always @ (posedge Clk) begin BaudCnt = BaudCnt + 1; if (BaudCnt >= BaudReg) begin BaudCnt = 0; baudWire = ~baudWire; end end //detect the config start condition always @(posedge dtrWire ) //or posedge rtsWire) begin if (!DetectStart) begin DetectStart = 1; baudWire = 0; //clear the sample wire BaudCnt = 0; Count = 0; end end //the follow function block sample the dtr and rts always @ (posedge baudWire) begin if (DetectStart) begin DtrReg = DtrReg << 1; DtrReg[0] = dtrWire; RtsReg = RtsReg << 1; RtsReg[0] = rtsWire; Count = Count + 1; if (Count >= 8) begin if ((RtsReg == RTSCODE) && (DtrReg == DTRCODE)) begin SampleStart = 1; end else DetectStart = 0; Count = 0; //use to resample the dtr and rts RtsReg = 0; //clear the sample code register DtrReg = 0; end end end //set the usart start flag always @ (negedge txdWire) begin if (SampleStart & (!UsartStart)) begin baudWire = 0; //clear the sample wire UsartStart = 1; //set the usart start flag BaudCnt = 0; end end //judge the sample value in order to confim the baudrate always @ (negedge txdWire) begin //the follow calculrate baudrate if (SampleStart & UsartStart) begin if ((SampleCnt > (BAUD115200 - 8)) && (SampleCnt < (BAUD115200 + 8))) begin if ((BaudReg == BAUD115200) && (!Repeat)) begin Repeat = Repeat + 1; if (Repeat >= 2) begin ConfigStart = 1; SampleStart = 0; UsartStart = 0; SampleCnt = 0; BaudCnt = 0; baudWire = 0; end else begin BaudReg = BAUD115200; end end else if ((SampleCnt > (BAUD57600 - 16)) && (SampleCnt < (BAUD57600 + 16))) begin if ((BaudReg == BAUD57600) && (!Repeat)) begin Repeat = Repeat + 1; if (Repeat >= 2) begin ConfigStart = 1; SampleStart = 0; UsartStart = 0; SampleCnt = 0; BaudCnt = 0; baudWire = 0; end end else begin BaudReg = BAUD57600; end end else if ((SampleCnt > (BAUD38400 - 24)) && (SampleCnt < (BAUD38400 + 24))) begin if ((BaudReg == BAUD57600) && (!Repeat)) begin Repeat = Repeat + 1; if (Repeat >= 2) begin ConfigStart = 1; SampleStart = 0; UsartStart = 0; SampleCnt = 0; BaudCnt = 0; baudWire = 0; end end else begin BaudReg = BAUD38400; end end else if ((SampleCnt > (BAUD19200 - 48)) && (SampleCnt < (BAUD19200 + 48))) begin if ((BaudReg == BAUD19200) && (!Repeat)) begin Repeat = Repeat + 1; if (Repeat >= 2) begin ConfigStart = 1; SampleStart = 0; UsartStart = 0; SampleCnt = 0; BaudCnt = 0; baudWire = 0; end end else begin BaudReg = BAUD19200; end end else if ((SampleCnt > (BAUD9600 - 96)) && (SampleCnt < (BAUD9600 + 96))) begin if ((BaudReg == BAUD9600) && (!Repeat)) begin Repeat = Repeat + 1; if (Repeat >= 2) begin ConfigStart = 1; SampleStart = 0; UsartStart = 0; SampleCnt = 0; BaudCnt = 0; baudWire = 0; end end else begin BaudReg = BAUD9600; end end end end end //start the baudrate sample always @ (posedge txdWire) begin if (SampleStart & UsartStart) begin SampleCnt = 0; //start the timer count end end always @ (posedge Clk) begin if (SampleStart) begin SampleCnt = SampleCnt + 1; //sample count ,calculate the baudrate if (SampleCnt > BAUD1200) begin UsartStart = 0; end end end //the follow shift the config data to always @ (posedge baudWire) begin if (ConfigStart & UsartStart) begin ConfigReg = ConfigReg << 1; ConfigReg[0] = txdWire; ConfigCnt = ConfigCnt + 1; if (!(ConfigCnt % 8)) UsartStart = 0; //shift one byte if (ConfigCnt >= 8) begin ConfigStart = 0; //config complete UsartStart = 0; SampleStart = 0; DetectStart = 0; Sel[0] = ConfigReg[0]; Sel[1] = ConfigReg[1]; end end end endmodule |
|