在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 2398|回复: 5

求助综合通过,但是仿真波形出不来,reset无法赋值

[复制链接]
发表于 2006-11-6 16:45:18 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity frequence_controlled_word_1 is
       port(       clk                                                   :      in            std_logic;
                     RST                                               :      in            std_logic;
                     frequence_controlled_word   :      out   std_logic_vector(29 downto 0)
                );
end frequence_controlled_word_1;

architecture behave of frequence_controlled_word_1 is

       signal f                               :      std_logic_vector(29 downto 0);
       signal change_amount   :      std_logic_vector(29 downto 0);
       signal num_of_step              :      std_logic_vector(29 downto 0);
       signal sign             :    boolean;
      
begin
      
       process(RST,clk)
              begin      
                     if (RST = '1') then
                            sign <= false;
                     elsif (clk = '1' and clk'event) then
                            if (sign = false) then
                                      f <= f - change_amount;
                                   sign <= true;
                            else
                                      f <= f + change_amount;
                                   sign <= false;
                            end if;
                     end if;
       end process;
      
       process(RST,clk)
       begin
              if (RST = '1') then
                     num_of_step <=     "000000000000000000000000000000";
                                           f <=      "001000110110100011011010001110";--f0;
              elsif (clk = '1' and clk'event) then
                     if     (num_of_step="000000000000000000101110111001") then
                            num_of_step <= "000000000000000000000000000000";
                                                  f <= "001000110110100011011010001110";--f0;
                     else
                            num_of_step <= num_of_step + "000000000000000000000000000001";
                     end if;                  
              end if;
       end process;
      
       process(num_of_step)
       begin
              change_amount      <=   num_of_step;
              change_amount(29 downto 11) <= change_amount(18 downto 0);
              change_amount(10 downto 0)  <= "00000000000";
       end process;
      
       process(f)
       begin
              frequence_controlled_word   <=   f;
       end process;
end behave;           
这是我编得一个DDS频率控制字程序,要求频率以初值为中心上下浮动,扫描到正负最大值后再回到初值,如此循环。仿真发现reset为1时,frequence_controlled_word无法赋值,请教大侠如何改正。
 楼主| 发表于 2006-11-6 16:48:17 | 显示全部楼层
补充一下,change_amount是每次频率字的改变量,它是在num_of_step的基础上乘以2048得到的,即做移11位。
 楼主| 发表于 2006-11-6 17:58:39 | 显示全部楼层
frequence_controlled_word在reset=1时也全是u,当reset变为0时,全部变成X了
发表于 2006-11-7 23:06:04 | 显示全部楼层

不能在两个process中对同一信号赋值

代码中的f
发表于 2006-11-8 08:48:17 | 显示全部楼层
楼上可能说得对,在verilog这种情景也还是不允许
 楼主| 发表于 2006-11-9 16:48:36 | 显示全部楼层
谢谢atuhappy和liumeco,我加了一个中间变量,存储f的值,用时钟上升沿控制赋值,相当于作了一个延时,结果波形就出来了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

×

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-5-22 15:55 , Processed in 0.028400 second(s), 9 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表