串并转换的工作不稳定的问题
查看( 167 ) /
评论( 24 )
TAG:
-
liubaoying0725
发布于2008-04-13 19:53:43
-
能跑通说明逻辑应该没问题。估计一,板上信号质量不好,干扰引起误码;估计二,时序的余量不大,处于亚稳态工作,状态判决导致误码。
-
hawkie发布于2008-04-14 00:22:45
-
板子上有几个时钟?
如果有多个时钟的话,建议考虑一下时钟处理的问题。
-
czzheng
发布于2008-04-14 19:47:34
-
谢谢解答
我的系统确实有多个时钟,不过感觉不是跨时钟域亚稳态的问题,因为我用sinaltap看到,在这个模块内部,数据移位输出的时候已经出错了,还没有到另一个时钟域采它的时候就已经错了,应该不是跨时钟域的时钟采样出的错。
会不会跨时钟域问题没有处理好导致布局布线结果影响了这个模块出了问题?
期待高人解答啊
-
czzheng
发布于2008-04-15 19:42:11
-
自己再顶以下
期待高手指点迷津
-
wu.weihai
发布于2008-04-15 20:41:15
-
去看一下ARM芯片的时序,是不是满足
-
lxy007
发布于2008-04-15 20:55:18
-
每次都是跑三个小时左右都出错误吗?
我感觉逻辑应该没什么问题,可能是外界干扰的..
....
-
czzheng
发布于2008-04-15 23:06:58
-
ARM是模拟的方式送出时钟与数据,示波器看到,能保证上升沿的时候可靠地采到数据。
3个小时不是精确的,测了几次,每次看着的时间有3个小时,不会出错,后来放手让它跑起来,再回来看的时候已经出错了。而且由于功能的问题,出错后没办法再往后执行,只得重新下载从头开始,故不知道出错后是否固定一段时间再次出错。
继续思考,呵呵
-
wangxueyun发布于2008-04-16 09:45:46
-
学习下哦
-
czzheng
发布于2008-04-16 11:33:47
-
最新测试结果
出错之后,把之前arm发过来而接收错误的数据重新发送一遍或者几遍之后就会正确。
这能说明什么?
-
youhui
发布于2008-04-16 23:09:17
-
这种问题我遇到过, 当时是苦苦挣扎了一个多星期,属于异步源时钟问题。没有做处理。想法把整个系统工作在一个时钟下,验证。在对时钟做处理
-
jlqsczw_2007发布于2008-04-17 07:06:44
-
有点奇怪,
亚稳态不回等这么久才出现,
你再把相关的是时序设计的富裕一点,
保证采样准确,
然后逻辑控制时采用多次判断,防止误启动
-
czzheng
发布于2008-04-17 17:07:58
-
谢谢指点
我现在系统中有多个时钟,各个模块依照功能要求用各自的时钟
当初确实用1个高频时钟给各个时钟作同步,但是在仿真的时候发现有很多亚稳态的情形。
后来决定放弃不用这种方式,改用各模块用各自的时钟,在数据交互的地方用altera 自己的fifo。当然确实还存在很少几处例外的地方。莫不是就是这个地方导致的?
youhui ,您说的 异步源时钟问题 你是怎么处理的,把整个系统工作在一个时钟下 出现的亚文态怎么处理的
-
lxy007
发布于2008-04-17 19:27:14
-
..继续关注.学习中..
-
lxy007
发布于2008-04-17 19:27:35
-
建议楼主把关键代码贴出来看看...
-
czzheng
发布于2008-04-17 20:17:21
-
首先说明下:
ARM模拟方式给fpga发时钟和数据,所以时钟是不连续的。另外我不想让移位寄存器shift保存我的结果,我专门用一个寄存器dataout保存每次的转换结果,其实在这个模块里就是输出信号啦。一般情况下,8位串并转换的结果到第9个周期才能输出,所以我要得到15位的有效信号就需要16个时钟。但是由于时钟不连续,在第16个时钟要能寄存到有效数据,第15个周期就要输出转换结果。在这个模块里有效数据只有前15个时钟,在第15个时钟上升沿到第16个上升沿间输出一个周期长的数据有效信号,为的是第16个时钟在dataout_valid有效的时候将数据打到后续寄存器,后续逻辑能够得到有效而稳定的数据。
这个是最初的版本,用变量的方式作的。起初怀疑变量用的不好容易出问题,后来发现改用信号的方式做也一样。
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity s2p_16 is
port(
init:in std_logic;
clk :in std_logic;
datain :in std_logic ;
dataout_valid
ut std_logic ;
dataout
ut std_logic_vector(14 downto 0)
);
end s2p_16;
architecture a of s2p_16 is
begin
process(init,clk)
variable shift:std_logic_vector(14 downto 0);
variable num:std_logic_vector(3 downto 0);
begin
if(init='1')then
shift:=(others=>'0');
num:=(others=>'0');
dataout<=(others=>'0');
dataout_valid<='0';
elsif (clk'event and clk='1') then
if num<14 then
dataout_valid<='0';
num:=num+1;
shift(14 downto 1):=shift(13 downto 0);
shift(0):=datain;
elsif num=14 then
num:=num+1;
shift(14 downto 1):=shift(13 downto 0);
shift(0):=datain;
dataout<=shift ;
dataout_valid<='1';
elsif num=15 then
shift:=(others=>'0');
num:=(others=>'0');
dataout_valid<='0';
end if;
end if;
end process;
end a;
-
czzheng
发布于2008-04-17 20:18:46
-
这个是改用信号写的一个版本
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity s2p16 is
port(
init:in std_logic;
clk :in std_logic;
datain :in std_logic ;
dataout_valid
ut std_logic ;
dataout
ut std_logic_vector(14 downto 0)
);
end s2p16;
architecture behav of s2p16 is
signal cnt:std_logic_vector(3 downto 0);
signal shift:std_logic_vector(14 downto 0);
begin
process(init,clk)
begin
if init='1' then
cnt<=(others=>'0');
shift<=(others=>'0');
dataout_valid<='0';
dataout<=(others=>'0');
elsif rising_edge(clk) then
cnt<=cnt+1;
shift(0)<=datain;
shift(14 downto 1)<=shift(13 downto 0);
if cnt=14 then
dataout_valid<='1';
dataout<=shift(13 downto 0) & datain;
elsif cnt=15 then
shift<=(others=>'0');
cnt<=(others=>'0');
dataout_valid<='0';
end if;
end if;
end process;
end behav;
-
dlightstar
发布于2008-04-17 20:18:49
-
不是模块的问题。。。硬件问题 我曾经也被这种相似的问题搞了好几天
你的FPGA板子和ARM板在一块板子上吗?如果是2块板子 楼主可以多接2根地线试试
如果在一块板子上 看看功率是否跟得上 如果功率不够的话可能工作一段时间就会出问题的
-
czzheng
发布于2008-04-17 20:20:48
-
这个是用信号方式的另一种写法。
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity s2p_16 is
port(
init:in std_logic;
clk :in std_logic;
datain :in std_logic ;
dataout_valid
ut std_logic ;
dataout
ut std_logic_vector(14 downto 0)
);
end s2p_16;
architecture behav of s2p_16 is
signal cnt:std_logic_vector(3 downto 0);
signal shift:std_logic_vector(14 downto 0);
begin
process(init,clk)
begin
if init='1' then
cnt<=(others=>'0');
shift<=(others=>'0');
dataout_valid<='0';
dataout<=(others=>'0');
elsif rising_edge(clk) then
if cnt<14 then
cnt<=cnt+1;
shift(0)<=datain;
shift(14 downto 1)<=shift(13 downto 0);
elsif cnt=14 then
cnt<=cnt+1;
--shift(0)<=datain;
--shift(14 downto 1)<=shift(13 downto 0);
dataout_valid<='1';
dataout<=shift(13 downto 0) & datain;
elsif cnt=15 then
shift<=(others=>'0');
cnt<=(others=>'0');
dataout_valid<='0';
end if;
end if;
end process;
end behav;
-
czzheng
发布于2008-04-17 20:23:00
-
这几种模块我在quartus下用相同的激励得到的结果都是一样的。
后两种连占用资源都是一样的。
但也都是会出一样的问题。
-
czzheng
发布于2008-04-17 20:32:53
-
dlightstar:
我的是在一块板子上,板子上除了arm与fpga外还有高频头,我们也在怀疑是不是有诸如接地没接好,高频干扰等pcb问题,但是还不能确定。各方面都在找问题。
您说 电源功率不足,这个怎么判段是否供电不足呢。
我ep2c8t144c8,1.2v 2.5v 3.3v分别由1117供电,不过2.5和3.3由1117出来后还共给了其他芯片,会不会是其他模块耗电太大导致fpga共电不足?
非常想知道如何判断是否供电不足,能大概解说下么,谢了

