MemoriaSRAM Chasi Gutierrez
MemoriaSRAM Chasi Gutierrez
MemoriaSRAM Chasi Gutierrez
Diseño VLSI
NRC: 8417
Laboratorio.
TERCER PARCIAL
Preparatorio.
INTEGRANTES:
JONATHAN CHASI
JOSE GUTIERREZ
MAYO-2020
1. TEMA: - Preparatorio memoria SRAM avance.
2. OBJETIVOS:
Solucionar el problema planteado mediante lenguaje VHDL y Assembler.
Instanciar una memoria en el proyecto Picoblaze, en el cual se pueda
escribir y leer.
Presentar el diagrama de tiempo timming para los procesos de lectura y
escritura.
3. DISEÑO.
3.1. Diagrama de bloques
PICO BLAZE
CLK
CE
8
RAM
WE DQ
OE
8
A
DQ
8
3.2. Diagrama de FLUJO.
Código assembler:
ADDRESS 000
main:
INPUT S0,01
OUTPUT S0,03
INPUT S1,02
OUTPUT S1,04
JUMP main
Codigo TopModule
----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 13:42:06 06/10/2011
-- Design Name:
-- Module Name: TopModule - Behavioral
-- Project Name:
-- Target Devices:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity TopModule is
Port ( --RESET : in STD_LOGIC;
CLK_50MHz : in STD_LOGIC;
-- interrupts
INT : in STD_LOGIC;
--INT_ACK : out STD_LOGIC;
-- output data
CE_b_top : IN Std_Logic;
-- Chip Select
WE_b_top : IN Std_Logic;
-- Write Enable
OE_b_top : IN Std_Logic; -- Output Enable
A_top : IN Std_Logic_Vector(7 downto 0); -- Address Inputs
DQ_top : INOUT Std_Logic_Vector(7 downto 0):=(others=>'Z') -- Read/Write
Data
);
end TopModule;
component embedded_kcpsm3
Port ( port_id : out std_logic_vector(7 downto 0);
write_strobe : out std_logic;
read_strobe : out std_logic;
out_port : out std_logic_vector(7 downto 0);
in_port : in std_logic_vector(7 downto 0);
interrupt : in std_logic;
interrupt_ack : out std_logic;
reset : in std_logic;
clk : in std_logic);
end component;
signal wr_stb : std_logic;
signal rd_stb : std_logic;
signal port_id : std_logic_vector(7 downto 0);
signal out_port: std_logic_vector(7 downto 0);
signal in_port : std_logic_vector(7 downto 0);
signal mem_addr : std_logic_vector(7 downto 0);
signal data_to_memory : std_logic_vector(7 downto 0);
signal data_from_memory : std_logic_vector(7 downto 0);
signal wr_en : std_logic;
signal mem_en : std_logic;
signal in_proc : std_logic_vector(7 downto 0);
signal out_proc : std_logic_vector(7 downto 0);
signal add_aux : std_logic_vector(7 downto 0);
signal auxi : std_logic_vector(7 downto 0);
signal auxo : std_logic_vector(7 downto 0);
signal auxDQ : std_logic_vector(7 downto 0);
signal aux_w : std_logic_vector(7 downto 0);
signal aux_r : std_logic_vector(7 downto 0);
begin
-- instantiation
Processor: embedded_kcpsm3
port map(
port_id => port_id,
write_strobe => wr_stb,
read_strobe => rd_stb,
out_port => out_port,
in_port => in_port,
interrupt => INT,
--interrupt_ack => INT_ACK,
reset => '0', --RESET,
clk => CLK_50MHz
);
input_ports: process (port_id)
begin
case port_id is
when "00000001" => in_port <= "0000000" & WE_b_top ;
when "00000010" => in_port <= "0000000" & OE_b_top;
--when "00011001" => in_port <= in_proc;
when others => auxi <= "XXXXXXXX";
end case;
end process input_ports;
output_ports: process(port_id)
begin
case port_id is
when "00000011" => aux_w <= out_port;
when "00000100" => aux_r <= out_port;
when others => auxo <= "XXXXXXXX";
-- out_proc <= "XXXXXXXX";
end case;
end process output_ports;
U1: CY7C1062_0 port map(CE_b_top,aux_w(0),aux_r(0),A_top,DQ_top);
end Behavioral;
Codigo Testbench:
--------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 15:27:30 08/31/2020
-- Design Name:
-- Module Name: C:/Users/jona0/Desktop/Primera Parte/picoblaze_2020/TEST1M.vhd
-- Project Name: PicoBlaze_ExtMemory
-- Target Device:
-- Tool versions:
-- Description:
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY TEST1M IS
END TEST1M;
COMPONENT TopModule
PORT(
CLK_50MHz : IN std_logic;
INT : IN std_logic;
CE_b_top: IN std_logic;
WE_b_top : IN std_logic;
OE_b_top : IN std_logic;
A_top : IN std_logic_vector(7 downto 0);
DQ_top : INOUT std_logic_vector(7 downto 0)
);
END COMPONENT;
--Inputs
signal CLK_50MHz : std_logic := '0';
signal INT : std_logic := '0';
signal CE_b_top : std_logic := '0';
signal WE_b_top : std_logic := '0';
signal OE_b_top : std_logic := '1';
signal A_top : std_logic_vector(7 downto 0) := (others => '0');
--BiDirs
signal DQ_top : std_logic_vector(7 downto 0);
BEGIN
-- Stimulus process
stim_proc: process
begin
-- hold reset state for 100 ns.
wait for 1 ns;
wait;
end process;
stim_proc1: process
begin
-- hold reset state for 100 ns.
--wait for 250 ns;
--OE_b_top <= '1';
--DQ_top <= "ZZZZZZZZ";
--Selector_top <= "00";
--wait for 50 ns;
CE_b_top <= '0';
WE_b_top <= '0';
A_top <= "00000000";
DQ_top <= X"0F";
wait for 50 ns;
WE_b_top <= '1';
CE_b_top <= '1';
DQ_top <= "ZZZZZZZZ";
wait for 50 ns;
--Selector_top <= "01";
CE_b_top <= '0';
WE_b_top <= '0';
A_top <= "00000001";
DQ_top <= X"F0";
wait for 50 ns;
WE_b_top <= '1';
CE_b_top<= '1';
DQ_top <= "ZZZZZZZZ";
DQ_top <= X"F0";
wait for 50 ns;
WE_b_top <= '1';
CE_b_top<= '1';
DQ_top <= "ZZZZZZZZ";
wait for 50 ns;
--Selector_top <= "10";
CE_b_top <= '0';
WE_b_top <= '0';
A_top <= "00000010";
DQ_top <= X"FF";
wait for 50 ns;
WE_b_top <= '1';
CE_b_top <= '1';
DQ_top <= "ZZZZZZZZ";
wait for 50 ns;
--Selector_top <= "11";
CE_b_top <= '0';
WE_b_top <= '0';
A_top <= "00000011";
DQ_top <= X"00";
wait for 50 ns;
WE_b_top <= '1';
CE_b_top <= '1';
DQ_top <= "ZZZZZZZZ";
wait for 500 ns;
--Selector_top <= "00";
CE_b_top <= '0';
OE_b_top <= '0';
A_top <= "00000000";
--DQ_top <= "ZZZZZZZZ";
wait for 50 ns;
OE_b_top <= '1';
CE_b_top <= '1';
wait for 50 ns;
--Selector_top <= "01";
CE_b_top <= '0';
OE_b_top <= '0';
A_top <= "00000001";
wait for 50 ns;
OE_b_top <= '1';
CE_b_top <= '1';
wait for 50 ns;
--Selector_top <= "10";
CE_b_top <= '0';
OE_b_top <= '0';
A_top <= "00000010";
wait for 50 ns;
OE_b_top <= '1';
CE_b_top <= '1';
wait for 50 ns;
--Selector_top <= "10";
CE_b_top <= '0';
OE_b_top <= '0';
A_top <= "00000011";
wait for 50 ns;
OE_b_top <= '1';
CE_b_top <= '1';
Simulación:
wait;
end process;
END;
I LUSTRACIÓN 1 E SCRITURA SOLO DE UNA MEMORIA
Preparatorio- Corregido
Código Testbench:
--------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 15:27:30 08/31/2020
-- Design Name:
-- Module Name: C:/Users/jona0/Desktop/Primera Parte/picoblaze_2020/TEST1M.vhd
-- Project Name: PicoBlaze_ExtMemory
-- Target Device:
-- Tool versions:
-- Description:
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
--USE ieee.numeric_std.ALL;
ENTITY TEST1M IS
END TEST1M;
COMPONENT TopModule
PORT(
CLK_50MHz : IN std_logic;
INT : IN std_logic;
CE_b_top: IN std_logic;
WE_b_top : IN std_logic;
OE_b_top : IN std_logic;
A_top : IN std_logic_vector(7 downto 0);
DQ_top : INOUT std_logic_vector(7 downto 0)
);
END COMPONENT;
--Inputs
signal CLK_50MHz : std_logic := '0';
signal INT : std_logic := '0';
signal CE_b_top : std_logic := '0';
signal WE_b_top : std_logic := '0';
signal OE_b_top : std_logic := '1';
signal A_top : std_logic_vector(7 downto 0) := (others => '0');
--BiDirs
signal DQ_top : std_logic_vector(7 downto 0);
BEGIN
-- Stimulus process
stim_proc: process
begin
-- hold reset state for 100 ns.
wait for 20 ns;
wait;
end process;
stim_proc1: process
begin
-- hold reset state for 100 ns.
wait for 250 ns;
OE_b_top <= '1';
DQ_top <= "ZZZZZZZZ";
--Selector_top <= "00";
wait for 50 ns;
CE_b_top <= '0';
WE_b_top <= '0';
A_top <= "00000000";
DQ_top <= X"0F";
wait for 50 ns;
WE_b_top <= '1';
CE_b_top <= '1';
DQ_top <= "ZZZZZZZZ";
wait for 50 ns;
--Selector_top <= "01";
CE_b_top <= '0';
WE_b_top <= '0';
A_top <= "00000001";
DQ_top <= X"F0";
wait for 50 ns;
WE_b_top <= '1';
CE_b_top<= '1';
DQ_top <= "ZZZZZZZZ";
wait for 50 ns;
--Selector_top <= "10";
CE_b_top <= '0';
WE_b_top <= '0';
A_top <= "00000010";
DQ_top <= X"FF";
wait for 50 ns;
WE_b_top <= '1';
CE_b_top <= '1';
DQ_top <= "ZZZZZZZZ";
wait for 50 ns;
--Selector_top <= "11";
CE_b_top <= '0';
WE_b_top <= '0';
A_top <= "00000011";
DQ_top <= X"00";
wait for 50 ns;
WE_b_top <= '1';
CE_b_top <= '0';
OE_b_top <= '0';
--DQ_top <= "ZZZZZZZZ";
wait for 250 ns;
--Selector_top <= "00";
CE_b_top <= '0';
OE_b_top <= '0';
A_top <= "00000000";
DQ_top <= "ZZZZZZZZ";
wait for 50 ns;
OE_b_top <= '1';
CE_b_top <= '1';
wait for 50 ns;
--Selector_top <= "01";
CE_b_top <= '0';
OE_b_top <= '0';
A_top <= "00000001";
wait for 50 ns;
OE_b_top <= '1';
CE_b_top <= '1';
wait for 50 ns;
--Selector_top <= "10";
CE_b_top <= '0';
OE_b_top <= '0';
A_top <= "00000010";
wait for 50 ns;
OE_b_top <= '1';
CE_b_top <= '1';
wait for 50 ns;
--Selector_top <= "10";
CE_b_top <= '0';
OE_b_top <= '0';
A_top <= "00000011";
wait for 50 ns;
OE_b_top <= '1';
CE_b_top <= '1';
wait;
end process;
END;
El codigo top module que se realizó en la primera parte es el mismo en este caso ya que el
problema que se tenía en la lectura de la memoria era únicamente los tiempos de lectura y
escritura que se realizó en el testbench por lo cual se corrigió los tiempos y se obtuvo los
resultados correctos como lo podemos visualizar en las siguientes ilustraciones que
representan las simulaciones del trabajo.
Simulaciones:
Adjunto a estas ilustraciones podemos observar cómo se guardó los datos en la memoria
mediante la ilustración 6.
I LUSTRACIÓN 6 MEMORIA
3.4. Diagrama timming