|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
本帖最后由 american007 于 2022-5-26 10:46 编辑
请教大家,vhdl状态机如何实现,在两个状态 执行同一个动作,类似下面
process(resetn, clk,spot_poll_up)-----third segment
begin
if(resetn = '0')then
cnt <= (others => '0');
elsif(rising_edge(clk))then
case pr_state is
when idle_st =>
................
when function1_cmd1_st =>
................
when function1_cmd2_st =>
................
when function1_cmd3_st =>
cnt <= cnt + 1;
---------------------------------------------------
when function2_cmd1_st =>
................
when function2_cmd2_st =>
................
when function2_cmd3_st =>
cnt <= cnt + 1;
---------------------------------------------------
when others =>
end case ;
end if ;
end process;
想实现类似下面的效果 when function1_cmd2_st and function2_cmd2_st=>
请教大家,vhdl状态机如何实现,在两个状态 执行同一个动作,类似下面
process(resetn, clk,spot_poll_up)-----third segment
begin
if(resetn = '0')then
cnt <= (others => '0');
elsif(rising_edge(clk))then
case pr_state is
when idle_st =>
................
when function1_cmd1_st =>
................
when function1_cmd2_st =>
cnt <= cnt + 1;
when function1_cmd3_st =>
................
---------------------------------------------------
when function2_cmd1_st =>
................
when function2_cmd2_st =>
cnt <= cnt + 1;
when function2_cmd3_st =>
................
---------------------------------------------------
when others =>
end case ;
end if ;
end process;
想实现类似下面的效果 when function1_cmd2_st or function2_cmd2_st=>
cnt <= cnt +1;
即: 在function1_cmd2_st 或 function2_cmd2_st 两个状态,都分别会去执行cnt +1 这个操作,从形式上,把 cnt <= cnt +1; 写在一个位置,而不是两个位置
|
|