Line 9... |
Line 9... |
|
|
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_arith.all;
|
use ieee.std_logic_arith.all;
|
use ieee.std_logic_unsigned.all;
|
use ieee.std_logic_unsigned.all;
|
|
use work.mips_pkg.all; -- Only needed if port debug_info is not OPEN
|
|
|
-- FPGA i/o for Terasic DE-1 board
|
-- FPGA i/o for Terasic DE-1 board
|
-- (Many of the board's i/o devices will go unused in this demo)
|
-- (Many of the board's i/o devices will go unused in this demo)
|
entity c2sb_demo is
|
entity c2sb_demo is
|
port (
|
port (
|
Line 165... |
Line 166... |
signal mpu_sram_data_rd : std_logic_vector(15 downto 0);
|
signal mpu_sram_data_rd : std_logic_vector(15 downto 0);
|
signal mpu_sram_data_wr : std_logic_vector(15 downto 0);
|
signal mpu_sram_data_wr : std_logic_vector(15 downto 0);
|
signal mpu_sram_byte_we_n : std_logic_vector(1 downto 0);
|
signal mpu_sram_byte_we_n : std_logic_vector(1 downto 0);
|
signal mpu_sram_oe_n : std_logic;
|
signal mpu_sram_oe_n : std_logic;
|
|
|
|
signal debug_info : t_debug_info;
|
|
|
-- Converts hex nibble to 7-segment
|
-- Converts hex nibble to 7-segment
|
-- Segments ordered as "GFEDCBA"; '0' is ON, '1' is OFF
|
-- Segments ordered as "GFEDCBA"; '0' is ON, '1' is OFF
|
function nibble_to_7seg(nibble : std_logic_vector(3 downto 0))
|
function nibble_to_7seg(nibble : std_logic_vector(3 downto 0))
|
return std_logic_vector is
|
return std_logic_vector is
|
begin
|
begin
|
Line 220... |
Line 223... |
sram_oe_n => mpu_sram_oe_n,
|
sram_oe_n => mpu_sram_oe_n,
|
|
|
uart_rxd => rxd,
|
uart_rxd => rxd,
|
uart_txd => txd,
|
uart_txd => txd,
|
|
|
|
debug_info => debug_info,
|
|
|
clk => clk,
|
clk => clk,
|
reset => reset
|
reset => reset
|
);
|
);
|
|
|
|
|
Line 268... |
Line 273... |
io_rd_data(31 downto 22) <= switches;
|
io_rd_data(31 downto 22) <= switches;
|
|
|
|
|
|
|
-- red leds (light with '1') -- some CPU control signals
|
-- red leds (light with '1') -- some CPU control signals
|
red_leds(0) <= '0';
|
red_leds(0) <= debug_info.cache_enabled;
|
red_leds(1) <= '0';
|
red_leds(1) <= debug_info.unmapped_access;
|
red_leds(2) <= '0';
|
red_leds(2) <= '0';
|
red_leds(3) <= '0';
|
red_leds(3) <= '0';
|
red_leds(4) <= '0';
|
red_leds(4) <= '0';
|
red_leds(5) <= '0';
|
red_leds(5) <= '0';
|
red_leds(6) <= '0';
|
red_leds(6) <= '0';
|