------------------------------------------------------------
-- VHDL Sheet1
-- 2017 3 21 12 7 4
-- Created By "Altium Designer VHDL Generator"
-- "Copyright (c) 2002-2014 Altium Limited"
-- Product Version: 16.1.12.290
------------------------------------------------------------

------------------------------------------------------------
-- VHDL Sheet1
------------------------------------------------------------

Library IEEE;
Use     IEEE.std_logic_1164.all;

Entity FPGA_tuto Is
  port
  (
    CLK_BRD        : In    STD_LOGIC;                        -- ObjectKind=Port|PrimaryId=CLK_BRD
    HA2            : Out   STD_LOGIC;                        -- ObjectKind=Port|PrimaryId=HA2
    JTAG_NEXUS_TCK : In    STD_LOGIC;                        -- ObjectKind=Port|PrimaryId=JTAG_NEXUS_TCK
    JTAG_NEXUS_TDI : In    STD_LOGIC;                        -- ObjectKind=Port|PrimaryId=JTAG_NEXUS_TDI
    JTAG_NEXUS_TDO : Out   STD_LOGIC;                        -- ObjectKind=Port|PrimaryId=JTAG_NEXUS_TDO
    JTAG_NEXUS_TMS : In    STD_LOGIC;                        -- ObjectKind=Port|PrimaryId=JTAG_NEXUS_TMS
    LEDS           : Out   STD_LOGIC_VECTOR(7 Downto 0);     -- ObjectKind=Port|PrimaryId=LEDS[7..0]
    SW_USER0       : In    STD_LOGIC                         -- ObjectKind=Port|PrimaryId=SW_USER0
  );
  attribute MacroCell : boolean;

  attribute ConnectTo : string;
  attribute ConnectTo of CLK_BRD        : Signal is "HDR_B-2";
  attribute ConnectTo of HA2            : Signal is "HDR_B-7";
  attribute ConnectTo of JTAG_NEXUS_TCK : Signal is "HDR_T-82";
  attribute ConnectTo of JTAG_NEXUS_TDI : Signal is "HDR_T-84";
  attribute ConnectTo of JTAG_NEXUS_TDO : Signal is "HDR_T-76";
  attribute ConnectTo of JTAG_NEXUS_TMS : Signal is "HDR_T-80";
  attribute ConnectTo of LEDS           : Signal is "HDR_B-20,HDR_B-18,HDR_B-16,HDR_B-14,HDR_B-12,HDR_B-10,HDR_B-8,HDR_B-6";
  attribute ConnectTo of SW_USER0       : Signal is "HDR_B-42";

  attribute FPGA_CLOCK_ALLOW_ON_NON_CLOCK_PIN : string;
  attribute FPGA_CLOCK_ALLOW_ON_NON_CLOCK_PIN of JTAG_NEXUS_TCK : Signal is "True";

  attribute TargetIdAlias : string;
  attribute TargetIdAlias of CLK_BRD        : Signal is "CLK_BRD";
  attribute TargetIdAlias of HA2            : Signal is "HA2";
  attribute TargetIdAlias of JTAG_NEXUS_TCK : Signal is "JTAG_NEXUS_TCK";
  attribute TargetIdAlias of JTAG_NEXUS_TDI : Signal is "JTAG_NEXUS_TDI";
  attribute TargetIdAlias of JTAG_NEXUS_TDO : Signal is "JTAG_NEXUS_TDO";
  attribute TargetIdAlias of JTAG_NEXUS_TMS : Signal is "JTAG_NEXUS_TMS";
  attribute TargetIdAlias of LEDS           : Signal is "LEDS7,LEDS6,LEDS5,LEDS4,LEDS3,LEDS2,LEDS1,LEDS0";


End FPGA_tuto;
------------------------------------------------------------

------------------------------------------------------------
Architecture Structure Of FPGA_tuto Is
   Component CB4CLEB                                         -- ObjectKind=Part|PrimaryId=U2|SecondaryId=1
      port
      (
        C   : in  STD_LOGIC;                                 -- ObjectKind=Pin|PrimaryId=U2-C
        CE  : in  STD_LOGIC;                                 -- ObjectKind=Pin|PrimaryId=U2-CE
        CEO : out STD_LOGIC;                                 -- ObjectKind=Pin|PrimaryId=U2-CEO
        CLR : in  STD_LOGIC;                                 -- ObjectKind=Pin|PrimaryId=U2-CLR
        D   : in  STD_LOGIC_VECTOR(3 Downto 0);              -- ObjectKind=Pin|PrimaryId=U2-D[3..0]
        L   : in  STD_LOGIC;                                 -- ObjectKind=Pin|PrimaryId=U2-L
        Q   : out STD_LOGIC_VECTOR(3 Downto 0);              -- ObjectKind=Pin|PrimaryId=U2-Q[3..0]
        TC  : out STD_LOGIC                                  -- ObjectKind=Pin|PrimaryId=U2-TC
      );
   End Component;

   Component CLKGEN                                          -- ObjectKind=Part|PrimaryId=U5|SecondaryId=1
      port
      (
        FREQ     : out STD_LOGIC;                            -- ObjectKind=Pin|PrimaryId=U5-FREQ
        TCK      : in  STD_LOGIC;                            -- ObjectKind=Pin|PrimaryId=U5-TCK
        TDI      : in  STD_LOGIC;                            -- ObjectKind=Pin|PrimaryId=U5-TDI
        TDO      : out STD_LOGIC;                            -- ObjectKind=Pin|PrimaryId=U5-TDO
        TIMEBASE : in  STD_LOGIC;                            -- ObjectKind=Pin|PrimaryId=U5-TIMEBASE
        TMS      : in  STD_LOGIC;                            -- ObjectKind=Pin|PrimaryId=U5-TMS
        TRST     : in  STD_LOGIC                             -- ObjectKind=Pin|PrimaryId=U5-TRST
      );
   End Component;

   Component Configurable_U1                                 -- ObjectKind=Part|PrimaryId=U1|SecondaryId=1
      port
      (
        AOUT : out STD_LOGIC_VECTOR(3 Downto 0);             -- ObjectKind=Pin|PrimaryId=U1-AOUT[3..0]
        TCK  : in  STD_LOGIC;                                -- ObjectKind=Pin|PrimaryId=U1-TCK
        TDI  : in  STD_LOGIC;                                -- ObjectKind=Pin|PrimaryId=U1-TDI
        TDO  : out STD_LOGIC;                                -- ObjectKind=Pin|PrimaryId=U1-TDO
        TMS  : in  STD_LOGIC;                                -- ObjectKind=Pin|PrimaryId=U1-TMS
        TRST : in  STD_LOGIC                                 -- ObjectKind=Pin|PrimaryId=U1-TRST
      );
   End Component;

   Component Configurable_U3                                 -- ObjectKind=Part|PrimaryId=U3|SecondaryId=1
      port
      (
        I  : in  STD_LOGIC_VECTOR(3 Downto 0);               -- ObjectKind=Pin|PrimaryId=U3-I[3..0]
        O0 : out STD_LOGIC;                                  -- ObjectKind=Pin|PrimaryId=U3-O0
        O1 : out STD_LOGIC;                                  -- ObjectKind=Pin|PrimaryId=U3-O1
        O2 : out STD_LOGIC;                                  -- ObjectKind=Pin|PrimaryId=U3-O2
        O3 : out STD_LOGIC                                   -- ObjectKind=Pin|PrimaryId=U3-O3
      );
   End Component;

   Component Configurable_U4                                 -- ObjectKind=Part|PrimaryId=U4|SecondaryId=1
      port
      (
        I0 : in  STD_LOGIC;                                  -- ObjectKind=Pin|PrimaryId=U4-I0
        I1 : in  STD_LOGIC;                                  -- ObjectKind=Pin|PrimaryId=U4-I1
        I2 : in  STD_LOGIC;                                  -- ObjectKind=Pin|PrimaryId=U4-I2
        I3 : in  STD_LOGIC;                                  -- ObjectKind=Pin|PrimaryId=U4-I3
        I4 : in  STD_LOGIC;                                  -- ObjectKind=Pin|PrimaryId=U4-I4
        I5 : in  STD_LOGIC;                                  -- ObjectKind=Pin|PrimaryId=U4-I5
        I6 : in  STD_LOGIC;                                  -- ObjectKind=Pin|PrimaryId=U4-I6
        I7 : in  STD_LOGIC;                                  -- ObjectKind=Pin|PrimaryId=U4-I7
        O  : out STD_LOGIC_VECTOR(7 Downto 0)                -- ObjectKind=Pin|PrimaryId=U4-O[7..0]
      );
   End Component;


    Signal NamedSignal_JTAG_NEXUS_TRST : STD_LOGIC; -- ObjectKind=Net|PrimaryId=JTAG_NEXUS_TRST
    Signal PinSignal_U1_AOUT           : STD_LOGIC_VECTOR(3 Downto 0); -- ObjectKind=Net|PrimaryId=NetU1_AOUT[3..0]
    Signal PinSignal_U1_TDO            : STD_LOGIC; -- ObjectKind=Net|PrimaryId=JTAG_NEXUS_LINK0
    Signal PinSignal_U2_Q              : STD_LOGIC_VECTOR(3 Downto 0); -- ObjectKind=Net|PrimaryId=NetU2_Q[3..0]
    Signal PinSignal_U3_O0             : STD_LOGIC; -- ObjectKind=Net|PrimaryId=NetU3_O0
    Signal PinSignal_U3_O1             : STD_LOGIC; -- ObjectKind=Net|PrimaryId=NetU3_O1
    Signal PinSignal_U3_O2             : STD_LOGIC; -- ObjectKind=Net|PrimaryId=NetU3_O2
    Signal PinSignal_U3_O3             : STD_LOGIC; -- ObjectKind=Net|PrimaryId=NetU3_O3
    Signal PinSignal_U4_O              : STD_LOGIC_VECTOR(7 Downto 0); -- ObjectKind=Net|PrimaryId=LEDS[7..0]
    Signal PinSignal_U5_FREQ           : STD_LOGIC; -- ObjectKind=Net|PrimaryId=NetU2_C
    Signal PinSignal_U5_TDO            : STD_LOGIC; -- ObjectKind=Net|PrimaryId=JTAG_NEXUS_TDO
    Signal PowerSignal_GND             : STD_LOGIC; -- ObjectKind=Net|PrimaryId=GND
    Signal PowerSignal_VCC             : STD_LOGIC; -- ObjectKind=Net|PrimaryId=VCC




Begin
    U5 : CLKGEN                                              -- ObjectKind=Part|PrimaryId=U5|SecondaryId=1
      Port Map
      (
        FREQ     => PinSignal_U5_FREQ,                       -- ObjectKind=Pin|PrimaryId=U5-FREQ
        TCK      => JTAG_NEXUS_TCK,                          -- ObjectKind=Pin|PrimaryId=U5-TCK
        TDI      => PinSignal_U1_TDO,                        -- ObjectKind=Pin|PrimaryId=U5-TDI
        TDO      => PinSignal_U5_TDO,                        -- ObjectKind=Pin|PrimaryId=U5-TDO
        TIMEBASE => CLK_BRD,                                 -- ObjectKind=Pin|PrimaryId=U5-TIMEBASE
        TMS      => JTAG_NEXUS_TMS,                          -- ObjectKind=Pin|PrimaryId=U5-TMS
        TRST     => NamedSignal_JTAG_NEXUS_TRST              -- ObjectKind=Pin|PrimaryId=U5-TRST
      );

    U4 : Configurable_U4                                     -- ObjectKind=Part|PrimaryId=U4|SecondaryId=1
      Port Map
      (
        I0 => PinSignal_U3_O0,                               -- ObjectKind=Pin|PrimaryId=U4-I0
        I1 => PinSignal_U3_O1,                               -- ObjectKind=Pin|PrimaryId=U4-I1
        I2 => PinSignal_U3_O2,                               -- ObjectKind=Pin|PrimaryId=U4-I2
        I3 => PinSignal_U3_O3,                               -- ObjectKind=Pin|PrimaryId=U4-I3
        I4 => PowerSignal_GND,                               -- ObjectKind=Pin|PrimaryId=U4-I4
        I5 => PowerSignal_GND,                               -- ObjectKind=Pin|PrimaryId=U4-I5
        I6 => PowerSignal_GND,                               -- ObjectKind=Pin|PrimaryId=U4-I6
        I7 => PowerSignal_GND,                               -- ObjectKind=Pin|PrimaryId=U4-I7
        O  => PinSignal_U4_O                                 -- ObjectKind=Pin|PrimaryId=U4-O[7..0]
      );

    U3 : Configurable_U3                                     -- ObjectKind=Part|PrimaryId=U3|SecondaryId=1
      Port Map
      (
        I  => PinSignal_U2_Q,                                -- ObjectKind=Pin|PrimaryId=U3-I[3..0]
        O0 => PinSignal_U3_O0,                               -- ObjectKind=Pin|PrimaryId=U3-O0
        O1 => PinSignal_U3_O1,                               -- ObjectKind=Pin|PrimaryId=U3-O1
        O2 => PinSignal_U3_O2,                               -- ObjectKind=Pin|PrimaryId=U3-O2
        O3 => PinSignal_U3_O3                                -- ObjectKind=Pin|PrimaryId=U3-O3
      );

    U2 : CB4CLEB                                             -- ObjectKind=Part|PrimaryId=U2|SecondaryId=1
      Port Map
      (
        C   => PinSignal_U5_FREQ,                            -- ObjectKind=Pin|PrimaryId=U2-C
        CE  => PowerSignal_VCC,                              -- ObjectKind=Pin|PrimaryId=U2-CE
        CLR => PowerSignal_GND,                              -- ObjectKind=Pin|PrimaryId=U2-CLR
        D   => PinSignal_U1_AOUT,                            -- ObjectKind=Pin|PrimaryId=U2-D[3..0]
        L   => SW_USER0,                                     -- ObjectKind=Pin|PrimaryId=U2-L
        Q   => PinSignal_U2_Q                                -- ObjectKind=Pin|PrimaryId=U2-Q[3..0]
      );

    U1 : Configurable_U1                                     -- ObjectKind=Part|PrimaryId=U1|SecondaryId=1
      Port Map
      (
        AOUT => PinSignal_U1_AOUT,                           -- ObjectKind=Pin|PrimaryId=U1-AOUT[3..0]
        TCK  => JTAG_NEXUS_TCK,                              -- ObjectKind=Pin|PrimaryId=U1-TCK
        TDI  => JTAG_NEXUS_TDI,                              -- ObjectKind=Pin|PrimaryId=U1-TDI
        TDO  => PinSignal_U1_TDO,                            -- ObjectKind=Pin|PrimaryId=U1-TDO
        TMS  => JTAG_NEXUS_TMS,                              -- ObjectKind=Pin|PrimaryId=U1-TMS
        TRST => NamedSignal_JTAG_NEXUS_TRST                  -- ObjectKind=Pin|PrimaryId=U1-TRST
      );

    -- Signal Assignments
    ---------------------
    HA2                         <= PinSignal_U5_FREQ; -- ObjectKind=Net|PrimaryId=NetU2_C
    JTAG_NEXUS_TDO              <= PinSignal_U5_TDO; -- ObjectKind=Net|PrimaryId=JTAG_NEXUS_TDO
    LEDS                        <= PinSignal_U4_O; -- ObjectKind=Net|PrimaryId=LEDS[7..0]
    NamedSignal_JTAG_NEXUS_TRST <= PowerSignal_VCC; -- ObjectKind=Net|PrimaryId=JTAG_NEXUS_TRST
    PowerSignal_GND             <= '0'; -- ObjectKind=Net|PrimaryId=GND
    PowerSignal_VCC             <= '1'; -- ObjectKind=Net|PrimaryId=VCC

End Structure;
------------------------------------------------------------

