No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

System.vhd 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. ----------------------------------------------------------------------------------
  2. -- Company: INSA-Toulouse
  3. -- Engineer: Paul Faure
  4. --
  5. -- Create Date: 13.04.2021 10:19:15
  6. -- Module Name: System - Behavioral
  7. -- Project Name: Processeur sécurisé
  8. -- Target Devices: Basys 3 ARTIX7
  9. -- Tool Versions: Vivado 2016.4
  10. -- Description: Environnement du processeur, mapping entre le processeur et la carte
  11. --
  12. -- Dependencies:
  13. -- - Clock_Divider
  14. -- - Pipeline
  15. ----------------------------------------------------------------------------------
  16. library IEEE;
  17. use IEEE.STD_LOGIC_1164.ALL;
  18. -- Lien avec le fichier de contraintes
  19. -- Récupération des leds pour STD_OUT
  20. -- Récupération des switchs pour STD_IN
  21. -- Récupération d'un bouton pour RST
  22. -- Récupération de la clock
  23. entity System is
  24. Port ( led : out STD_LOGIC_VECTOR (7 downto 0);
  25. sw : in STD_LOGIC_VECTOR (7 downto 0);
  26. btnC : in STD_LOGIC;
  27. CLK : STD_LOGIC);
  28. end System;
  29. architecture Structural of System is
  30. component Pipeline_NS is
  31. Generic (Nb_bits : Natural := 8;
  32. Instruction_En_Memoire_Size : Natural := 29;
  33. Addr_Memoire_Instruction_Size : Natural := 3;
  34. Memoire_Instruction_Size : Natural := 8;
  35. Instruction_Bus_Size : Natural := 5;
  36. Nb_Instructions : Natural := 32;
  37. Nb_Registres : Natural := 16;
  38. Memoire_Size : Natural := 32);
  39. Port (CLK : STD_LOGIC;
  40. RST : STD_LOGIC;
  41. STD_IN : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
  42. STD_OUT : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0));
  43. end component;
  44. component Clock_Divider is
  45. Port ( CLK_IN : in STD_LOGIC;
  46. CLK_OUT : out STD_LOGIC);
  47. end component;
  48. -- signaux auxiliaires
  49. signal my_RST : STD_LOGIC;
  50. signal my_CLK : STD_LOGIC;
  51. begin
  52. -- Diviseur de clock
  53. clk_div : Clock_Divider
  54. port map (CLK_IN => CLK,
  55. CLK_OUT => my_CLK);
  56. -- Le processeur, augmentation de la taille de la mémoire d'instruction
  57. instance : Pipeline_NS
  58. generic map (Addr_Memoire_Instruction_Size => 8,
  59. Memoire_Instruction_Size => 256)
  60. port map (CLK => my_CLK,
  61. RST => my_RST,
  62. STD_IN => sw,
  63. STD_OUT => led);
  64. -- Gestion du RST (inversion d'état)
  65. my_RST <= '1' when btnC = '0' else
  66. '0';
  67. end Structural;