OpenCores
URL https://opencores.org/ocsvn/pmodda4driver/pmodda4driver/trunk

Subversion Repositories pmodda4driver

[/] [pmodda4driver/] [trunk/] [hw/] [simulations/] [Testbench_Top_PmodDA4Driver.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ldalmasso
------------------------------------------------------------------------
2
-- Engineer:    Dalmasso Loic
3
-- Create Date: 05/02/2025
4
-- Module Name: Top_PmodDA4Driver
5
-- Description:
6
--      Top Module including Pmod DA4 Driver for the 8 Channels 12-bit Digital-to-Analog Converter AD5628.
7
--
8
-- Ports
9
--              Input   -       i_sys_clock: System Input Clock
10
--              Input   -       i_reset: Module Reset ('0': No Reset, '1': Reset)
11
--              Input   -       i_enable: Module Enable ('0': Disable, '1': Enable)
12
--              Input   -       i_addr: DAC Address Register (4 bits)
13
--              Output  -       o_sclk: SPI Serial Clock
14
--              Output  -       o_mosi: SPI Master Output Slave Input Data line
15
--              Output  -       o_ss: SPI Slave Select Line ('0': Enable, '1': Disable)
16
------------------------------------------------------------------------
17
 
18
LIBRARY IEEE;
19
USE IEEE.STD_LOGIC_1164.ALL;
20
USE IEEE.NUMERIC_STD.ALL;
21
 
22
ENTITY Testbench_Top_PmodDA4Driver is
23
--  Port ( );
24
END Testbench_Top_PmodDA4Driver;
25
 
26
ARCHITECTURE Behavioral of Testbench_Top_PmodDA4Driver is
27
 
28
COMPONENT Top_PmodDA4Driver is
29
 
30
    PORT(
31
        i_sys_clock: IN STD_LOGIC;
32
        i_reset: IN STD_LOGIC;
33
        i_enable: IN STD_LOGIC;
34
        i_addr: IN UNSIGNED(3 downto 0);
35
        o_sclk: OUT STD_LOGIC;
36
        o_mosi: OUT STD_LOGIC;
37
        o_ss: OUT STD_LOGIC
38
    );
39
 
40
END COMPONENT;
41
 
42
signal sys_clock: STD_LOGIC := '0';
43
signal reset: STD_LOGIC := '0';
44
signal enable: STD_LOGIC := '0';
45
signal addr: UNSIGNED(3 downto 0):= (others => '0');
46
signal sclk: STD_LOGIC := '0';
47
signal mosi: STD_LOGIC := '0';
48
signal ss: STD_LOGIC := '0';
49
 
50
begin
51
 
52
-- Clock 100 MHz
53
sys_clock <= not(sys_clock) after 5 ns;
54
 
55
-- Reset
56
reset <= '1', '0' after 11 us;
57
 
58
-- Enable
59
enable <= '0', '1' after 111 us;
60
 
61
-- Address
62
addr <= x"0", x"1" after 111 us, x"2" after 130 us;
63
 
64
uut: Top_PmodDA4Driver
65
 
66
    PORT map(
67
        i_sys_clock => sys_clock,
68
        i_reset => reset,
69
        i_enable => enable,
70
        i_addr => addr,
71
        o_sclk => sclk,
72
        o_mosi => mosi,
73
        o_ss => ss);
74
 
75
end Behavioral;

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.