gpt4 book ai didi

vhdl - 找到用于信号和常量值警告的 1 位锁存器

转载 作者:行者123 更新时间:2023-12-01 04:53:51 26 4
gpt4 key购买 nike

两天来我一直在尝试调试此 VHDL 代码,但我就是看不出错误在哪里。这是代码:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;


entity SSDDriver is
Port ( cp : in std_logic;
iin : in std_logic;
an : buffer std_logic_vector (3 downto 0);
--7=a, 6=b ...
segments: out std_logic_vector (7 downto 0));
end SSDDriver;

architecture Behavioral of SSDDriver is
signal cpo : std_logic;
--broj BCD znamenki
constant BCD_NUMBERS : integer := 4;
--broj bitova ulaznog broja
constant BITS : integer := 14;
--broj kodiran BCD-om
signal BCDNumber : std_logic_vector (BCD_NUMBERS*4-1 downto 0) := (others => '0');
signal BCDForDecoder: std_logic_vector (3 downto 0);
signal number: integer range 0 to 9999;
begin
decoder: entity BCDToSSD port map (bcd => BCDForDecoder, segm => segments (7 downto 1));
counter: entity djelitelj generic map (COUNTTO => 25000) port map (cpIn => cp, CpOut=> cpo);
--tocka je uvijek ugasena
segments(0) <= '1';

process (iin)
begin
if iin='1' then
number<=3245;
else
number<=1111;
end if;
end process;

SwitchDisplay: process (cpo)
begin
if rising_edge(cpo) then
if an="0111" then
an<="1011";
BCDForDecoder<=BCDNumber(11 downto 8);
elsif an="1011" then
an<="1101";
BCDForDecoder<=BCDNumber(7 downto 4);
elsif an="1101" then
an<="1110";
BCDForDecoder<=BCDNumber(3 downto 0);
else
an<="0111";
BCDForDecoder<=BCDNumber(15 downto 12);
end if;
end if;
end process SwitchDisplay;

DoubleDabble: process (number)
variable num : std_logic_vector (BITS-1 downto 0);
variable bcd : std_logic_vector (BCD_NUMBERS*4-1 downto 0) := (others => '0');
variable old_number: integer range 0 to 9999;
begin
if number/= old_number then
num := conv_std_logic_vector(number, BITS);

for i in 0 to BITS-1 loop
bcd(BCD_NUMBERS*4-1 downto 1) := bcd(BCD_NUMBERS*4-2 downto 0);
bcd(0) := num(BITS-1);
num(BITS-1 downto 1) := num(BITS-2 downto 0);
num(0) :='0';

if(i < BITS-1 and bcd(3 downto 0) > "0100") then
bcd(3 downto 0) := bcd(3 downto 0) + "0011";
end if;

if(i < BITS-1 and bcd(7 downto 4) > "0100") then
bcd(7 downto 4) := bcd(7 downto 4) + "0011";
end if;

if(i < BITS-1 and bcd(11 downto 8) > "0100") then
bcd(11 downto 8) := bcd(11 downto 8) + "0011";
end if;

if(i < BITS-1 and bcd(15 downto 12) > "0100") then
bcd(15 downto 12) := bcd(15 downto 12) + "0011";
end if;
end loop;
BCDNumber <= bcd;
else

end if;

old_number := number;
end process DoubleDabble;
end Behavioral;

这里是生成的警告:

WARNING:Xst:2734 - Property "use_dsp48" is not applicable for this technology. WARNING:Xst:1780 - Signal > is never used or assigned. WARNING:Xst:737 - Found 1-bit latch for signal . WARNING:Xst:737 - Found 1-bit latch for signal . WARNING:Xst:737 - Found 1-bit latch for signal . WARNING:Xst:737 - Found 1-bit latch for signal . WARNING:Xst:737 - Found 1-bit latch for signal . WARNING:Xst:737 - Found 1-bit latch for signal . WARNING:Xst:737 - Found 1-bit latch for signal . WARNING:Xst:737 - Found 1-bit latch for signal . WARNING:Xst:737 - Found 1-bit latch for signal . WARNING:Xst:737 - Found 1-bit latch for signal . WARNING:Xst:737 - Found 16-bit latch for signal . WARNING:Xst:737 - Found 1-bit latch for signal . WARNING:Xst:737 - Found 1-bit latch for signal . WARNING:Xst:737 - Found 1-bit latch for signal . WARNING:Xst:737 - Found 1-bit latch for signal . WARNING:Xst:737 - Found 1-bit latch for signal . WARNING:Xst:2734 - Property "use_dsp48" is not applicable for this technology. WARNING:Xst:1426 - The value init of the FF/Latch bcd_0 hinder the constant cleaning in the block SSDDriver. WARNING:Xst:1293 - FF/Latch has a constant value of 0 in block . WARNING:Xst:1293 - FF/Latch has a constant value of 0 in block . WARNING:Xst:1293 - FF/Latch has a constant value of 0 in block . WARNING:Xst:1293 - FF/Latch has a constant value of 0 in block . WARNING:Xst:1293 - FF/Latch has a constant value of 0 in block . WARNING:Xst:1293 - FF/Latch has a constant value of 0 in block . WARNING:Xst:1293 - FF/Latch has a constant value of 0 in block . WARNING:Xst:1293 - FF/Latch has a constant value of 0 in block . WARNING:Xst:1293 - FF/Latch has a constant value of 0 in block . WARNING:Xst:1293 - FF/Latch has a constant value of 0 in block . WARNING:Xst:1293 - FF/Latch has a constant value of 0 in block . WARNING:Xst:1293 - FF/Latch has a constant value of 0 in block . WARNING:Xst:1293 - FF/Latch has a constant value of 0 in block . WARNING:Xst:1293 - FF/Latch has a constant value of 0 in block . WARNING:Xst:1293 - FF/Latch has a constant value of 0 in block . WARNING:Xst:1293 - FF/Latch has a constant value of 0 in block . WARNING:Xst:1710 - FF/Latch

and so on ...

由于这些警告,当我实现该模块时,我在 4 个 7 段显示器上只显示 0000。

此 VHDL 代码应采用整数变量(范围从 0 到 9999)并使用 4 个 7 段显示器显示该数字 ...

最佳答案

转换为同步设计的另一种方法是使您的逻辑真正异步。

在 DoubleDabble 过程中,只需注释最外层的 if 语句,这样您的 BCD 转换逻辑就会一直运行,然后看看它能把您带到哪里。您的逻辑不需要先前的整数值 (old_number),它是“if number/= old_number”比较(不使用时钟信号和同步逻辑)使合成器适合。

关于vhdl - 找到用于信号和常量值警告的 1 位锁存器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9383429/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com