--
-- VHDL Architecture Morse_test.morseEncoder_tb.struct
--
-- Created:
--          by - axel.amand.UNKNOWN (WE7860)
--          at - 14:51:13 28.04.2023
--
-- Generated by Mentor Graphics' HDL Designer(TM) 2019.2 (Build 5)
--
LIBRARY ieee;
  USE ieee.std_logic_1164.all;
  USE ieee.numeric_std.ALL;

LIBRARY Morse;
LIBRARY Morse_test;

ARCHITECTURE struct OF morseEncoder_tb IS

    -- Architecture declarations
    constant clockFrequency: real := 60.0E6;
    --constant clockFrequency: real := 66.0E6;
    constant uartBaudRate: real := 115.2E3;
    constant uartDataBitNb: positive := 7;
    constant morseUnitDuration: real := 50.0E-6;
    constant morseToneFrequency: real := 10.0/morseUnitDuration;

    -- Internal signal declarations
    SIGNAL RxD       : std_ulogic;
    SIGNAL clock     : std_ulogic;
    SIGNAL morseCode : std_ulogic;
    SIGNAL reset     : std_ulogic;


    -- Component Declarations
    COMPONENT morseEncoder
    GENERIC (
        clockFrequency : real     := 100.0E6;
        uartBaudRate   : real     := 115.2E3;
        uartDataBitNb  : positive := 8;
        unitDuration   : real     := 100.0E-3;
        toneFrequency  : real     := 300.0
    );
    PORT (
        morseCode : OUT    std_ulogic ;
        clock     : IN     std_ulogic ;
        reset     : IN     std_ulogic ;
        RxD       : IN     std_ulogic 
    );
    END COMPONENT;
    COMPONENT morseEncoder_tester
    GENERIC (
        clockFrequency : real;
        uartBaudRate   : real;
        uartDataBitNb  : positive
    );
    PORT (
        morseCode : IN     std_ulogic ;
        RxD       : OUT    std_ulogic ;
        clock     : OUT    std_ulogic ;
        reset     : OUT    std_ulogic 
    );
    END COMPONENT;

    -- Optional embedded configurations
    -- pragma synthesis_off
    FOR ALL : morseEncoder USE ENTITY Morse.morseEncoder;
    FOR ALL : morseEncoder_tester USE ENTITY Morse_test.morseEncoder_tester;
    -- pragma synthesis_on


BEGIN

    -- Instance port mappings.
    I_DUT : morseEncoder
        GENERIC MAP (
            clockFrequency => clockFrequency,
            uartBaudRate   => uartBaudRate,
            uartDataBitNb  => uartDataBitNb,
            unitDuration   => morseUnitDuration,
            toneFrequency  => morseToneFrequency
        )
        PORT MAP (
            morseCode => morseCode,
            clock     => clock,
            reset     => reset,
            RxD       => RxD
        );
    I_tester : morseEncoder_tester
        GENERIC MAP (
            clockFrequency => clockFrequency,
            uartBaudRate   => uartBaudRate,
            uartDataBitNb  => uartDataBitNb
        )
        PORT MAP (
            morseCode => morseCode,
            RxD       => RxD,
            clock     => clock,
            reset     => reset
        );

END struct;
