2 use ieee.std_logic_1164.all;
3 use IEEE.std_logic_arith.all;
4 -------------------------------------------------------------------------------------
8 -- ACLK : Synchronous clock
9 -- ARESETN : System reset, active low
10 -- S_AXIS_TREADY : Ready to accept data in
11 -- S_AXIS_TDATA : Data in
12 -- S_AXIS_TLAST : Optional data in qualifier
13 -- S_AXIS_TVALID : Data in is valid
14 -- M_AXIS_TVALID : Data out is valid
15 -- M_AXIS_TDATA : Data Out
16 -- M_AXIS_TLAST : Optional data out qualifier
17 -- M_AXIS_TREADY : Connected slave device is ready to accept data out
19 -------------------------------------------------------------------------------
21 ------------------------------------------------------------------------------
23 ------------------------------------------------------------------------------
26 constant DATA_WIDTH : positive := 8;
27 constant IMAGE_WIDTH : positive := 13;
28 constant IMAGE_SIZE : positive := 169;
29 constant DOUT_WIDTH : positive := 5 -- TO BE CALCULATED
33 -- DO NOT EDIT BELOW THIS LINE ---------------------
34 -- Bus protocol ports, do not add or delete.
36 ARESETN : in std_logic;
37 S_AXIS_TREADY : out std_logic;
38 S_AXIS_TDATA : in std_logic_vector(31 downto 0);
39 S_AXIS_TLAST : in std_logic;
40 S_AXIS_TVALID : in std_logic;
41 M_AXIS_TVALID : out std_logic;
42 M_AXIS_TDATA : out std_logic_vector(15 downto 0);
43 --M_AXIS_TLAST : out std_logic;
44 M_AXIS_TREADY : in std_logic;
45 EN_LOC_STREAM_1: in std_logic
46 -- DO NOT EDIT ABOVE THIS LINE ---------------------
51 ------------------------------------------------------------------------------
52 -- Architecture Section
53 ------------------------------------------------------------------------------
54 architecture Behavior of accelerator is
55 signal DOUT_1_1 : std_logic_vector(DOUT_WIDTH-1 downto 0);
56 signal DOUT_2_1 : std_logic_vector(DOUT_WIDTH-1 downto 0);
57 signal EN_STREAM_OUT_1 : std_logic;
58 signal VALID_OUT_1 : std_logic;
59 signal INTERNAL_RST : std_logic;
60 ---------------------------------- MAP NEXT LAYER - COMPONENTS START----------------------------------
61 COMPONENT CONV_LAYER_1
63 DIN :IN std_logic_vector(DATA_WIDTH-1 downto 0);
64 CLK,RST :IN std_logic;
65 EN_STREAM :IN std_logic; -- S_AXIS_TREADY : Ready to accept data in
66 EN_STREAM_OUT_1 :OUT std_logic; -- M_AXIS_TREADY : Connected slave device is ready to accept data out/ Internal Enable
67 VALID_OUT_1 :OUT std_logic; -- M_AXIS_TVALID : Data out is valid
68 EN_LOC_STREAM_1 :IN std_logic;
69 DOUT_1_1 :OUT std_logic_vector(DOUT_WIDTH-1 downto 0);
70 DOUT_2_1 :OUT std_logic_vector(DOUT_WIDTH-1 downto 0);
71 INTERNAL_RST :OUT std_logic
73 END COMPONENT CONV_LAYER_1;
77 CONV_LYR_1 : CONV_LAYER_1
81 DIN => S_AXIS_TDATA(7 downto 0),
82 EN_STREAM => M_AXIS_TREADY,
85 EN_LOC_STREAM_1 => EN_LOC_STREAM_1,
86 EN_STREAM_OUT_1 => EN_STREAM_OUT_1,
87 VALID_OUT_1 => VALID_OUT_1,
88 INTERNAL_RST => INTERNAL_RST
91 M_AXIS_TDATA(4 downto 0) <= DOUT_1_1;
92 M_AXIS_TDATA(9 downto 5)<= DOUT_2_1;
93 M_AXIS_TDATA (15 downto 10) <= (others => '0');
94 S_AXIS_TREADY<= EN_STREAM_OUT_1;
95 M_AXIS_TVALID<= VALID_OUT_1;
98 end architecture Behavior;