关于VHDL元件例化语句port map语法报错的问题
libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;useieee.std_log...
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity miaobiao is
port(
stop,start,clk,clk1:in std_logic;
led: out std_logic_vector(6 downto 0);
sel:out std_logic_vector(6 downto 0);
q: out std_logic);
end entity miaobiao;
architecture a of miaobiao is
component count10--十进制计数器
port(clk,clr,start:in std_logic;
cout:out std_logic;
daout:out std_logic_vector(3 downto 0));
end component;
component seltime--数据选择模块
port(
clk,clr: in std_logic;
dain1,dain2,dain3,dain4,dain5,dain6:in std_logic_vector(3 downto 0);
daout: out std_logic_vector(3 downto 0);
sel: out std_logic_vector(2 downto 0)
);
end component;
component deled---译码器模块
port(
num: in std_logic_vector(3 downto 0);
led: out std_logic_vector(6 downto 0)
);
end component;
component alarm--蜂鸣报警模块
port(
clk,i:in std_logic;
q:out std_logic
);
end component;
component count6--六进制计数器
port(
clk,clr,start:in std_logic;
cout:out std_logic;
daout:out std_logic_vector(3 downto 0)
);
end component;
signal s100,s10,s ,ts,m,tm: std_logic_vector(3 downto 0);
signal cout: std_logic_vector(5 downto 0);
signal sdout: std_logic_vector(3 downto 0);
begin
u0: count10 port map(clk=>clk,clr=>stop,start=>start,cout(0),s100);
u1: count10 port map (clk=>cout(0),stop,start,cout(1),s10);
u2: count10 port map (cout(1),stop,start,cout(2),s);
u3: count6 port map (cout(2), stop, start, cout (3),ts);
u4: count10 port map (cout (3), stop, start, cout (4),m);
u5: count6 port map (cout (4), stop, start, cout (5),tm);
u6:seltime port map (clk1,stop,s100,s10,s,ts,m,tm,sdout,sel);
u7:deled port map (sdout,led);
u8:alarm port map (clk, cout (5),q);
end architecture a;
出现错误:Error (10437): VHDL Association List error at miaobiao.vhd(50): positional associations must be listed before named associations
请高手指教 展开
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity miaobiao is
port(
stop,start,clk,clk1:in std_logic;
led: out std_logic_vector(6 downto 0);
sel:out std_logic_vector(6 downto 0);
q: out std_logic);
end entity miaobiao;
architecture a of miaobiao is
component count10--十进制计数器
port(clk,clr,start:in std_logic;
cout:out std_logic;
daout:out std_logic_vector(3 downto 0));
end component;
component seltime--数据选择模块
port(
clk,clr: in std_logic;
dain1,dain2,dain3,dain4,dain5,dain6:in std_logic_vector(3 downto 0);
daout: out std_logic_vector(3 downto 0);
sel: out std_logic_vector(2 downto 0)
);
end component;
component deled---译码器模块
port(
num: in std_logic_vector(3 downto 0);
led: out std_logic_vector(6 downto 0)
);
end component;
component alarm--蜂鸣报警模块
port(
clk,i:in std_logic;
q:out std_logic
);
end component;
component count6--六进制计数器
port(
clk,clr,start:in std_logic;
cout:out std_logic;
daout:out std_logic_vector(3 downto 0)
);
end component;
signal s100,s10,s ,ts,m,tm: std_logic_vector(3 downto 0);
signal cout: std_logic_vector(5 downto 0);
signal sdout: std_logic_vector(3 downto 0);
begin
u0: count10 port map(clk=>clk,clr=>stop,start=>start,cout(0),s100);
u1: count10 port map (clk=>cout(0),stop,start,cout(1),s10);
u2: count10 port map (cout(1),stop,start,cout(2),s);
u3: count6 port map (cout(2), stop, start, cout (3),ts);
u4: count10 port map (cout (3), stop, start, cout (4),m);
u5: count6 port map (cout (4), stop, start, cout (5),tm);
u6:seltime port map (clk1,stop,s100,s10,s,ts,m,tm,sdout,sel);
u7:deled port map (sdout,led);
u8:alarm port map (clk, cout (5),q);
end architecture a;
出现错误:Error (10437): VHDL Association List error at miaobiao.vhd(50): positional associations must be listed before named associations
请高手指教 展开
4个回答
展开全部
port map() 中的 你采用了混合关联方式(u0,u1),位置关联方式必须放在名字关联方式的前面
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
双击错误定位一下错误发生位置。我猜应该是在u0和u1这两行。位置关联和名称关联不要混用。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
VHDL里面的循环只能用在process里面吧,因为loop循环是顺序语句,顺序语句是用在进程里面的
你可以在toubi中设一个使能端口,然后在进程里面循环,通过控制使能端口来控制toubi的使用,,,,
你可以在toubi中设一个使能端口,然后在进程里面循环,通过控制使能端口来控制toubi的使用,,,,
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询