正在开发XP2-17项目源代码如下: fifo没有问题,其中pcpprd_out为fifo输出的脉冲周期,其中pcpcnt_out为fifo输出的脉冲个数,映射出现如下问题:
error map:
Design doesn't fit into device specified refer to the map
敬请那位帮我解答下
`include "Parameter.v"
`timescale 1ns/100ps
module int_pwm1 (
clk,
reset,
arm_data,
reset_cs,
pcpprd_cs,
pcpcnt_cs,
pwmdir,
pwmout
);
input clk;
input reset;
input reset_cs;
inout [`DATA_WIDTH-1:0] arm_data;
input pcpprd_cs;
input pcpcnt_cs;
output pwmdir;
output pwmout;
reg pwmdir;
reg pwmout;
wire [`DATA_WIDTH-1:0] pcpprd_out;
wire [`DATA_WIDTH-1:0] pcpcnt_out;
reg [`DATA_WIDTH-1:0] time_gnt;
reg [`DATA_WIDTH-1:0] time_knt;
reg pcpprd_pwm;
fifo uvw1 (
.clk(clk),
.reset(reset),
.dat_in(arm_data),
.reset_cs(reset_cs),
.fifo_cs(pcpprd_cs),
.dat_out(pcpprd_out)
);
fifo uvw2 (
.clk(clk),
.reset(reset),
.dat_in(arm_data),
.reset_cs(reset_cs),
.fifo_cs(pcpcnt_cs),
.dat_out(pcpcnt_out)
);
always @(negedge reset or posedge clk)
begin
if (~reset||reset_cs)
begin
time_gnt <= 0;
pcpprd_pwm <= 1'b0;
end
else
begin
time_gnt <= time_gnt + 1'b1;
if (time_gnt == pcpprd_out)
begin
time_gnt <= 0;
pcpprd_pwm <= ~pcpprd_pwm;
end
end
end
always @(negedge reset or posedge pcpprd_pwm)
begin
if (~reset||reset_cs)
begin
time_knt <= 0;
pwmout <= 1'b1;
pwmdir <= 1'b1;
end
else
begin
time_knt <= time_knt + 1'b1;
if (time_knt == pcpcnt_out)
begin
time_knt <= 0;
pwmout <= ~pwmout;
pwmdir <= ~pwmdir;
end
end
end
endmodule
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |