library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity sram_fsm is
port ( reset : in std_logic;
read_write : in std_logic;
ready : in std_logic;
burst : in std_logic;
clk : in std_logic;
bus_id : in std_logic_vector(7 downto 0);
oe : out std_logic;
we : out std_logic;
addr : out std_logic_vector(1 downto 0));
end sram_fsm;
architecture Behavioral of sram_fsm is
type StateType is (idle, decision, read1, read2, read3, read4, write);
signal present_state, next_state: StateType;
begin
state_clocked: process(clk)
begin
if rising_edge(clk) then
present_state <= next_state;
end if;
end process state_clocked;
state_com: process(reset, bus_id, present_state, burst, read_write, ready)
begin
if (reset = '1') then 每- synchronous reset
oe <= '-';
we <= '-';
addr <= "--";
next_state <= idle;
else
case present_state is
when idle =>
oe <= '0';
we <= '0';
addr <= "00";
if (bus_id = "11110011") then
next_state <= decision;
else
next_state <= idle;
end if;
when decision =>
oe <= '0';
we <= '0';
addr <= "00";
if (read_write = '1') then
next_state <= read1;
else
next_state <= write;
end if;
when read1 =>
oe <= '1';
we <= '0';
addr <= "00";
if (ready = '0') then
next_state <= read1;
elsif (burst = '0') then
next_state <= idle;
else
next_state <= read2;
end if;
when read2 =>
oe <= '1';
we <= '0';
addr <= "01";
if (ready = '1') then
next_state <= read3;
else
next_state <= read2;
end if;
when read3 =>
oe <= '1';
we <= '0';
addr <= "10";
if (ready = '1') then
next_state <= read4;
else
next_state <= read3;
end if;
when read4 =>
oe <= '1';
we <= '0';
addr <= "11";
if (ready = '1') then
next_state <= idle;
else
next_state <= read4;
end if;
when write =>
oe <= '0';
we <= '1';
addr <= "00";
if (ready = '1') then
next_state <= idle;
else
next_state <= write;
end if;
end case;
end if;
end process state_com;
end architecture Behavioral;
SRAM.rar_FSM bubble diagram_SRAM FSM_SRAM controller F_The Given
版权申诉
143 浏览量
2022-09-22
20:47:54
上传
评论
收藏 738B RAR 举报
寒泊
- 粉丝: 75
- 资源: 1万+
最新资源
- Python 手写实现 iD3 决策树算法-根据信息增益公式.zip
- 411675952289057车联助手-小窗版(三星)3.5.1.apk
- 三种快速排序方法合并在一个文件中以便直接运行的Python代码示例
- 937712277954201实习5.word
- 2程序语言基础知识pdf1_1716337722703.jpeg
- 简单的Python示例,演示了如何使用TCP/IP协议进行基本的客户端和服务器通信
- 考试.sql
- keil2 + proteus + 8051.exe
- 1961ee27df03bd4595d28e24b00dde4e_744c805f7e4fb4d40fa3f695bfbab035_8(1).c
- mediapipe-0.9.0.1-cp37-cp37m-win-amd64.whl.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0