集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 7135|回复: 10

process进程内外的串行并行?

[复制链接]
UFP 发表于 2010-6-27 22:09:53 | 显示全部楼层 |阅读模式
我是个新手,想请教各位达人一个关于process进程内外的串行并行的问题。
在两个不同的process进程中的程序是并行的,那么在同一个process进程内部几条程序是并行还是串行?
例如:
P1:process(clk,reset)
begin
   if reset = '0' then
    s1 <= '0' ;
   elsif (clk'event and clk='1') then
    s1 <= PIn ;           --PIn为输入信号      
   end if ;
end process P1;

P2:process(clk,reset,s1)
  begin
  if reset = '0' then
   s2 <= '0' ;
  elsif (clk'event and clk='1') then
   s2 <= s1 ;
  end if ;
end process P2;

process(clk,reset,s1)
begin
   if reset = '0' then
    s1 <= '0' ;
    s2 <= '0' ;
   elsif (clk'event and clk='1') then
    s1 <= PIn ;
    s2 <= s1;
   end if ;
end process ;

在s2获得s1的时间上是不是存在差异?
UFO 发表于 2010-6-27 23:25:13 | 显示全部楼层
两段程序的效果完全一致,在s2获得s1的时间上不存在差异,<br>
你可以通过仿真(时序)去验证呀
CTT 发表于 2010-6-28 00:05:55 | 显示全部楼层
楼上的验证过了吗?<br>
因为前一段程序可以实现用2个D触发器进行1个时钟周期信号延时的效果,后面的可以吗?
CTT 发表于 2010-6-28 00:52:19 | 显示全部楼层
当然可以啦!下面的程序还可以实现4个时钟周期信号延时的效果呢!<br>
<br>
process(clk,reset )<br>
begin <br>
&nbsp; &nbsp;&nbsp; &nbsp;if reset = '0' then<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; a &lt;= '0' ;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; b &lt;= '0' ;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; c &lt;= '0' ;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; d &lt;= '0' ;<br>
&nbsp; &nbsp;&nbsp; &nbsp; elsif (clk'event and clk='1') then<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; a &lt;= PIn ;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; b &lt;= a&nbsp;&nbsp;;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; c &lt;= b&nbsp;&nbsp;;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; d &lt;= c&nbsp;&nbsp;;<br>
&nbsp; &nbsp;&nbsp; &nbsp; end if ;<br>
end process ;<br>
<br>
[ 本帖最后由 dianzi 于 2007-2-27 11:45 编辑 ]
ANG 发表于 2010-6-28 02:32:51 | 显示全部楼层
应该是可以的。<br>
因为信号的赋值需要经过延时,信号值的更新不能立刻为下一个赋值语句所用,下一个赋值语句得到的是前一个赋值语句上一态的值。如果是变量就不同了。
interige 发表于 2010-6-28 04:27:28 | 显示全部楼层
原帖由 luyeallen 于 2007-2-27 12:02 发表<br>
应该是可以的。<br>
因为信号的赋值需要经过延时,信号值的更新不能立刻为下一个赋值语句所用,下一个赋值语句得到的是前一个赋值语句上一态的值。如果是变量就不同了。 所说极是,<br>
<br>
显然上面的程序中使用的都是信号,因为没有看见在进程中定义变量,那么它们只能是在结构体中定义的信号了。<br>
<br>
LZ需要搞清楚变量和信号之间的差别
usd 发表于 2010-6-28 05:29:35 | 显示全部楼层
谢谢!楼上的兄弟们!<br>
那么是不是说,如果是进程内部定义的变量,就不可能实现这个D触发器的延时?只有信号才可以?
CHANG 发表于 2010-6-28 06:10:41 | 显示全部楼层
对了还有个问题!<br>
信号是不占用寄存器资源的吧?那它会占用些什么呢?<br>
CPLD中的寄存器资源一般有哪几种使用方式?
ngtim 发表于 2010-6-28 07:30:28 | 显示全部楼层
******。。。。。。。。。。。。。。。
ANG 发表于 2010-6-28 08:15:59 | 显示全部楼层
学习中。。。。
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

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

QQ|小黑屋|手机版|Archiver|集成电路技术分享 ( 京ICP备20003123号-1 )

GMT+8, 2024-5-1 02:13 , Processed in 0.077179 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表