集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 3110|回复: 1

VHDL程序改错——wait语句

[复制链接]
小泡泡 发表于 2010-4-23 12:22:38 | 显示全部楼层 |阅读模式
PACKAGE types IS
SUBTYPE nat8 is integer RANGE 255 DOWNTO 0;
END types;

USE work.types.all;

ENTITY gcd IS
PORT(reset : IN bit; -- Global reset
clk : IN bit; -- Global clock
rst : IN boolean;
xin : IN nat8;
yin : IN nat8;
rdy : OUT boolean;
oup : OUT nat8);
END gcd;

ARCHITECTURE algorithm OF gcd IS
BEGIN
gcd: PROCESS
VARIABLE x : nat8;
VARIABLE y : nat8;
VARIABLE h : nat8;
BEGIN

rdy <= true;
oup <= 0;

RESET_LOOP : LOOP

WAIT UNTIL clk = '1'; EXIT RESET_LOOP WHEN reset = '1';

WHILE (rst = true) LOOP
x := xin;
y := yin;
WAIT UNTIL clk = '1'; EXIT RESET_LOOP WHEN reset = '1';
END LOOP;

rdy <= false;
oup <= 0;

IF (x /= 0) AND (y /= 0) THEN
WHILE (y /= 0) LOOP
WHILE (x >= y) LOOP
WAIT UNTIL clk = '1'; EXIT RESET_LOOP WHEN reset = '1';
x := x - y;
END LOOP;
h := x; x := y; y := h;
END LOOP;
END IF;

rdy <= true;
oup <= x;

END LOOP RESET_LOOP;

END PROCESS gcd;
END algorithm;
==================================================
Process Statement must contain only one Wait Statement

说是不能用两个wait
改了很多次都有错误
哪位大虾帮帮忙
把这个程序改一下
如果能运行无错
fpga_feixiang 发表于 2024-8-9 14:20:45 | 显示全部楼层
6                        
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

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

QQ|小黑屋|手机版|Archiver|fpga论坛|fpga设计论坛 ( 京ICP备20003123号-1 )

GMT+8, 2024-11-23 12:32 , Processed in 0.057527 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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