Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. diff --git a/fpga/ram_reader.v b/fpga/ram_reader.v
  2. index 4c57404..4a7a3cf 100644
  3. --- a/fpga/ram_reader.v
  4. +++ b/fpga/ram_reader.v
  5. @@ -13,6 +13,7 @@ module ram_reader (
  6. p_rd_clk,
  7. p_rd_en,
  8. p_rd_data,
  9. + p_rd_empty,
  10.  
  11. // contents of the address
  12. data_out
  13. @@ -32,6 +33,7 @@ module ram_reader (
  14. output p_rd_clk;
  15. output reg p_rd_en;
  16. input [31:0] p_rd_data;
  17. + input p_rd_empty;
  18.  
  19. // contents of the address
  20. output reg [31:0] data_out;
  21. @@ -107,8 +109,11 @@ module ram_reader (
  22. // bring en low again
  23. p_cmd_en <= 1'b0;
  24.  
  25. - // now we're done
  26. - cur_state <= S_READ_ENABLE;
  27. + // wait for data
  28. + if(p_rd_empty)
  29. + cur_state <= S_SEND_CMD_DONE;
  30. + else
  31. + cur_state <= S_READ_ENABLE;
  32. end
  33.  
  34. // bring up the write enable line
  35. diff --git a/fpga/top.v b/fpga/top.v
  36. index 84bd8ea..fed98eb 100644
  37. --- a/fpga/top.v
  38. +++ b/fpga/top.v
  39. @@ -313,6 +313,7 @@ module top #
  40. .p_rd_clk(p3_rd_clk),
  41. .p_rd_en(c3_p3_rd_en),
  42. .p_rd_data(c3_p3_rd_data),
  43. + .p_rd_empty(c3_p3_rd_empty),
  44.  
  45. // output of the whatever memory address was read
  46. .data_out(data_out)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement