-- ==============================================================
-- File generated on Tue Jun 02 21:19:44 EEST 2020
-- Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC v2018.3 (64-bit)
-- SW Build 2405991 on Thu Dec  6 23:36:41 MST 2018
-- IP Build 2404404 on Fri Dec  7 01:43:56 MST 2018
-- Copyright 1986-2018 Xilinx, Inc. All Rights Reserved.
-- ==============================================================
library ieee; 
use ieee.std_logic_1164.all; 
use ieee.std_logic_unsigned.all;

entity dense_layer3_dense_3_weights_V_rom is 
    generic(
             DWIDTH     : integer := 4; 
             AWIDTH     : integer := 10; 
             MEM_SIZE    : integer := 840
    ); 
    port (
          addr0      : in std_logic_vector(AWIDTH-1 downto 0); 
          ce0       : in std_logic; 
          q0         : out std_logic_vector(DWIDTH-1 downto 0);
          clk       : in std_logic
    ); 
end entity; 


architecture rtl of dense_layer3_dense_3_weights_V_rom is 

signal addr0_tmp : std_logic_vector(AWIDTH-1 downto 0); 
type mem_array is array (0 to MEM_SIZE-1) of std_logic_vector (DWIDTH-1 downto 0); 
signal mem : mem_array := (
    0 => "1110", 1 => "0000", 2 => "1110", 3 => "0000", 4 => "0100", 
    5 => "1110", 6 => "1111", 7 => "0000", 8 => "1110", 9 => "0010", 
    10 => "1101", 11 => "0000", 12 => "1111", 13 => "1110", 14 => "1111", 
    15 => "0011", 16 => "0000", 17 => "0010", 18 => "0000", 19 => "0100", 
    20 => "0001", 21 => "0100", 22 to 24=> "1110", 25 => "1101", 26 => "0001", 
    27 => "1110", 28 => "0011", 29 => "0010", 30 to 31=> "0011", 32 => "1100", 
    33 => "1111", 34 => "1100", 35 to 36=> "0011", 37 to 38=> "0000", 39 => "1111", 
    40 => "1110", 41 => "0010", 42 to 43=> "0001", 44 => "0000", 45 => "1111", 
    46 => "0001", 47 => "1110", 48 => "0100", 49 to 50=> "0011", 51 => "0010", 
    52 => "0011", 53 => "1011", 54 => "0011", 55 => "1110", 56 to 57=> "1100", 
    58 => "0010", 59 => "0001", 60 => "0000", 61 => "0011", 62 => "1101", 
    63 => "0010", 64 => "0001", 65 => "1111", 66 => "1110", 67 => "0000", 
    68 => "1101", 69 => "0010", 70 to 71=> "0100", 72 => "0001", 73 => "0000", 
    74 => "1110", 75 => "1111", 76 => "0100", 77 => "1010", 78 => "0011", 
    79 => "0101", 80 => "0011", 81 => "1011", 82 => "1101", 83 to 84=> "0001", 
    85 => "1101", 86 => "0011", 87 => "0100", 88 => "0001", 89 => "1110", 
    90 to 91=> "0010", 92 => "0000", 93 => "0010", 94 => "0000", 95 => "1111", 
    96 => "0000", 97 => "1011", 98 to 99=> "1110", 100 => "0010", 101 => "1100", 
    102 => "0100", 103 => "1111", 104 to 105=> "1101", 106 => "0010", 107 => "1111", 
    108 => "0011", 109 => "0000", 110 to 111=> "1100", 112 => "0000", 113 => "0001", 
    114 => "1110", 115 => "1111", 116 => "0100", 117 => "0001", 118 => "0010", 
    119 => "0100", 120 => "0001", 121 => "0010", 122 => "0001", 123 => "1110", 
    124 to 127=> "0010", 128 to 130=> "0001", 131 => "1111", 132 => "0000", 133 => "0100", 
    134 => "0010", 135 => "0000", 136 => "0010", 137 => "1111", 138 => "0010", 
    139 => "1100", 140 => "1111", 141 => "0011", 142 to 143=> "1110", 144 => "0011", 
    145 => "1110", 146 => "1100", 147 => "1110", 148 to 150=> "0010", 151 => "1110", 
    152 => "0001", 153 => "1111", 154 => "1101", 155 => "0000", 156 => "1011", 
    157 => "0100", 158 => "0010", 159 => "0011", 160 => "1110", 161 => "0011", 
    162 => "1101", 163 => "0100", 164 => "1110", 165 to 166=> "1100", 167 => "0010", 
    168 => "0011", 169 to 170=> "1111", 171 => "0010", 172 => "1111", 173 => "0010", 
    174 => "1100", 175 => "0011", 176 => "0001", 177 => "1100", 178 => "0011", 
    179 => "0000", 180 => "1101", 181 => "0110", 182 => "1111", 183 => "1100", 
    184 => "0011", 185 => "1101", 186 to 189=> "0001", 190 => "1110", 191 => "0001", 
    192 => "1101", 193 => "1100", 194 => "0001", 195 => "0011", 196 => "1110", 
    197 => "0100", 198 => "0000", 199 => "0001", 200 to 201=> "1111", 202 => "1110", 
    203 => "1101", 204 => "0011", 205 => "0001", 206 => "0010", 207 to 209=> "1110", 
    210 => "1100", 211 to 212=> "0000", 213 => "1111", 214 => "1101", 215 => "1111", 
    216 => "0001", 217 => "0010", 218 to 219=> "1101", 220 to 221=> "1110", 222 to 223=> "0000", 
    224 => "1111", 225 => "1100", 226 to 227=> "0000", 228 => "1011", 229 => "1101", 
    230 => "0011", 231 => "1110", 232 => "0010", 233 => "1101", 234 => "0010", 
    235 => "0100", 236 => "1101", 237 => "0000", 238 => "0100", 239 => "0010", 
    240 => "1011", 241 => "0001", 242 => "1100", 243 => "0011", 244 => "1110", 
    245 to 246=> "0001", 247 to 248=> "1111", 249 => "1110", 250 => "0001", 251 => "0000", 
    252 to 253=> "0010", 254 => "1100", 255 => "1110", 256 => "1111", 257 => "0000", 
    258 => "0001", 259 => "0011", 260 => "1111", 261 => "1101", 262 to 264=> "1100", 
    265 => "1101", 266 => "1111", 267 => "0011", 268 => "1100", 269 => "0000", 
    270 => "0011", 271 => "0001", 272 to 273=> "0010", 274 => "0000", 275 => "0100", 
    276 => "0001", 277 => "1100", 278 => "0011", 279 => "0001", 280 to 281=> "0000", 
    282 => "0001", 283 => "0000", 284 => "1111", 285 => "1110", 286 => "1101", 
    287 to 288=> "0010", 289 => "0011", 290 => "0100", 291 => "0011", 292 => "1101", 
    293 => "1111", 294 => "0001", 295 => "1110", 296 => "0001", 297 => "1110", 
    298 => "0011", 299 => "0000", 300 => "0011", 301 => "0001", 302 => "0100", 
    303 => "1101", 304 => "0001", 305 => "1101", 306 => "0001", 307 => "1111", 
    308 => "1101", 309 => "1110", 310 => "0010", 311 => "0000", 312 to 313=> "1110", 
    314 => "1101", 315 => "0100", 316 to 317=> "1100", 318 => "0011", 319 => "1101", 
    320 => "1111", 321 => "0100", 322 => "1111", 323 => "1100", 324 => "0000", 
    325 to 326=> "0100", 327 => "1110", 328 => "1111", 329 => "1101", 330 => "0000", 
    331 => "1100", 332 => "1111", 333 to 334=> "0010", 335 => "0000", 336 => "0001", 
    337 to 338=> "0000", 339 => "0001", 340 => "1110", 341 => "1101", 342 to 343=> "0010", 
    344 => "1101", 345 => "0011", 346 => "0100", 347 => "0001", 348 => "0100", 
    349 => "1111", 350 => "0000", 351 => "0010", 352 => "0001", 353 => "0011", 
    354 => "1101", 355 => "1100", 356 => "1101", 357 => "1100", 358 => "1101", 
    359 => "1111", 360 => "0001", 361 => "1100", 362 => "1101", 363 => "0001", 
    364 => "0010", 365 to 366=> "1110", 367 => "0000", 368 => "1101", 369 to 371=> "1110", 
    372 to 373=> "1111", 374 => "0010", 375 => "0001", 376 => "1110", 377 => "1111", 
    378 to 379=> "0000", 380 => "1101", 381 => "1100", 382 => "1011", 383 => "0001", 
    384 => "1101", 385 => "1110", 386 => "0001", 387 to 388=> "0011", 389 => "0001", 
    390 => "0000", 391 => "1100", 392 => "0011", 393 => "1111", 394 => "1101", 
    395 => "0000", 396 => "1101", 397 => "1111", 398 => "1101", 399 => "0011", 
    400 => "0100", 401 => "0010", 402 to 403=> "1100", 404 => "0010", 405 => "0001", 
    406 => "0100", 407 => "1110", 408 => "1111", 409 => "0000", 410 => "1110", 
    411 => "0000", 412 => "0011", 413 to 414=> "0000", 415 => "0011", 416 => "0001", 
    417 => "0100", 418 => "1111", 419 => "1110", 420 to 421=> "1101", 422 => "1111", 
    423 => "1101", 424 => "1100", 425 => "0011", 426 => "0100", 427 => "0000", 
    428 => "0100", 429 => "1100", 430 => "0011", 431 => "1011", 432 => "1100", 
    433 => "0010", 434 => "1110", 435 => "0100", 436 => "0011", 437 => "0000", 
    438 => "0001", 439 => "0010", 440 => "1111", 441 => "1110", 442 => "0011", 
    443 => "1111", 444 => "1110", 445 => "0000", 446 => "0100", 447 => "1101", 
    448 => "1111", 449 to 450=> "0000", 451 => "0011", 452 => "0001", 453 => "1101", 
    454 => "1100", 455 => "0011", 456 to 457=> "0000", 458 => "0100", 459 => "1111", 
    460 => "0011", 461 => "0000", 462 => "0010", 463 => "0001", 464 => "1110", 
    465 => "0010", 466 => "0100", 467 => "1110", 468 => "1100", 469 => "0000", 
    470 to 471=> "1101", 472 to 474=> "1110", 475 => "1101", 476 => "0001", 477 => "0000", 
    478 => "0011", 479 => "0000", 480 => "1110", 481 => "1100", 482 to 483=> "1110", 
    484 => "1100", 485 => "0001", 486 => "1100", 487 => "0000", 488 => "1110", 
    489 => "0011", 490 to 491=> "0000", 492 => "1011", 493 => "0011", 494 => "0000", 
    495 => "1100", 496 to 497=> "0010", 498 => "1110", 499 => "0001", 500 => "1111", 
    501 => "0001", 502 => "0011", 503 => "0100", 504 => "0000", 505 => "1011", 
    506 => "0010", 507 => "0001", 508 => "0011", 509 => "1111", 510 => "1100", 
    511 => "1111", 512 to 513=> "0000", 514 => "0011", 515 => "1100", 516 => "0000", 
    517 => "0011", 518 => "1100", 519 => "0100", 520 => "0010", 521 => "1110", 
    522 => "0000", 523 => "1111", 524 => "0001", 525 => "0000", 526 => "1101", 
    527 => "1111", 528 => "1101", 529 => "0100", 530 => "0010", 531 => "0000", 
    532 => "1110", 533 => "0000", 534 => "1110", 535 => "1101", 536 => "1110", 
    537 => "1111", 538 => "1110", 539 => "0011", 540 => "1110", 541 to 542=> "1111", 
    543 => "0000", 544 => "0010", 545 => "1101", 546 to 547=> "1110", 548 => "1101", 
    549 => "0100", 550 => "1111", 551 => "0001", 552 => "1111", 553 => "0000", 
    554 to 555=> "1101", 556 => "1100", 557 => "1111", 558 => "0000", 559 => "1010", 
    560 => "0001", 561 => "1100", 562 => "1111", 563 to 564=> "1110", 565 => "0010", 
    566 => "0001", 567 => "1101", 568 to 569=> "1100", 570 => "0011", 571 => "1111", 
    572 => "0010", 573 => "1101", 574 => "0011", 575 => "0010", 576 => "1110", 
    577 => "0010", 578 => "0011", 579 to 580=> "1101", 581 to 582=> "1111", 583 => "1101", 
    584 => "0101", 585 => "0001", 586 => "0010", 587 => "0000", 588 => "1100", 
    589 => "0010", 590 => "0011", 591 => "1111", 592 to 593=> "1110", 594 => "1111", 
    595 => "0011", 596 => "1111", 597 => "0000", 598 => "1101", 599 => "0100", 
    600 => "0000", 601 => "0011", 602 => "0001", 603 => "0010", 604 => "0100", 
    605 => "1100", 606 => "0011", 607 => "0000", 608 => "0001", 609 => "1110", 
    610 => "1111", 611 => "0011", 612 => "1100", 613 => "1101", 614 => "1100", 
    615 => "0010", 616 => "1110", 617 => "1101", 618 => "0000", 619 => "1110", 
    620 => "1111", 621 => "0000", 622 => "0010", 623 => "1111", 624 to 625=> "0001", 
    626 => "1111", 627 => "0100", 628 => "0000", 629 => "1101", 630 => "0010", 
    631 => "1110", 632 => "0011", 633 => "0000", 634 => "1111", 635 => "0011", 
    636 => "0000", 637 => "1101", 638 => "1111", 639 => "0010", 640 => "1111", 
    641 => "0100", 642 => "1111", 643 => "0011", 644 => "1111", 645 => "0000", 
    646 => "0100", 647 => "1101", 648 => "0001", 649 => "0011", 650 => "1101", 
    651 => "1111", 652 => "0010", 653 => "1111", 654 => "0001", 655 => "1111", 
    656 => "0010", 657 => "1110", 658 => "0011", 659 to 660=> "0010", 661 to 663=> "0000", 
    664 => "0001", 665 to 667=> "1100", 668 => "1111", 669 => "1101", 670 => "1110", 
    671 => "0000", 672 => "1111", 673 => "0010", 674 => "0000", 675 => "1111", 
    676 => "0001", 677 => "0011", 678 => "0000", 679 => "1110", 680 => "0010", 
    681 to 682=> "0001", 683 => "1110", 684 => "1011", 685 => "1111", 686 => "0100", 
    687 => "1110", 688 => "0010", 689 => "1110", 690 => "0011", 691 => "0100", 
    692 => "0010", 693 => "0001", 694 => "1110", 695 => "1101", 696 => "0011", 
    697 => "0010", 698 to 699=> "0011", 700 => "0001", 701 => "0011", 702 => "0001", 
    703 => "1101", 704 => "1111", 705 to 706=> "0011", 707 => "1101", 708 => "0000", 
    709 => "1101", 710 => "0010", 711 to 712=> "0000", 713 => "0001", 714 => "1111", 
    715 => "1110", 716 => "0001", 717 to 718=> "1111", 719 => "1110", 720 => "1111", 
    721 => "0010", 722 => "1110", 723 => "0010", 724 => "1110", 725 => "1100", 
    726 => "1111", 727 to 728=> "0011", 729 => "0000", 730 => "1101", 731 => "1111", 
    732 => "0010", 733 => "0011", 734 => "1100", 735 to 738=> "0000", 739 to 740=> "0001", 
    741 to 742=> "0010", 743 => "1110", 744 => "0010", 745 to 746=> "1101", 747 => "1110", 
    748 => "1111", 749 => "1110", 750 => "0010", 751 => "1110", 752 => "0010", 
    753 => "1110", 754 => "0010", 755 to 756=> "1100", 757 => "1101", 758 => "0010", 
    759 to 760=> "1111", 761 => "0001", 762 => "0100", 763 => "0000", 764 => "0011", 
    765 => "1110", 766 => "0010", 767 to 768=> "0000", 769 => "0010", 770 => "0001", 
    771 => "1111", 772 => "1100", 773 => "0010", 774 to 775=> "1110", 776 => "0010", 
    777 to 778=> "0011", 779 => "1101", 780 => "1111", 781 to 783=> "0001", 784 => "0100", 
    785 => "1100", 786 => "0011", 787 => "1110", 788 => "1101", 789 => "1110", 
    790 => "0001", 791 => "1111", 792 => "1101", 793 => "0000", 794 => "0100", 
    795 to 796=> "1110", 797 => "0010", 798 => "1111", 799 => "1100", 800 => "0011", 
    801 => "1110", 802 => "1100", 803 => "0000", 804 => "1111", 805 => "0000", 
    806 => "0011", 807 => "1100", 808 => "1111", 809 => "0010", 810 => "0011", 
    811 => "0001", 812 => "1100", 813 => "0001", 814 => "1110", 815 => "1011", 
    816 => "0011", 817 => "1111", 818 => "0010", 819 => "1111", 820 => "1101", 
    821 to 822=> "1110", 823 => "0010", 824 => "1101", 825 => "0010", 826 => "1111", 
    827 => "1100", 828 => "0001", 829 => "1010", 830 => "1111", 831 => "0011", 
    832 to 833=> "0001", 834 => "1101", 835 => "0001", 836 => "0100", 837 => "0001", 
    838 => "0100", 839 => "0000" );


begin 


memory_access_guard_0: process (addr0) 
begin
      addr0_tmp <= addr0;
--synthesis translate_off
      if (CONV_INTEGER(addr0) > mem_size-1) then
           addr0_tmp <= (others => '0');
      else 
           addr0_tmp <= addr0;
      end if;
--synthesis translate_on
end process;

p_rom_access: process (clk)  
begin 
    if (clk'event and clk = '1') then
        if (ce0 = '1') then 
            q0 <= mem(CONV_INTEGER(addr0_tmp)); 
        end if;
    end if;
end process;

end rtl;

Library IEEE;
use IEEE.std_logic_1164.all;

entity dense_layer3_dense_3_weights_V is
    generic (
        DataWidth : INTEGER := 4;
        AddressRange : INTEGER := 840;
        AddressWidth : INTEGER := 10);
    port (
        reset : IN STD_LOGIC;
        clk : IN STD_LOGIC;
        address0 : IN STD_LOGIC_VECTOR(AddressWidth - 1 DOWNTO 0);
        ce0 : IN STD_LOGIC;
        q0 : OUT STD_LOGIC_VECTOR(DataWidth - 1 DOWNTO 0));
end entity;

architecture arch of dense_layer3_dense_3_weights_V is
    component dense_layer3_dense_3_weights_V_rom is
        port (
            clk : IN STD_LOGIC;
            addr0 : IN STD_LOGIC_VECTOR;
            ce0 : IN STD_LOGIC;
            q0 : OUT STD_LOGIC_VECTOR);
    end component;



begin
    dense_layer3_dense_3_weights_V_rom_U :  component dense_layer3_dense_3_weights_V_rom
    port map (
        clk => clk,
        addr0 => address0,
        ce0 => ce0,
        q0 => q0);

end architecture;


