nios2_uc_onchip_memory2.v 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. //Legal Notice: (C)2020 Altera Corporation. All rights reserved. Your
  2. //use of Altera Corporation's design tools, logic functions and other
  3. //software and tools, and its AMPP partner logic functions, and any
  4. //output files any of the foregoing (including device programming or
  5. //simulation files), and any associated documentation or information are
  6. //expressly subject to the terms and conditions of the Altera Program
  7. //License Subscription Agreement or other applicable license agreement,
  8. //including, without limitation, that your use is for the sole purpose
  9. //of programming logic devices manufactured by Altera and sold by Altera
  10. //or its authorized distributors. Please refer to the applicable
  11. //agreement for further details.
  12. // synthesis translate_off
  13. `timescale 1ns / 1ps
  14. // synthesis translate_on
  15. // turn off superfluous verilog processor warnings
  16. // altera message_level Level1
  17. // altera message_off 10034 10035 10036 10037 10230 10240 10030
  18. module nios2_uc_onchip_memory2 (
  19. // inputs:
  20. address,
  21. byteenable,
  22. chipselect,
  23. clk,
  24. clken,
  25. freeze,
  26. reset,
  27. reset_req,
  28. write,
  29. writedata,
  30. // outputs:
  31. readdata
  32. )
  33. ;
  34. parameter INIT_FILE = "nios2_uc_onchip_memory2.hex";
  35. output [ 31: 0] readdata;
  36. input [ 15: 0] address;
  37. input [ 3: 0] byteenable;
  38. input chipselect;
  39. input clk;
  40. input clken;
  41. input freeze;
  42. input reset;
  43. input reset_req;
  44. input write;
  45. input [ 31: 0] writedata;
  46. wire clocken0;
  47. wire [ 31: 0] readdata;
  48. wire wren;
  49. assign wren = chipselect & write;
  50. assign clocken0 = clken & ~reset_req;
  51. altsyncram the_altsyncram
  52. (
  53. .address_a (address),
  54. .byteena_a (byteenable),
  55. .clock0 (clk),
  56. .clocken0 (clocken0),
  57. .data_a (writedata),
  58. .q_a (readdata),
  59. .wren_a (wren)
  60. );
  61. defparam the_altsyncram.byte_size = 8,
  62. the_altsyncram.init_file = INIT_FILE,
  63. the_altsyncram.lpm_type = "altsyncram",
  64. the_altsyncram.maximum_depth = 51200,
  65. the_altsyncram.numwords_a = 51200,
  66. the_altsyncram.operation_mode = "SINGLE_PORT",
  67. the_altsyncram.outdata_reg_a = "UNREGISTERED",
  68. the_altsyncram.ram_block_type = "AUTO",
  69. the_altsyncram.read_during_write_mode_mixed_ports = "DONT_CARE",
  70. the_altsyncram.read_during_write_mode_port_a = "DONT_CARE",
  71. the_altsyncram.width_a = 32,
  72. the_altsyncram.width_byteena_a = 4,
  73. the_altsyncram.widthad_a = 16;
  74. //s1, which is an e_avalon_slave
  75. //s2, which is an e_avalon_slave
  76. endmodule