Got the project to open... stream of random comments:
1. When you create a project in ISE, set a working directory in the "Design Properties". That will stop your top level directory from being fulled with junk files.
2. clkDiv.vhd:
- Set default values for outputs. eg "clkTimeSlow : out STD_LOGIC := '0';", otherwise the first cycle of simulation will have undefined values in it (unless you are using an explicit reset, and need to check your reset works)
- rather than "if CLK'event and CLK = '1' then" use "if rising_edge(CLK) then'.Doesn't change the generate low-level output but is much better style.
- You can use ":= (others => '0')" rather than ":= x"0000";" to initialize signals. Saves a lot of effort when initialising odd sizes or long values.
- I don't like using integers in synthesizable codes, so would have used "unsigned(25 downto 0)" rather than "integer range 0 to 49999999" for s_clkCounterTime.
- If you want to use a bit of a register as a source for a clock, you really should send it through a clock buffer Normally the tools will insert this for you, but it is good style to do this yourself.
Library UNISIM;
use UNISIM.vcomponents.all;
BUFG_1 : BUFG
port map (
O => clkSlow, -- Clock buffer output
I => s_clkSlow -- Clock buffer input
);
3. ResetDebounceHW.vhd
Although I see what you are trying to do, this is wrong on a few levels due to the hardware implementation. In softwarish terms there is a race between:
"if HardReset = '1' then"
and
"elsif(clkSL'event and clkSL = '1') then".
The signals take time to spread across the chip, so some if HardReset changes state at around the same time that the clock ticks then the values in "s_cleanOutReset" and "s_debounce" can be FUBARed.
A better form is
if rising_edge(clk) then
if HardReset = '1' then
s_debounce <= (others => '1');
else
s_debounce <= s_debounce(s_debounce'high downto 0) & '0';
end if;
cleanOutReset <= s_debounce(s_debounce'high);
end if;
As long as the HardReset pulse is long enough to trigger the async resets on all of s_debounce, then all works as expected
You might want to stretch the pulse width (from a few cycles to maybe 1,000,000 cycles with a counter, so you won't get multiple resets due to switch bounce.
... more to follow...