Line 1... |
Line 1... |
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
-- TITLE: Test Bench
|
-- TITLE: Test Bench
|
-- AUTHOR: Steve Rhoads (rhoadss@yahoo.com)
|
-- AUTHOR: Steve Rhoads (rhoadss@yahoo.com)
|
-- DATE CREATED: 4/21/01
|
-- DATE CREATED: 4/21/01
|
-- FILENAME: tbench.vhd
|
-- FILENAME: tbench.vhd
|
-- PROJECT: MIPS CPU core
|
-- PROJECT: M-lite CPU core
|
-- COPYRIGHT: Software placed into the public domain by the author.
|
-- COPYRIGHT: Software placed into the public domain by the author.
|
-- Software 'as is' without warranty. Author liable for nothing.
|
-- Software 'as is' without warranty. Author liable for nothing.
|
-- DESCRIPTION:
|
-- DESCRIPTION:
|
-- This entity provides a test bench for testing the MIPS CPU core.
|
-- This entity provides a test bench for testing the M-lite CPU core.
|
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
use work.mips_pack.all;
|
use work.mlite_pack.all;
|
|
|
entity tbench is
|
entity tbench is
|
end; --entity tbench
|
end; --entity tbench
|
|
|
architecture logic of tbench is
|
architecture logic of tbench is
|
|
|
component mips_cpu
|
component mlite_cpu
|
port(clk : in std_logic;
|
port(clk : in std_logic;
|
reset_in : in std_logic;
|
reset_in : in std_logic;
|
intr_in : in std_logic;
|
intr_in : in std_logic;
|
|
|
mem_address : out std_logic_vector(31 downto 0);
|
mem_address : out std_logic_vector(31 downto 0);
|
Line 54... |
Line 54... |
clk <= not clk after 50 ns;
|
clk <= not clk after 50 ns;
|
reset <= '0' after 320 ns;
|
reset <= '0' after 320 ns;
|
mem_pause <= '0';
|
mem_pause <= '0';
|
|
|
--Uncomment the line below to test interrupts
|
--Uncomment the line below to test interrupts
|
-- interrupt <= '1' after 10 us when interrupt = '0' else '0' after 600 ns;
|
-- interrupt <= '1' after 20 us when interrupt = '0' else '0' after 400 ns;
|
|
|
u1: mips_cpu PORT MAP (
|
u1: mlite_cpu PORT MAP (
|
clk => clk,
|
clk => clk,
|
reset_in => reset,
|
reset_in => reset,
|
intr_in => interrupt,
|
intr_in => interrupt,
|
|
|
mem_address => mem_address,
|
mem_address => mem_address,
|