[Armadeus-commitlog] SF.net SVN: armadeus:[1116] trunk/firmware/leds
Brought to you by:
sszy
|
From: <Fa...@us...> - 2009-03-05 11:22:57
|
Revision: 1116
http://armadeus.svn.sourceforge.net/armadeus/?rev=1116&view=rev
Author: FabM
Date: 2009-03-05 11:22:39 +0000 (Thu, 05 Mar 2009)
Log Message:
-----------
[FIRMWARE] Fill leds projects directories, with working files
Added Paths:
-----------
trunk/firmware/leds/blinking_led/README
trunk/firmware/leds/blinking_led/blinking_led_xc3s200.bit
trunk/firmware/leds/blinking_led/blinking_led_xc3s400.bit
trunk/firmware/leds/blinking_led/led_wiring.dia
trunk/firmware/leds/blinking_led/src/
trunk/firmware/leds/blinking_led/src/led_blink.ucf
trunk/firmware/leds/blinking_led/src/led_blink.vhd
trunk/firmware/leds/blinking_led/testbench/
trunk/firmware/leds/blinking_led/testbench/led_blink_tb.vhd
trunk/firmware/leds/blinking_led/testbench/tags
trunk/firmware/leds/button_led/clock_divider.vhd
trunk/firmware/leds/button_led/debouncer.vhd
trunk/firmware/leds/button_led/flip_flop.vhd
trunk/firmware/leds/button_led/led.ucf
trunk/firmware/leds/button_led/led_top.bin
trunk/firmware/leds/button_led/led_top.dia
trunk/firmware/leds/button_led/led_top.vhd
trunk/firmware/leds/button_led/led_top_200k.bit
trunk/firmware/leds/button_led/led_top_400k.bit
trunk/firmware/leds/button_led/led_top_tbw_selfcheck_beh.vhd
Removed Paths:
-------------
trunk/firmware/leds/clock_divider.vhd
trunk/firmware/leds/debouncer.vhd
trunk/firmware/leds/flip_flop.vhd
trunk/firmware/leds/led.ucf
trunk/firmware/leds/led_top.bin
trunk/firmware/leds/led_top.dia
trunk/firmware/leds/led_top.vhd
trunk/firmware/leds/led_top_200k.bit
trunk/firmware/leds/led_top_400k.bit
trunk/firmware/leds/led_top_tbw_selfcheck_beh.vhd
Added: trunk/firmware/leds/blinking_led/README
===================================================================
--- trunk/firmware/leds/blinking_led/README (rev 0)
+++ trunk/firmware/leds/blinking_led/README 2009-03-05 11:22:39 UTC (rev 1116)
@@ -0,0 +1,4 @@
+This is a very simple IP that blink a LED. On apf9328-devfull, the led is
+already soldered. On apf9328-devlight, it must be soldered according to
+figure here:
+http://www.armadeus.com/wiki/index.php?title=Une_led_qui_clignote_avec_le_spartan_3
Added: trunk/firmware/leds/blinking_led/blinking_led_xc3s200.bit
===================================================================
(Binary files differ)
Property changes on: trunk/firmware/leds/blinking_led/blinking_led_xc3s200.bit
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/firmware/leds/blinking_led/blinking_led_xc3s400.bit
===================================================================
(Binary files differ)
Property changes on: trunk/firmware/leds/blinking_led/blinking_led_xc3s400.bit
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/firmware/leds/blinking_led/led_wiring.dia
===================================================================
(Binary files differ)
Property changes on: trunk/firmware/leds/blinking_led/led_wiring.dia
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/firmware/leds/blinking_led/src/led_blink.ucf
===================================================================
--- trunk/firmware/leds/blinking_led/src/led_blink.ucf (rev 0)
+++ trunk/firmware/leds/blinking_led/src/led_blink.ucf 2009-03-05 11:22:39 UTC (rev 1116)
@@ -0,0 +1,7 @@
+# Clock at 96MHz
+NET "Clk" LOC = "P55";
+NET "Clk" TNM_NET = "Clk";
+TIMESPEC "TS_Clk" = PERIOD "Clk" 10 ns HIGH 50 %;
+# LED
+NET "led_cathode" LOC = "P118"| IOSTANDARD = LVCMOS33 ;
+NET "led_anode" LOC = "P116"| IOSTANDARD = LVCMOS33 ;
Added: trunk/firmware/leds/blinking_led/src/led_blink.vhd
===================================================================
--- trunk/firmware/leds/blinking_led/src/led_blink.vhd (rev 0)
+++ trunk/firmware/leds/blinking_led/src/led_blink.vhd 2009-03-05 11:22:39 UTC (rev 1116)
@@ -0,0 +1,52 @@
+---------------------------------------------------------------------------
+-- Company : ARMades Systems
+-- Author(s) : Fabien Marteau <fab...@ar...>
+--
+-- Creation Date : 05/03/2009
+-- File : led_blink.vhd
+--
+-- Abstract :
+--
+---------------------------------------------------------------------------
+
+library IEEE;
+use IEEE.STD_LOGIC_1164.ALL;
+use IEEE.numeric_std.all;
+
+entity Clk_div_led is
+ Port (
+ Clk : in std_logic;
+ led_cathode : out std_logic;
+ led_anode : out std_logic
+ );
+end Clk_div_led;
+
+architecture RTL of Clk_div_led is
+ constant max_count : natural := 48000000;
+ signal Rst_n : std_logic;
+begin
+
+ Rst_n <= '1';
+ led_cathode <= '0';
+
+ -- compteur de 0 à max_count
+ compteur : process(Clk)
+ variable count : natural range 0 to max_count;
+ begin
+ if Rst_n = '0' then
+ count := 0;
+ led_anode <= '1';
+ elsif rising_edge(Clk) then
+ if count < max_count/2 then
+ led_anode <='1';
+ count := count + 1;
+ elsif count < max_count then
+ led_anode <='0';
+ count := count + 1;
+ else
+ count := 0;
+ led_anode <='1';
+ end if;
+ end if;
+ end process compteur;
+end RTL;
Added: trunk/firmware/leds/blinking_led/testbench/led_blink_tb.vhd
===================================================================
--- trunk/firmware/leds/blinking_led/testbench/led_blink_tb.vhd (rev 0)
+++ trunk/firmware/leds/blinking_led/testbench/led_blink_tb.vhd 2009-03-05 11:22:39 UTC (rev 1116)
@@ -0,0 +1,40 @@
+---------------------------------------------------------------------------
+-- Company : ARMades Systems
+-- Author(s) : Fabien Marteau <fab...@ar...>
+--
+-- Creation Date : 05/03/2009
+-- File : led_blink_tb.vhd
+--
+-- Abstract :
+--
+---------------------------------------------------------------------------
+
+library IEEE;
+use IEEE.STD_LOGIC_1164.ALL;
+use IEEE.numeric_std.all;
+
+---------------------------------------------------------------------------
+Entity led_blink_tb is
+---------------------------------------------------------------------------
+end entity;
+
+
+---------------------------------------------------------------------------
+Architecture led_blink_tb_1 of led_blink_tb is
+---------------------------------------------------------------------------
+
+ component Clk_div_led
+ port (
+ Clk : in std_logic;
+ led_cathode : out std_logic;
+ led_anode : out std_logic
+ );
+ end component Clk_div_led;
+
+
+begin
+
+ assert false report "TODO: testbench" severity error;
+
+end architecture led_blink_tb_1;
+
Added: trunk/firmware/leds/blinking_led/testbench/tags
===================================================================
--- trunk/firmware/leds/blinking_led/testbench/tags (rev 0)
+++ trunk/firmware/leds/blinking_led/testbench/tags 2009-03-05 11:22:39 UTC (rev 1116)
@@ -0,0 +1,9 @@
+!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
+!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
+!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhi...@us.../
+!_TAG_PROGRAM_NAME Exuberant Ctags //
+!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
+!_TAG_PROGRAM_VERSION 5.7 //
+Clk_div_led ../src/led_blink.vhd /^entity Clk_div_led is$/;" e
+RTL ../src/led_blink.vhd /^architecture RTL of Clk_div_led is$/;" a
+compteur ../src/led_blink.vhd /^ compteur : process(Clk)$/;" p
Copied: trunk/firmware/leds/button_led/clock_divider.vhd (from rev 1115, trunk/firmware/leds/clock_divider.vhd)
===================================================================
--- trunk/firmware/leds/button_led/clock_divider.vhd (rev 0)
+++ trunk/firmware/leds/button_led/clock_divider.vhd 2009-03-05 11:22:39 UTC (rev 1116)
@@ -0,0 +1,70 @@
+----------------------------------------------------------------------------------
+-- Company: Armadeus Project
+-- Engineer: Benoit Canet
+--
+-- Create Date: 22:04:02 04/12/2007
+-- Design Name:
+-- Module Name: clock_divider - behavioral
+-- Project Name:
+-- Target Devices:
+-- Tool versions:
+-- Description:
+--
+-- Dependencies:
+--
+-- Revision:
+-- Revision 0.01 - File Created
+-- Additional Comments:
+--
+----------------------------------------------------------------------------------
+library IEEE;
+use IEEE.STD_LOGIC_1164.ALL;
+use IEEE.STD_LOGIC_ARITH.ALL;
+use IEEE.STD_LOGIC_UNSIGNED.ALL;
+
+
+entity clock_divider is
+
+ -- clock division ratio (must be a multiple of 2)
+ generic(ratio : integer := 2);
+
+ port (clk_in : in STD_LOGIC;
+ clk_out : out STD_LOGIC);
+
+end clock_divider;
+
+architecture behavioral of clock_divider is
+
+ signal state : STD_LOGIC := '0';
+
+begin
+
+ process (clk_in)
+
+ variable count : integer range 0 to ratio;
+
+ begin
+
+ if (clk_in'event) and (clk_in = '1') then
+
+ -- count the number of clock change
+ count := count + 1;
+
+ -- if we waited long enough generate one clock change
+ if (count = ratio/2) then
+ state <= not state;
+ count := 0;
+ clk_out <= state;
+ end if;
+
+ end if;
+
+ end process;
+
+
+
+end behavioral;
+
+
+
+
Copied: trunk/firmware/leds/button_led/debouncer.vhd (from rev 1115, trunk/firmware/leds/debouncer.vhd)
===================================================================
--- trunk/firmware/leds/button_led/debouncer.vhd (rev 0)
+++ trunk/firmware/leds/button_led/debouncer.vhd 2009-03-05 11:22:39 UTC (rev 1116)
@@ -0,0 +1,64 @@
+----------------------------------------------------------------------------------
+-- Company: Armadeus Project
+-- Engineer: Benoit Canet
+--
+-- Create Date: 21:48:05 04/12/2007
+-- Design Name:
+-- Module Name: debouncer - behavioral
+-- Project Name:
+-- Target Devices:
+-- Tool versions:
+-- Description:
+--
+-- Dependencies:
+--
+-- Revision:
+-- Revision 0.01 - File Created
+-- Additional Comments:
+-- original code comes from Dennis Smith
+-- http://homepage.mac.com/dgsmith1/HANDOUTS/EE452/debounce.vhd.txt
+----------------------------------------------------------------------------------
+library IEEE;
+use IEEE.STD_LOGIC_1164.ALL;
+use IEEE.STD_LOGIC_ARITH.ALL;
+use IEEE.STD_LOGIC_UNSIGNED.ALL;
+
+
+entity debouncer is
+ port ( clk_100hz : in STD_LOGIC;
+ button_in : in STD_LOGIC;
+ button_debounced_out : out STD_LOGIC);
+end debouncer;
+
+architecture behavioral of debouncer is
+
+ signal shift_pb : STD_LOGIC_VECTOR(3 DOWNTO 0) := "0000";
+ signal state : STD_LOGIC := '1';
+
+begin
+
+ process(clk_100hz)
+ begin
+ if (clk_100hz'event) and (clk_100hz = '1')
+ then
+ -- shift the register
+ shift_pb(2 DOWNTO 0) <= shift_pb(3 DOWNTO 1);
+ -- input the new sample in the register
+ shift_pb(3) <= button_in;
+ -- change output if needed
+ case shift_pb is
+ when "0000" =>
+ state <= '0';
+ when "1111" =>
+ state <= '1';
+ when others =>
+ state <= state;
+ end case;
+ end if;
+
+ end process;
+
+ button_debounced_out <= state;
+
+end behavioral;
+
Copied: trunk/firmware/leds/button_led/flip_flop.vhd (from rev 1115, trunk/firmware/leds/flip_flop.vhd)
===================================================================
--- trunk/firmware/leds/button_led/flip_flop.vhd (rev 0)
+++ trunk/firmware/leds/button_led/flip_flop.vhd 2009-03-05 11:22:39 UTC (rev 1116)
@@ -0,0 +1,55 @@
+----------------------------------------------------------------------------------
+-- Company: Armadeus Project
+-- Engineer: Benoit Canet
+--
+-- Create Date: 21:21:27 04/12/2007
+-- Design Name:
+-- Module Name: flip_flop - Behavioral
+-- Project Name:
+-- Target Devices:
+-- Tool versions:
+-- Description:
+--
+-- Dependencies:
+--
+-- Revision:
+-- Revision 0.01 - File Created
+-- Additional Comments:
+--
+----------------------------------------------------------------------------------
+library IEEE;
+use IEEE.STD_LOGIC_1164.ALL;
+use IEEE.STD_LOGIC_ARITH.ALL;
+use IEEE.STD_LOGIC_UNSIGNED.ALL;
+
+
+entity flip_flop is
+ port (clk_100hz : in STD_LOGIC;
+ switch_in_n : in STD_LOGIC;
+ led_out : out STD_LOGIC);
+end flip_flop;
+
+
+architecture behavioral of flip_flop is
+
+begin
+
+ process(clk_100hz)
+ variable state : STD_LOGIC := '0';
+ variable latch : STD_LOGIC := '0';
+ begin
+ if clk_100hz'event and (clk_100hz = '1') then
+ -- switch_in_n is active when down
+ --( the switch is connected via a pullup)
+ if (switch_in_n = '0') and (latch /= switch_in_n) then
+ state := not state;
+ end if;
+ latch := switch_in_n;
+ led_out <= state;
+
+ end if;
+
+ end process;
+
+end behavioral;
+
Copied: trunk/firmware/leds/button_led/led.ucf (from rev 1115, trunk/firmware/leds/led.ucf)
===================================================================
--- trunk/firmware/leds/button_led/led.ucf (rev 0)
+++ trunk/firmware/leds/button_led/led.ucf 2009-03-05 11:22:39 UTC (rev 1116)
@@ -0,0 +1,4 @@
+# pinout
+NET "button" LOC = "P141" | IOSTANDARD = LVCMOS33 ;
+NET "clk" LOC = "P55" | IOSTANDARD = LVCMOS33 ;
+NET "led" LOC = "P116" | IOSTANDARD = LVCMOS33 ;
Copied: trunk/firmware/leds/button_led/led_top.bin (from rev 1115, trunk/firmware/leds/led_top.bin)
===================================================================
(Binary files differ)
Copied: trunk/firmware/leds/button_led/led_top.dia (from rev 1115, trunk/firmware/leds/led_top.dia)
===================================================================
(Binary files differ)
Copied: trunk/firmware/leds/button_led/led_top.vhd (from rev 1115, trunk/firmware/leds/led_top.vhd)
===================================================================
--- trunk/firmware/leds/button_led/led_top.vhd (rev 0)
+++ trunk/firmware/leds/button_led/led_top.vhd 2009-03-05 11:22:39 UTC (rev 1116)
@@ -0,0 +1,83 @@
+----------------------------------------------------------------------------------
+-- Company: Armadeus Project
+-- Engineer: Benoit Canet
+--
+-- Create Date: 22:37:46 04/12/2007
+-- Design Name:
+-- Module Name: led_top - structural
+-- Project Name:
+-- Target Devices:
+-- Tool versions:
+-- Description:
+--
+-- Dependencies:
+--
+-- Revision:
+-- Revision 0.01 - File Created
+-- Additional Comments:
+--
+----------------------------------------------------------------------------------
+library IEEE;
+use IEEE.STD_LOGIC_1164.ALL;
+use IEEE.STD_LOGIC_ARITH.ALL;
+use IEEE.STD_LOGIC_UNSIGNED.ALL;
+
+entity led_top is
+ port (
+ clk : in STD_LOGIC;
+ button : in STD_LOGIC;
+ led : out STD_LOGIC);
+end led_top;
+
+architecture structural of led_top is
+
+ -- We declare the component we we'll use
+ component clock_divider
+ generic (ratio: integer);
+ port (clk_in : in STD_LOGIC;
+ clk_out : out STD_LOGIC);
+ end component;
+
+ component debouncer
+ port (clk_100hz : in STD_LOGIC;
+ button_in : in STD_LOGIC;
+ button_debounced_out : out STD_LOGIC);
+ end component;
+
+ component flip_flop
+ port (clk_100hz : in STD_LOGIC;
+ switch_in_n : in STD_LOGIC;
+ led_out : out STD_LOGIC);
+ end component;
+
+ -- internal signals
+ signal clk_100hz : STD_LOGIC;
+ signal button_debounced_n : STD_LOGIC;
+
+ begin
+
+ -- instantiate and connect the clock divider
+ -- here we use a 96MHz/100Hz=960000 ratio
+ i_clock_divider_identifier : clock_divider
+ generic map(ratio => 960000)
+ -- for simulation purpose use the following line
+ -- instead of the previous
+ -- generic map(ratio => 2)
+
+ port map (clk_in => clk,
+ clk_out => clk_100hz);
+
+ --instantiate and connect the debouncer
+ i_debouncer_identifier : debouncer
+ port map (button_in => button,
+ clk_100hz => clk_100hz,
+ button_debounced_out => button_debounced_n);
+
+ --instantiate and connect the flip flop
+ i_flip_flop_identifier : flip_flop
+ port map (clk_100hz => clk_100hz,
+ switch_in_n => button_debounced_n,
+ led_out => led);
+
+end structural;
+
Copied: trunk/firmware/leds/button_led/led_top_200k.bit (from rev 1115, trunk/firmware/leds/led_top_200k.bit)
===================================================================
(Binary files differ)
Copied: trunk/firmware/leds/button_led/led_top_400k.bit (from rev 1115, trunk/firmware/leds/led_top_400k.bit)
===================================================================
(Binary files differ)
Copied: trunk/firmware/leds/button_led/led_top_tbw_selfcheck_beh.vhd (from rev 1115, trunk/firmware/leds/led_top_tbw_selfcheck_beh.vhd)
===================================================================
--- trunk/firmware/leds/button_led/led_top_tbw_selfcheck_beh.vhd (rev 0)
+++ trunk/firmware/leds/button_led/led_top_tbw_selfcheck_beh.vhd 2009-03-05 11:22:39 UTC (rev 1116)
@@ -0,0 +1,228 @@
+--------------------------------------------------------------------------------
+-- Copyright (c) 1995-2003 Xilinx, Inc.
+-- All Right Reserved.
+--------------------------------------------------------------------------------
+-- ____ ____
+-- / /\/ /
+-- /___/ \ / Vendor: Xilinx
+-- \ \ \/ Version : 9.1i
+-- \ \ Application : ISE
+-- / / Filename : led_top_tbw_selfcheck.vhw
+-- /___/ /\ Timestamp : Fri Apr 13 22:51:44 2007
+-- \ \ / \
+-- \___\/\___\
+--
+--Command:
+--Design Name: led_top_tbw_selfcheck_beh
+--Device: Xilinx
+--
+
+library IEEE;
+use IEEE.STD_LOGIC_1164.ALL;
+use IEEE.STD_LOGIC_ARITH.ALL;
+use IEEE.STD_LOGIC_UNSIGNED.ALL;
+USE IEEE.STD_LOGIC_TEXTIO.ALL;
+USE STD.TEXTIO.ALL;
+
+ENTITY led_top_tbw_selfcheck_beh IS
+END led_top_tbw_selfcheck_beh;
+
+ARCHITECTURE testbench_arch OF led_top_tbw_selfcheck_beh IS
+ COMPONENT led_top
+ PORT (
+ DataxD : InOut std_logic_vector (15 DownTo 0);
+ AddrxDI : In std_logic_vector (12 DownTo 0);
+ WRxBI : In std_logic;
+ RDxBI : In std_logic;
+ CSxBI : In std_logic;
+ clk : In std_logic;
+ button : In std_logic;
+ led : Out std_logic
+ );
+ END COMPONENT;
+
+ SIGNAL DataxD : std_logic_vector (15 DownTo 0) := "0000000000000000";
+ SIGNAL AddrxDI : std_logic_vector (12 DownTo 0) := "0000000000000";
+ SIGNAL WRxBI : std_logic := '0';
+ SIGNAL RDxBI : std_logic := '0';
+ SIGNAL CSxBI : std_logic := '0';
+ SIGNAL clk : std_logic := '0';
+ SIGNAL button : std_logic := '0';
+ SIGNAL led : std_logic := 'U';
+
+ SHARED VARIABLE TX_ERROR : INTEGER := 0;
+ SHARED VARIABLE TX_OUT : LINE;
+
+ constant PERIOD : time := 20 ns;
+ constant DUTY_CYCLE : real := 0.5;
+ constant OFFSET : time := 100 ns;
+
+ BEGIN
+ UUT : led_top
+ PORT MAP (
+ DataxD => DataxD,
+ AddrxDI => AddrxDI,
+ WRxBI => WRxBI,
+ RDxBI => RDxBI,
+ CSxBI => CSxBI,
+ clk => clk,
+ button => button,
+ led => led
+ );
+
+ PROCESS -- clock process for clk
+ BEGIN
+ WAIT for OFFSET;
+ CLOCK_LOOP : LOOP
+ clk <= '0';
+ WAIT FOR (PERIOD - (PERIOD * DUTY_CYCLE));
+ clk <= '1';
+ WAIT FOR (PERIOD * DUTY_CYCLE);
+ END LOOP CLOCK_LOOP;
+ END PROCESS;
+
+ PROCESS
+ PROCEDURE CHECK_led(
+ next_led : std_logic;
+ TX_TIME : INTEGER
+ ) IS
+ VARIABLE TX_STR : String(1 to 4096);
+ VARIABLE TX_LOC : LINE;
+ BEGIN
+ IF (led /= next_led) THEN
+ STD.TEXTIO.write(TX_LOC, string'("Error at time="));
+ STD.TEXTIO.write(TX_LOC, TX_TIME);
+ STD.TEXTIO.write(TX_LOC, string'("ns led="));
+ IEEE.STD_LOGIC_TEXTIO.write(TX_LOC, led);
+ STD.TEXTIO.write(TX_LOC, string'(", Expected = "));
+ IEEE.STD_LOGIC_TEXTIO.write(TX_LOC, next_led);
+ STD.TEXTIO.write(TX_LOC, string'(" "));
+ TX_STR(TX_LOC.all'range) := TX_LOC.all;
+ STD.TEXTIO.Deallocate(TX_LOC);
+ ASSERT (FALSE) REPORT TX_STR SEVERITY ERROR;
+ TX_ERROR := TX_ERROR + 1;
+ END IF;
+ END;
+ BEGIN
+ -- ------------- Current Time: 129ns
+ WAIT FOR 129 ns;
+ button <= '1';
+ -- -------------------------------------
+ -- ------------- Current Time: 131ns
+ WAIT FOR 2 ns;
+ CHECK_led('0', 131);
+ -- -------------------------------------
+ -- ------------- Current Time: 169ns
+ WAIT FOR 38 ns;
+ button <= '0';
+ -- -------------------------------------
+ -- ------------- Current Time: 171ns
+ WAIT FOR 2 ns;
+ CHECK_led('1', 171);
+ -- -------------------------------------
+ -- ------------- Current Time: 189ns
+ WAIT FOR 18 ns;
+ button <= '1';
+ -- -------------------------------------
+ -- ------------- Current Time: 209ns
+ WAIT FOR 20 ns;
+ button <= '0';
+ -- -------------------------------------
+ -- ------------- Current Time: 249ns
+ WAIT FOR 40 ns;
+ button <= '1';
+ -- -------------------------------------
+ -- ------------- Current Time: 269ns
+ WAIT FOR 20 ns;
+ button <= '0';
+ -- -------------------------------------
+ -- ------------- Current Time: 309ns
+ WAIT FOR 40 ns;
+ button <= '1';
+ -- -------------------------------------
+ -- ------------- Current Time: 369ns
+ WAIT FOR 60 ns;
+ button <= '0';
+ -- -------------------------------------
+ -- ------------- Current Time: 549ns
+ WAIT FOR 180 ns;
+ button <= '1';
+ -- -------------------------------------
+ -- ------------- Current Time: 669ns
+ WAIT FOR 120 ns;
+ button <= '0';
+ -- -------------------------------------
+ -- ------------- Current Time: 809ns
+ WAIT FOR 140 ns;
+ button <= '1';
+ -- -------------------------------------
+ -- ------------- Current Time: 1029ns
+ WAIT FOR 220 ns;
+ button <= '0';
+ -- -------------------------------------
+ -- ------------- Current Time: 1251ns
+ WAIT FOR 222 ns;
+ CHECK_led('0', 1251);
+ -- -------------------------------------
+ -- ------------- Current Time: 1409ns
+ WAIT FOR 158 ns;
+ button <= '1';
+ -- -------------------------------------
+ -- ------------- Current Time: 2709ns
+ WAIT FOR 1300 ns;
+ button <= '0';
+ -- -------------------------------------
+ -- ------------- Current Time: 2931ns
+ WAIT FOR 222 ns;
+ CHECK_led('1', 2931);
+ -- -------------------------------------
+ -- ------------- Current Time: 4269ns
+ WAIT FOR 1338 ns;
+ button <= '1';
+ -- -------------------------------------
+ -- ------------- Current Time: 4309ns
+ WAIT FOR 40 ns;
+ button <= '0';
+ -- -------------------------------------
+ -- ------------- Current Time: 4769ns
+ WAIT FOR 460 ns;
+ button <= '1';
+ -- -------------------------------------
+ -- ------------- Current Time: 5429ns
+ WAIT FOR 660 ns;
+ button <= '0';
+ -- -------------------------------------
+ -- ------------- Current Time: 5651ns
+ WAIT FOR 222 ns;
+ CHECK_led('0', 5651);
+ -- -------------------------------------
+ -- ------------- Current Time: 6629ns
+ WAIT FOR 978 ns;
+ button <= '1';
+ -- -------------------------------------
+ -- ------------- Current Time: 8269ns
+ WAIT FOR 1640 ns;
+ button <= '0';
+ -- -------------------------------------
+ -- ------------- Current Time: 8491ns
+ WAIT FOR 222 ns;
+ CHECK_led('1', 8491);
+ -- -------------------------------------
+ WAIT FOR 1529 ns;
+
+ IF (TX_ERROR = 0) THEN
+ STD.TEXTIO.write(TX_OUT, string'("No errors or warnings"));
+ ASSERT (FALSE) REPORT
+ "Simulation successful (not a failure). No problems detected."
+ SEVERITY FAILURE;
+ ELSE
+ STD.TEXTIO.write(TX_OUT, TX_ERROR);
+ STD.TEXTIO.write(TX_OUT,
+ string'(" errors found in simulation"));
+ ASSERT (FALSE) REPORT "Errors found during simulation"
+ SEVERITY FAILURE;
+ END IF;
+ END PROCESS;
+
+ END testbench_arch;
+
Deleted: trunk/firmware/leds/clock_divider.vhd
===================================================================
--- trunk/firmware/leds/clock_divider.vhd 2009-03-05 09:49:29 UTC (rev 1115)
+++ trunk/firmware/leds/clock_divider.vhd 2009-03-05 11:22:39 UTC (rev 1116)
@@ -1,70 +0,0 @@
-----------------------------------------------------------------------------------
--- Company: Armadeus Project
--- Engineer: Benoit Canet
---
--- Create Date: 22:04:02 04/12/2007
--- Design Name:
--- Module Name: clock_divider - behavioral
--- Project Name:
--- Target Devices:
--- Tool versions:
--- Description:
---
--- Dependencies:
---
--- Revision:
--- Revision 0.01 - File Created
--- Additional Comments:
---
-----------------------------------------------------------------------------------
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.STD_LOGIC_ARITH.ALL;
-use IEEE.STD_LOGIC_UNSIGNED.ALL;
-
-
-entity clock_divider is
-
- -- clock division ratio (must be a multiple of 2)
- generic(ratio : integer := 2);
-
- port (clk_in : in STD_LOGIC;
- clk_out : out STD_LOGIC);
-
-end clock_divider;
-
-architecture behavioral of clock_divider is
-
- signal state : STD_LOGIC := '0';
-
-begin
-
- process (clk_in)
-
- variable count : integer range 0 to ratio;
-
- begin
-
- if (clk_in'event) and (clk_in = '1') then
-
- -- count the number of clock change
- count := count + 1;
-
- -- if we waited long enough generate one clock change
- if (count = ratio/2) then
- state <= not state;
- count := 0;
- clk_out <= state;
- end if;
-
- end if;
-
- end process;
-
-
-
-end behavioral;
-
-
-
-
Deleted: trunk/firmware/leds/debouncer.vhd
===================================================================
--- trunk/firmware/leds/debouncer.vhd 2009-03-05 09:49:29 UTC (rev 1115)
+++ trunk/firmware/leds/debouncer.vhd 2009-03-05 11:22:39 UTC (rev 1116)
@@ -1,64 +0,0 @@
-----------------------------------------------------------------------------------
--- Company: Armadeus Project
--- Engineer: Benoit Canet
---
--- Create Date: 21:48:05 04/12/2007
--- Design Name:
--- Module Name: debouncer - behavioral
--- Project Name:
--- Target Devices:
--- Tool versions:
--- Description:
---
--- Dependencies:
---
--- Revision:
--- Revision 0.01 - File Created
--- Additional Comments:
--- original code comes from Dennis Smith
--- http://homepage.mac.com/dgsmith1/HANDOUTS/EE452/debounce.vhd.txt
-----------------------------------------------------------------------------------
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.STD_LOGIC_ARITH.ALL;
-use IEEE.STD_LOGIC_UNSIGNED.ALL;
-
-
-entity debouncer is
- port ( clk_100hz : in STD_LOGIC;
- button_in : in STD_LOGIC;
- button_debounced_out : out STD_LOGIC);
-end debouncer;
-
-architecture behavioral of debouncer is
-
- signal shift_pb : STD_LOGIC_VECTOR(3 DOWNTO 0) := "0000";
- signal state : STD_LOGIC := '1';
-
-begin
-
- process(clk_100hz)
- begin
- if (clk_100hz'event) and (clk_100hz = '1')
- then
- -- shift the register
- shift_pb(2 DOWNTO 0) <= shift_pb(3 DOWNTO 1);
- -- input the new sample in the register
- shift_pb(3) <= button_in;
- -- change output if needed
- case shift_pb is
- when "0000" =>
- state <= '0';
- when "1111" =>
- state <= '1';
- when others =>
- state <= state;
- end case;
- end if;
-
- end process;
-
- button_debounced_out <= state;
-
-end behavioral;
-
Deleted: trunk/firmware/leds/flip_flop.vhd
===================================================================
--- trunk/firmware/leds/flip_flop.vhd 2009-03-05 09:49:29 UTC (rev 1115)
+++ trunk/firmware/leds/flip_flop.vhd 2009-03-05 11:22:39 UTC (rev 1116)
@@ -1,55 +0,0 @@
-----------------------------------------------------------------------------------
--- Company: Armadeus Project
--- Engineer: Benoit Canet
---
--- Create Date: 21:21:27 04/12/2007
--- Design Name:
--- Module Name: flip_flop - Behavioral
--- Project Name:
--- Target Devices:
--- Tool versions:
--- Description:
---
--- Dependencies:
---
--- Revision:
--- Revision 0.01 - File Created
--- Additional Comments:
---
-----------------------------------------------------------------------------------
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.STD_LOGIC_ARITH.ALL;
-use IEEE.STD_LOGIC_UNSIGNED.ALL;
-
-
-entity flip_flop is
- port (clk_100hz : in STD_LOGIC;
- switch_in_n : in STD_LOGIC;
- led_out : out STD_LOGIC);
-end flip_flop;
-
-
-architecture behavioral of flip_flop is
-
-begin
-
- process(clk_100hz)
- variable state : STD_LOGIC := '0';
- variable latch : STD_LOGIC := '0';
- begin
- if clk_100hz'event and (clk_100hz = '1') then
- -- switch_in_n is active when down
- --( the switch is connected via a pullup)
- if (switch_in_n = '0') and (latch /= switch_in_n) then
- state := not state;
- end if;
- latch := switch_in_n;
- led_out <= state;
-
- end if;
-
- end process;
-
-end behavioral;
-
Deleted: trunk/firmware/leds/led.ucf
===================================================================
--- trunk/firmware/leds/led.ucf 2009-03-05 09:49:29 UTC (rev 1115)
+++ trunk/firmware/leds/led.ucf 2009-03-05 11:22:39 UTC (rev 1116)
@@ -1,4 +0,0 @@
-# pinout
-NET "button" LOC = "P141" | IOSTANDARD = LVCMOS33 ;
-NET "clk" LOC = "P55" | IOSTANDARD = LVCMOS33 ;
-NET "led" LOC = "P116" | IOSTANDARD = LVCMOS33 ;
Deleted: trunk/firmware/leds/led_top.bin
===================================================================
(Binary files differ)
Deleted: trunk/firmware/leds/led_top.dia
===================================================================
(Binary files differ)
Deleted: trunk/firmware/leds/led_top.vhd
===================================================================
--- trunk/firmware/leds/led_top.vhd 2009-03-05 09:49:29 UTC (rev 1115)
+++ trunk/firmware/leds/led_top.vhd 2009-03-05 11:22:39 UTC (rev 1116)
@@ -1,83 +0,0 @@
-----------------------------------------------------------------------------------
--- Company: Armadeus Project
--- Engineer: Benoit Canet
---
--- Create Date: 22:37:46 04/12/2007
--- Design Name:
--- Module Name: led_top - structural
--- Project Name:
--- Target Devices:
--- Tool versions:
--- Description:
---
--- Dependencies:
---
--- Revision:
--- Revision 0.01 - File Created
--- Additional Comments:
---
-----------------------------------------------------------------------------------
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.STD_LOGIC_ARITH.ALL;
-use IEEE.STD_LOGIC_UNSIGNED.ALL;
-
-entity led_top is
- port (
- clk : in STD_LOGIC;
- button : in STD_LOGIC;
- led : out STD_LOGIC);
-end led_top;
-
-architecture structural of led_top is
-
- -- We declare the component we we'll use
- component clock_divider
- generic (ratio: integer);
- port (clk_in : in STD_LOGIC;
- clk_out : out STD_LOGIC);
- end component;
-
- component debouncer
- port (clk_100hz : in STD_LOGIC;
- button_in : in STD_LOGIC;
- button_debounced_out : out STD_LOGIC);
- end component;
-
- component flip_flop
- port (clk_100hz : in STD_LOGIC;
- switch_in_n : in STD_LOGIC;
- led_out : out STD_LOGIC);
- end component;
-
- -- internal signals
- signal clk_100hz : STD_LOGIC;
- signal button_debounced_n : STD_LOGIC;
-
- begin
-
- -- instantiate and connect the clock divider
- -- here we use a 96MHz/100Hz=960000 ratio
- i_clock_divider_identifier : clock_divider
- generic map(ratio => 960000)
- -- for simulation purpose use the following line
- -- instead of the previous
- -- generic map(ratio => 2)
-
- port map (clk_in => clk,
- clk_out => clk_100hz);
-
- --instantiate and connect the debouncer
- i_debouncer_identifier : debouncer
- port map (button_in => button,
- clk_100hz => clk_100hz,
- button_debounced_out => button_debounced_n);
-
- --instantiate and connect the flip flop
- i_flip_flop_identifier : flip_flop
- port map (clk_100hz => clk_100hz,
- switch_in_n => button_debounced_n,
- led_out => led);
-
-end structural;
-
Deleted: trunk/firmware/leds/led_top_200k.bit
===================================================================
(Binary files differ)
Deleted: trunk/firmware/leds/led_top_400k.bit
===================================================================
(Binary files differ)
Deleted: trunk/firmware/leds/led_top_tbw_selfcheck_beh.vhd
===================================================================
--- trunk/firmware/leds/led_top_tbw_selfcheck_beh.vhd 2009-03-05 09:49:29 UTC (rev 1115)
+++ trunk/firmware/leds/led_top_tbw_selfcheck_beh.vhd 2009-03-05 11:22:39 UTC (rev 1116)
@@ -1,228 +0,0 @@
---------------------------------------------------------------------------------
--- Copyright (c) 1995-2003 Xilinx, Inc.
--- All Right Reserved.
---------------------------------------------------------------------------------
--- ____ ____
--- / /\/ /
--- /___/ \ / Vendor: Xilinx
--- \ \ \/ Version : 9.1i
--- \ \ Application : ISE
--- / / Filename : led_top_tbw_selfcheck.vhw
--- /___/ /\ Timestamp : Fri Apr 13 22:51:44 2007
--- \ \ / \
--- \___\/\___\
---
---Command:
---Design Name: led_top_tbw_selfcheck_beh
---Device: Xilinx
---
-
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.STD_LOGIC_ARITH.ALL;
-use IEEE.STD_LOGIC_UNSIGNED.ALL;
-USE IEEE.STD_LOGIC_TEXTIO.ALL;
-USE STD.TEXTIO.ALL;
-
-ENTITY led_top_tbw_selfcheck_beh IS
-END led_top_tbw_selfcheck_beh;
-
-ARCHITECTURE testbench_arch OF led_top_tbw_selfcheck_beh IS
- COMPONENT led_top
- PORT (
- DataxD : InOut std_logic_vector (15 DownTo 0);
- AddrxDI : In std_logic_vector (12 DownTo 0);
- WRxBI : In std_logic;
- RDxBI : In std_logic;
- CSxBI : In std_logic;
- clk : In std_logic;
- button : In std_logic;
- led : Out std_logic
- );
- END COMPONENT;
-
- SIGNAL DataxD : std_logic_vector (15 DownTo 0) := "0000000000000000";
- SIGNAL AddrxDI : std_logic_vector (12 DownTo 0) := "0000000000000";
- SIGNAL WRxBI : std_logic := '0';
- SIGNAL RDxBI : std_logic := '0';
- SIGNAL CSxBI : std_logic := '0';
- SIGNAL clk : std_logic := '0';
- SIGNAL button : std_logic := '0';
- SIGNAL led : std_logic := 'U';
-
- SHARED VARIABLE TX_ERROR : INTEGER := 0;
- SHARED VARIABLE TX_OUT : LINE;
-
- constant PERIOD : time := 20 ns;
- constant DUTY_CYCLE : real := 0.5;
- constant OFFSET : time := 100 ns;
-
- BEGIN
- UUT : led_top
- PORT MAP (
- DataxD => DataxD,
- AddrxDI => AddrxDI,
- WRxBI => WRxBI,
- RDxBI => RDxBI,
- CSxBI => CSxBI,
- clk => clk,
- button => button,
- led => led
- );
-
- PROCESS -- clock process for clk
- BEGIN
- WAIT for OFFSET;
- CLOCK_LOOP : LOOP
- clk <= '0';
- WAIT FOR (PERIOD - (PERIOD * DUTY_CYCLE));
- clk <= '1';
- WAIT FOR (PERIOD * DUTY_CYCLE);
- END LOOP CLOCK_LOOP;
- END PROCESS;
-
- PROCESS
- PROCEDURE CHECK_led(
- next_led : std_logic;
- TX_TIME : INTEGER
- ) IS
- VARIABLE TX_STR : String(1 to 4096);
- VARIABLE TX_LOC : LINE;
- BEGIN
- IF (led /= next_led) THEN
- STD.TEXTIO.write(TX_LOC, string'("Error at time="));
- STD.TEXTIO.write(TX_LOC, TX_TIME);
- STD.TEXTIO.write(TX_LOC, string'("ns led="));
- IEEE.STD_LOGIC_TEXTIO.write(TX_LOC, led);
- STD.TEXTIO.write(TX_LOC, string'(", Expected = "));
- IEEE.STD_LOGIC_TEXTIO.write(TX_LOC, next_led);
- STD.TEXTIO.write(TX_LOC, string'(" "));
- TX_STR(TX_LOC.all'range) := TX_LOC.all;
- STD.TEXTIO.Deallocate(TX_LOC);
- ASSERT (FALSE) REPORT TX_STR SEVERITY ERROR;
- TX_ERROR := TX_ERROR + 1;
- END IF;
- END;
- BEGIN
- -- ------------- Current Time: 129ns
- WAIT FOR 129 ns;
- button <= '1';
- -- -------------------------------------
- -- ------------- Current Time: 131ns
- WAIT FOR 2 ns;
- CHECK_led('0', 131);
- -- -------------------------------------
- -- ------------- Current Time: 169ns
- WAIT FOR 38 ns;
- button <= '0';
- -- -------------------------------------
- -- ------------- Current Time: 171ns
- WAIT FOR 2 ns;
- CHECK_led('1', 171);
- -- -------------------------------------
- -- ------------- Current Time: 189ns
- WAIT FOR 18 ns;
- button <= '1';
- -- -------------------------------------
- -- ------------- Current Time: 209ns
- WAIT FOR 20 ns;
- button <= '0';
- -- -------------------------------------
- -- ------------- Current Time: 249ns
- WAIT FOR 40 ns;
- button <= '1';
- -- -------------------------------------
- -- ------------- Current Time: 269ns
- WAIT FOR 20 ns;
- button <= '0';
- -- -------------------------------------
- -- ------------- Current Time: 309ns
- WAIT FOR 40 ns;
- button <= '1';
- -- -------------------------------------
- -- ------------- Current Time: 369ns
- WAIT FOR 60 ns;
- button <= '0';
- -- -------------------------------------
- -- ------------- Current Time: 549ns
- WAIT FOR 180 ns;
- button <= '1';
- -- -------------------------------------
- -- ------------- Current Time: 669ns
- WAIT FOR 120 ns;
- button <= '0';
- -- -------------------------------------
- -- ------------- Current Time: 809ns
- WAIT FOR 140 ns;
- button <= '1';
- -- -------------------------------------
- -- ------------- Current Time: 1029ns
- WAIT FOR 220 ns;
- button <= '0';
- -- -------------------------------------
- -- ------------- Current Time: 1251ns
- WAIT FOR 222 ns;
- CHECK_led('0', 1251);
- -- -------------------------------------
- -- ------------- Current Time: 1409ns
- WAIT FOR 158 ns;
- button <= '1';
- -- -------------------------------------
- -- ------------- Current Time: 2709ns
- WAIT FOR 1300 ns;
- button <= '0';
- -- -------------------------------------
- -- ------------- Current Time: 2931ns
- WAIT FOR 222 ns;
- CHECK_led('1', 2931);
- -- -------------------------------------
- -- ------------- Current Time: 4269ns
- WAIT FOR 1338 ns;
- button <= '1';
- -- -------------------------------------
- -- ------------- Current Time: 4309ns
- WAIT FOR 40 ns;
- button <= '0';
- -- -------------------------------------
- -- ------------- Current Time: 4769ns
- WAIT FOR 460 ns;
- button <= '1';
- -- -------------------------------------
- -- ------------- Current Time: 5429ns
- WAIT FOR 660 ns;
- button <= '0';
- -- -------------------------------------
- -- ------------- Current Time: 5651ns
- WAIT FOR 222 ns;
- CHECK_led('0', 5651);
- -- -------------------------------------
- -- ------------- Current Time: 6629ns
- WAIT FOR 978 ns;
- button <= '1';
- -- -------------------------------------
- -- ------------- Current Time: 8269ns
- WAIT FOR 1640 ns;
- button <= '0';
- -- -------------------------------------
- -- ------------- Current Time: 8491ns
- WAIT FOR 222 ns;
- CHECK_led('1', 8491);
- -- -------------------------------------
- WAIT FOR 1529 ns;
-
- IF (TX_ERROR = 0) THEN
- STD.TEXTIO.write(TX_OUT, string'("No errors or warnings"));
- ASSERT (FALSE) REPORT
- "Simulation successful (not a failure). No problems detected."
- SEVERITY FAILURE;
- ELSE
- STD.TEXTIO.write(TX_OUT, TX_ERROR);
- STD.TEXTIO.write(TX_OUT,
- string'(" errors found in simulation"));
- ASSERT (FALSE) REPORT "Errors found during simulation"
- SEVERITY FAILURE;
- END IF;
- END PROCESS;
-
- END testbench_arch;
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|