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

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

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 4276|回复: 10

有没有谁遇到过这种情况?

[复制链接]
发表于 2003-8-19 15:52:16 | 显示全部楼层 |阅读模式

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

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

x
为什么当fifoclk的采样频率不同时
得出的结果不同呢?
有解决的办法吗?
程序如下:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity ChangeToLd is
  port(fifoclk:in std_logic;
       --reset  :in std_logic;
       out_dq  :in std_logic_vector(63 downto 0);
       ld ut std_logic_vector(7 downto 0));
end ChangeToLd;
architecture a_changeToLd of changeToLd is
signal count: integer range 0 to 8;
begin
  process(fifoclk)
  begin
  if fifoclk = '1' and fifoclk'event then
  if count = 0 then
     ld<=out_dq(63 downto 56);
  elsif count =1 then
     ld<=out_dq(55 downto 48);
  elsif count =2 then
     ld<=out_dq(47 downto 40);
  elsif count =3 then
     ld<=out_dq(39 downto 32);
  elsif count =4 then  
     ld<=out_dq(31 downto 24);
  elsif count =5 then  
     ld<=out_dq(23 downto 16);
  elsif count =6 then
     ld<=out_dq(15 downto 8);
  elsif count =7 then
     ld<=out_dq(7 downto 0);
  end if;
  end if;
  end process;
  process(fifoclk)
  begin
    if fifoclk = '1' and fifoclk'event then
      if count=7 then
        count<=0;
      else
        count<=count+1;
      end if;
    end if;
  end process;
end a_changetold;
5_183.jpg
发表于 2003-8-19 16:34:11 | 显示全部楼层

有没有谁遇到过这种情况?

你做的是rtl仿真还是时序方真?
发表于 2003-8-19 16:47:34 | 显示全部楼层

有没有谁遇到过这种情况?

应该是时序方真吧。由于时延的缘故,造成在不同的频率下的结果不同,这是正常的。
 楼主| 发表于 2003-8-19 20:08:48 | 显示全部楼层

有没有谁遇到过这种情况?

是时序仿真,那怎么改进呢?
谢谢
发表于 2003-8-19 22:52:25 | 显示全部楼层

有没有谁遇到过这种情况?

process(fifoclk)   //
改成process(count)
begin
if fifoclk = '1' and fifoclk'event then
以下用case语句
if count = 0 then
    ld<=out_dq(63 downto 56);
elsif count =1 then
    ld<=out_dq(55 downto 48);
elsif count =2 then
    ld<=out_dq(47 downto 40);
elsif count =3 then
    ld<=out_dq(39 downto 32);
elsif count =4 then  
    ld<=out_dq(31 downto 24);
elsif count =5 then  
    ld<=out_dq(23 downto 16);
elsif count =6 then
    ld<=out_dq(15 downto 8);
elsif count =7 then
    ld<=out_dq(7 downto 0);
end if;
end if;
end process;
发表于 2003-8-20 08:17:14 | 显示全部楼层

有没有谁遇到过这种情况?

其实代码可不用改的,做一下定时分析,只要能满足定时要求,该模块能稳定可靠的工作,就结了。FPGA内部的DELAY是固有的,这谁也没办法,频率愈高愈明显,工作也愈难做的。
发表于 2003-8-20 09:17:37 | 显示全部楼层

有没有谁遇到过这种情况?

因为是时钟驱动,结果应该是一样的吧?就是,做做时序分析,
是不是高频率下关键路径延迟太大,超过了时钟周期?(但不太可能吧,
只看这段程序,很easy的啊。)
因为不存在优先级别,按楼上的说法,用case好。
 楼主| 发表于 2003-8-21 14:35:38 | 显示全部楼层

有没有谁遇到过这种情况?

继续呀,
的确用case好。
发表于 2003-8-27 10:24:26 | 显示全部楼层

有没有谁遇到过这种情况?

atuhappy:你说
process(fifoclk)   //
改成process(count)
??????????????
这是个时钟进程,为什么要将敏感变量改为count?!!
发表于 2003-8-27 12:57:10 | 显示全部楼层

有没有谁遇到过这种情况?

process(count)
begin
以下用case语句
if count = 0 then
   ld<=out_dq(63 downto 56);
elsif count =1 then
   ld<=out_dq(55 downto 48);
elsif count =2 then
   ld<=out_dq(47 downto 40);
elsif count =3 then
   ld<=out_dq(39 downto 32);
elsif count =4 then  
   ld<=out_dq(31 downto 24);
elsif count =5 then  
   ld<=out_dq(23 downto 16);
elsif count =6 then
   ld<=out_dq(15 downto 8);
elsif count =7 then
   ld<=out_dq(7 downto 0);
end if;
end process;

我写错了,把fifoclk = '1' and fifoclk'event 去掉


您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

×

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

GMT+8, 2024-5-20 13:46 , Processed in 0.039385 second(s), 13 queries , Gzip On, Redis On.

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