This repository has been archived by the owner on Aug 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.vhd
95 lines (69 loc) · 1.86 KB
/
test.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 09/05/2019 05:05:10 PM
-- Design Name:
-- Module Name: test - 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;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx leaf cells in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity test is
end test;
architecture Behavioral of test is
signal clk_s, rst_s : std_logic;
signal y_s : std_logic_vector(31 downto 0);
signal start_gen_s : std_logic;
signal we_out_s : std_logic;
signal addr_out_s : std_logic_vector(9 downto 0);
constant clk_period : time := 10 ns;
component square_wave is
generic( PERIOD : integer := 20;
DUTY_CYC : integer := 50;
SAMPLE_N : integer := 1024
);
port (clk : in std_logic;
rst : in std_logic;
en_gen_in : in std_logic;
we_out : out std_logic;
address_out: out std_logic_vector(9 downto 0);
y_out : out std_logic_vector(31 downto 0));
end component;
begin
start_gen_s <= '1';
sqgen : square_wave
port map
(
clk => clk_s,
rst => rst_s,
en_gen_in => start_gen_s,
we_out => we_out_s,
address_out => addr_out_s,
y_out => y_s
);
main : process
begin
clk_s <= '0';
wait for clk_period/2;
clk_s <= '1';
wait for clk_period/2;
end process;
end Behavioral;