Use generics in VHDL counter test to select sim and syn dividers

parent 7feedf4d
...@@ -11,7 +11,7 @@ use ieee.numeric_std.all; ...@@ -11,7 +11,7 @@ use ieee.numeric_std.all;
entity counter is entity counter is
generic (cycles_per_second : unsigned := 12000000); generic (cycles_per_second : integer := 12000000);
port( port(
clock: in std_logic; clock: in std_logic;
......
...@@ -14,6 +14,9 @@ end counter_tb; ...@@ -14,6 +14,9 @@ end counter_tb;
architecture testbench of counter_tb is architecture testbench of counter_tb is
component counter component counter
generic(
cycles_per_second: integer
);
port( port(
clock: in std_logic; clock: in std_logic;
clear: in std_logic; clear: in std_logic;
...@@ -29,7 +32,9 @@ architecture testbench of counter_tb is ...@@ -29,7 +32,9 @@ architecture testbench of counter_tb is
begin begin
U_counter: counter port map (t_clock, t_clear, t_count, t_Q); U_counter: counter
generic map (cycles_per_second => 500)
port map (t_clock, t_clear, t_count, t_Q);
process process
begin begin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment