FIT过程提示宏单元不够,怎样减少宏单元?急
ERROR:Cpld:837 - Insufficient number of macrocells. The design needs at least 104 but only 36 left after allocating other resources.Device 9536XL44VQ was disqualified.
ERROR:Cpld:868 - Cannot fit the design into any of the specified devices with the selected implementation options.
求助 在线等高手回答啊 减少各种意义上的状态机……
话说回来,需求104个,实有36个……楼主你要真是让别人帮忙改了韧件设计就能用的话,我觉得以你现有的水平,回校重修会比较好…… 我没用到状态机,修改下面这段代码就不够用了,有没好办法优化下的
process(clk,cmd,kout)
variable cnt_ain:std_logic_vector(7 downto 0):="00000000";
variable cnt_bin:std_logic_vector(7 downto 0):="00000110";
begin
if cmd="00000000" then
clkout_a<=clk_a;clkout_b<=clk_b;
else
if (clk'event and clk='1') then
case kout is
when '1'=>cnt_ain:=cnt_ain+1;cnt_bin:=cnt_bin+1;
if (cnt_ain<=(cnt_a)) then clkout_a<='1';
elseclkout_a<='0';
if (cnt_ain>=(cnt_b)) then cnt_ain:="00000000";
end if;
end if;
if (cnt_bin<=(cnt_a)) then clkout_b<='1';
else clkout_b<='0';
if (cnt_bin>=(cnt_b)) then cnt_bin:="00000000";
end if;
end if;
when '0'=>cnt_ain:=cnt_ain-1;cnt_bin:=cnt_bin-1;
if (cnt_ain>(cnt_b-1)) then cnt_ain:=cnt_b-1;clkout_a<='1';
else
if (cnt_ain>=(cnt_a)) then clkout_a<='1';
else clkout_a<='0';
end if;
end if;
if (cnt_bin>(cnt_b-1)) then cnt_bin:=cnt_b-1;clkout_b<='1';
else
if (cnt_bin>=(cnt_a)) then clkout_b<='1';
else clkout_b<='0';
end if;
end if;
when others=>clkout_b<='0';clkout_a<='0';
end case;
end if;
end if;
end process; 删除掉关于计数器cnt_bin的代码能减少40多个宏单元 哦,已经有人说了些了
总之,楼主还是讲讲设计目标吧 根据给定的8位拨码开关状态,对编码器输出的2路正交脉冲进行分频,分频后的脉冲也需要正交 VHDL 看着已经很生疏了,而且手头也没仿真工具,虽然应该看出一些问题,不过,索性还是你自己先说说你自己的实现思路吧 回复【6楼】scfor
根据给定的8位拨码开关状态,对编码器输出的2路正交脉冲进行分频,分频后的脉冲也需要正交
-----------------------------------------------------------------------
不就是个编码器,能有多高的速度?10K?总上不到100K吧?
用单片机实现你的方案,比CPLD好。
你想想,你输入是8位编码开关,那至少是129种或以上的分频方案,才需要8位开关吧。
你怎么个CPLD呢!
你为什么要用CPLD呢? 回复【8楼】Cliff
回复【6楼】scfor
根据给定的8位拨码开关状态,对编码器输出的2路正交脉冲进行分频,分频后的脉冲也需要正交
-----------------------------------------------------------------------
不就是个编码器,能有多高的速度?10k?总上不到100k吧?
用单片机实现你的方案,比cpld好。
你想想,你输入是8位编码开关,那至少是129种或以上的分频方案,才需要8位开关吧。
你怎么个cpld呢!
你为什么要用cpld呢?
-----------------------------------------------------------------------
楼主已经消失了…… 现在够用了,真不知道这些macrocells,product terms是怎么占用的 回复【10楼】scfor
现在够用了,真不知道这些macrocells,product terms是怎么占用的
-----------------------------------------------------------------------
你拿前后程序对比下不就好了 完全不一样怎么对比,有时删掉一条语句,资源占用还要多,无法理解 楼主可以这样理解,一个宏单元对应一个D触发器,做一个32位的计数器需要32个宏单元 我大概明白了……你其实是在以标准C语言的思路去考虑HDL……
建议还是先重新从头学学HDL吧……HDL拿来做流程控制,那是迫不得已中的迫不得已才可以稍微考虑的
页:
[1]