VHDL中的port map用后,仿真管脚不是想要的效果?

cwhe_10 2014-05-15 12:30:27
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity bisou is
port(a:in std_logic;
b:in std_logic;
y1:out std_logic);
end bisou;
architecture bisou of bisou is
signal u:std_logic_vector(1 downto 0);
begin
u(0)<=a;
u(1)<=b;
y1<='1' when u="10" else
'0' when u="01" else
'Z';
end bisou;

library ieee; --u2 start
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity bisou2 is
port(clk:in std_logic;
b:in std_logic;
y1:out std_logic;
y2:buffer std_logic);
end bisou2;
architecture bisou2 of bisou2 is
SIGNAL cnt1 : std_logic_vector(10 DOWNTO 0); --shu chu gei bell
SIGNAL cnt2 : std_logic_vector(14 DOWNTO 0); --yan shi 2s hou reset=0
signal fr_low: std_logic;
signal fr_high: std_logic;
begin
y1<=fr_low;
y2<=fr_high;
u2:process(b,clk)
begin
if b='0' then cnt1<="00000000000";
elsif (clk'event and clk='1') then
if cnt1="11111111111" then cnt1<="00000000000";
else cnt1<=cnt1+'1';
end if;
end if;
end process u2;

u3:process(b,clk)
begin
if b='0' then cnt2<="000000000000000";
elsif (clk'event and clk='1') then
if cnt2="111111111111111" then cnt2<="000000000000000";
else cnt2<=cnt2+'1';
end if;
end if;
end process u3;

u4:process(cnt1)
begin
if cnt1="11111111111" then fr_low<=not fr_low;
end if;
end process u4;

u5:process(cnt2,cnt1)
begin
if cnt2="111111111111111" then
y1<='1';
cnt2<="000000000000000";
cnt1<="00000000000";
else y2<='0';
end if;
end process u5;
end bisou2; --u2 end

library ieee; --u2+u1 start
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity bisou3 is
port(clk:in std_logic;
a:in std_logic;
y1:out std_logic);
end bisou3;
architecture bisou3 of bisou3 is
signal temp1,temp2:std_logic;
component bisou
port(a:in std_logic;
b:in std_logic;
y:out std_logic);
end component;

component bisou2
port(clk:in std_logic;
b:in std_logic;
y1:out std_logic;
y2:buffer std_logic);
end component;
begin
u0:bisou port map(a,temp2,temp1);
u1:bisou2 port map(clk,temp1,y1,temp2);
end bisou3;
进行仿真时,仿真的管脚总是第一个实体的管脚(a,b,y),而不是我要的第三个实体的管脚号(clk,a,y1),这是为什么呢?
...全文
358 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
cauc_guidian 2014-05-16
  • 打赏
  • 举报
回复
最好是将三个组件分开成三个。vhf文件,最后新建文件时选择填加另外两个组件来完成功能

6,163

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 硬件设计
社区管理员
  • 硬件设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧