以下是代码
p_reg2:process(S_Lclk,reset)
begin
if (reset='0') then
state1<=0;
S_ccs<='Z';
S_ads_o<='Z';
S_blast_o<='Z';
S_wr_o<='Z';
S_la_o<=(others=>'Z');
S_command<=(others=>'Z');
S_command_en<='1';
elsif rising_edge (S_Lclk) then
case state1 is
when 0 =>
if S_PCI_usero='0' then
S_ads_o<='1';
state1<=1;
else
S_ccs<='Z';
S_ads_o<='Z';
S_blast_o<='Z';
S_wr_o<='Z';
S_la_o<=(others=>'Z');
S_command<=(others=>'Z');
S_command_en<='1';
end if;
when 1 =>
S_ccs<='0';
S_ads_o<='0';
S_wr_o<='0';
S_la_o<=G_C8;
state1<=2;
when 2 =>
S_ccs<='Z';
S_ads_o<='1';
S_blast_o<='0';
state1<=3;
when 3 =>
S_ccs<='Z';
state1<=4;
when 4=>
if S_ready_i='0' then
S_command<=pci_ld;
S_command_en<='0';
state1<=5;
else
null;
end if;
when 5=>
state1<=6;
when 6 =>
if S_PCI_usero='1' then
S_command_en<='1';
state1<=0;
else
null;
end if;
S_blast_o<='Z';
S_wr_o<='Z';
S_ads_o<='Z';
when others =>
state1<=0;
问题解决了!
将状态机中外部的信号和它的时钟进行了一下同步
p_reg2_1: process(S_Lclk)
begin
if rising_edge(S_Lclk) then
S_PCI_usero<=PCI_usero;
S_ready_i<=ready;
else
null;
end if;
问题就解决了!