질문&답변
simple_bram_ctrl.v에 true_dpbram.v를 instantiation 을 어떻게 해야 할까요?
제공해 주신 simple_bram_ctrl.v 마지막에 true_dpbram.v 를 instantiation 한 코드만 아래와 같이추가한 단순한 코드입니다. 전체 코드도 첨부 하였습니다. true_dpbram #( .DWIDTH (DWIDTH), .AWIDTH (AWIDTH), .MEM_SIZE (MEM_SIZE)) u_TDPBRAM( .clk (clk), .addr0 (addr0), .ce0 (ce0), .we0 (we0), .q0 (q0), .d0 (d0), // no use port B. .addr1 (0), .ce1 (0), .we1 (0), .q1 (), .d1 (0) ); ////////////////////////////////////////////////////////////////////////////////// // Company: Personal // Engineer: Matbi / Austin // // Create Date: 2021.01.31 // Design Name: // Module Name: simple_bram_ctrl // Project Name: // Target Devices: // Tool Versions: // Description: To study ctrl sram. (WRITE / READ) // FSM + mem I/F // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// `timescale 1ns / 1ps module simple_bram_ctrl // Param #( parameter DWIDTH = 16, parameter AWIDTH = 7, parameter MEM_SIZE = 128 ) ( input clk, input reset_n, input i_run, input [AWIDTH-1:0] i_num_cnt, output o_idle, output o_write, output o_read, output o_done, // Memory I/F output[AWIDTH-1:0] addr0, output ce0, output we0, input [DWIDTH-1:0] q0, output[DWIDTH-1:0] d0, // output read value from BRAM output o_valid, output[DWIDTH-1:0] o_mem_data ); /////// Local Param. to define state //////// localparam S_IDLE = 2'b00; localparam S_WRITE = 2'b01; localparam S_READ = 2'b10; localparam S_DONE = 2'b11; /////// Type //////// reg [1:0] c_state; // Current state (F/F) reg [1:0] n_state; // Next state (Variable in Combinational Logic) wire is_write_done; wire is_read_done; /////// Main //////// // Step 1. always block to update state always @(posedge clk or negedge reset_n) begin if(!reset_n) begin c_state
- 좋아요수
- 1
- 댓글수
- 2
- 조회수
- 763





