BlinkenArea - GitList
Repositories
Blog
Wiki
mips_sys
Code
Commits
Branches
Tags
Search
Tree:
902aa40
Branches
Tags
master
mips_sys
io
leds.vhd
replace email address in headers with blinkenarea address
Stefan Schuermans
commited
902aa40
at 2012-05-21 17:42:50
leds.vhd
Blame
History
Raw
-- MIPS I system -- Copyright 2011-2012 Stefan Schuermans <stefan@blinkenarea.org> -- Copyleft GNU public license V2 or later -- http://www.gnu.org/copyleft/gpl.html LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.NUMERIC_STD.ALL; ENTITY e_io_leds IS PORT ( rst: IN std_logic; clk: IN std_logic; o_rd_data: OUT std_logic_vector(7 DOWNTO 0); i_wr_data: IN std_logic_vector(7 DOWNTO 0); i_wr_en: IN std_logic; pin_o_leds: OUT std_logic_vector(7 DOWNTO 0) ); END ENTITY e_io_leds; ARCHITECTURE a_io_leds OF e_io_leds IS SIGNAL n_leds: std_logic_vector(7 DOWNTO 0); SIGNAL r_leds: std_logic_vector(7 DOWNTO 0) := (OTHERS => '0'); BEGIN p_next: PROCESS(r_leds, i_wr_data, i_wr_en) BEGIN IF i_wr_en = '1' THEN n_leds <= i_wr_data; ELSE n_leds <= r_leds; END IF; END PROCESS p_next; p_sync: PROCESS(rst, clk) BEGIN IF rst = '1' THEN r_leds <= (OTHERS => '0'); ELSIF rising_edge(clk) THEN r_leds <= n_leds; END IF; END PROCESS p_sync; p_read: PROCESS(rst, clk) BEGIN IF rst = '1' THEN o_rd_data <= (OTHERS => '0'); ELSIF rising_edge(clk) THEN o_rd_data <= r_leds; END IF; END PROCESS p_read; pin_o_leds <= r_leds; END ARCHITECTURE a_io_leds;