-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_modules.vhd
72 lines (65 loc) · 1.89 KB
/
test_modules.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
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.math_real.all;
use IEEE.numeric_std.all;
entity tb_modules is
end tb_modules;
architecture Behavioral of tb_modules is
component add_module is
Port (
inputx : in real;
inputy : in real;
output : out real);
end component;
component multiplier_module is
Port (
inputx : in real;
inputy : in real;
output : out real);
end component;
component sigmoid_module is
Port (
clk : in std_logic;
enable : in std_logic;
input : in real;
output : out real);
end component;
component tanh_module is
Port (
clk : in std_logic;
enable : in std_logic;
input : in real;
output : out real);
end component;
signal clk : std_logic := '0';
signal enable : std_logic := '0';
signal inputx : real;
signal inputy : real;
signal output_add : real;
signal output_mult : real;
signal output_tanh : real;
signal output_sigmoid : real;
begin
inputx <= 2.25, -13.4 after 200 ns;
inputy <= 8.4, 29.4 after 200 ns;
clk <= not clk after 10 ns;
enable <= '1';
adder_ut : add_module Port map (
inputx => inputx,
inputy => inputy,
output => output_add);
mult_ut : multiplier_module Port map (
inputx => inputx,
inputy => inputy,
output => output_mult);
sigmoid_ut : sigmoid_module Port map (
clk => clk,
enable => enable,
input => inputx,
output => output_sigmoid);
tanh_ut : tanh_module Port map (
clk => clk,
enable => enable,
input => inputx,
output => output_tanh);
end Behavioral;