Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3.  
  4. package pkg is
  5. type frame_type is array (natural range <>) of std_logic_vector(7 downto 0);
  6. end package;
  7.  
  8. package body pkg is
  9. end package body;
  10.  
  11. library ieee;
  12. use ieee.std_logic_1164.all;
  13. library work;
  14. use work.pkg.all;
  15.  
  16. entity read_frame is
  17. port(
  18. CLK : in std_logic;
  19. dout_valid : in std_logic;
  20. data_in : in std_logic_vector(7 downto 0);
  21. data_out : out std_logic_vector(19 downto 0);
  22. frame_out : out frame_type(0 to 9);
  23. frame_check : out std_logic
  24. );
  25. end read_frame;
  26.  
  27. architecture arch of read_frame is
  28. --type frame_type is array(0 to 9) of std_logic_vector(7 downto 0);
  29. signal frame_duration: std_logic;
  30. signal frame : frame_type(0 to 9);
  31. signal count : natural range 0 to 9 := 9;
  32. signal data : std_logic_vector(7 downto 0);
  33. --signal frame_t : frame_type;
  34.  
  35. begin
  36. process(CLK, dout_valid)
  37. begin
  38. if (rising_edge(dout_valid)) then
  39. if (rising_edge(CLK)) then
  40. --Getting data
  41. data <= data_in;
  42. if (data = "11111111") then --Start frame
  43. count <= 0;
  44. frame_duration <= '1';
  45. frame <= (others => (others => '0'));
  46. elsif (data = "00000000") then -- end frame
  47. count <= 0;
  48. frame_duration <= '0';
  49. else
  50. frame(count) <= data;
  51. count <= count + 1;
  52. end if;
  53. end if;
  54. end if;
  55. end process;
  56.  
  57. process(CLK, frame_duration)
  58. begin
  59. if (falling_edge(frame_duration)) then
  60. frame_out <= frame;
  61. end if;
  62. end process;
  63. frame_check <= frame_duration;
  64. end arch;
  65.  
  66. Error (10821): HDL error at read_frame.vhd(39): can't infer register for "frame[9][0]" because its behavior does not match any supported register model
  67. Error (10821): HDL error at read_frame.vhd(39): can't infer register for "frame[9][1]" because its behavior does not match any supported register model
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement