我在设计愿景中面临一个问题,例如定义是:
“寄存器 THRESHOLD 是常数,将被删除”
因为我声明了一个信号并且我初始化了某个值以使其保持不变。我想要这些常量值用于一些比较目的....下一步该做什么?
begin
P : PROCESS(CLK,RST)
VARIABLE THRESHOLD: signed(10 DOWNTO 0);
BEGIN
IF(RST='1')THEN -- RESET CONDITION
THRESHOLD:="00011111111";
ELSIF(RISING_EDGE(CLK))THEN
H1<=(SIGNED("000"&P2)+SIGNED("00"&P3(7 DOWNTO 0)&'0')+SIGNED("000"&P6))-(SIGNED("000"&P4)+SIGNED("00"&P7(7 DOWNTO 0)&'0')+SIGNED("000"&P8));
IF(H1>=THRESHOLD) THEN
MAG_DL<="11111111";
ELSE
IF H1(10)='0' THEN
MAG_DL<=H1(7)&H1(6)&H1(5)&H1(4)&H1(3)&H1(2)&H1(1)&H1(0);
ELSE
H2<=NOT (H1(10)&H1(9)&H1(8)&H1(7)&H1(6)&H1(5)&H1(4)&H1(3)&H1(2)&H1(1)&H1(0));
H2<=H2+("00000000001");
IF(H2 >="11111111") THEN
MAG_DL<="11111111";
ELSE
MAG_DL<=H2(7)&H2(6)&H2(5)&H2(4)&H2(3)&H2(2)&H2(1)&H2(0);
END IF;
END IF;