`timescale 1 ns / 1 ps module core_tb(); localparam MEM_INST_LENGTH = 256; localparam MEM_DATA_LENGTH = 256; reg clk, reset; wire [31:0] mem_inst_addr; wire [31:0] mem_inst_idx = mem_inst_addr >> 2; reg [31:0] mem_inst_data; reg [31:0] mem_inst [0:MEM_INST_LENGTH-1]; reg [31:0] mem_data [0:MEM_DATA_LENGTH-1]; wire [31:0] mem_data_addr; wire [31:0] mem_data_wdata; reg [31:0] mem_data_rdata; wire mem_data_en; wire mem_data_we; reg mem_data_valid; reg mem_data_done; integer i; localparam OP_LUI = 7'b0110111, OP_AUIPC = 7'b0010111, OP_JAL = 7'b1101111, OP_JALR = 7'b1100111, OP_BRANCH = 7'b1100011, OP_LOAD = 7'b0000011, OP_STORE = 7'b0100011, OP_IMM = 7'b0010011, OP_ALU = 7'b0110011, OP_FENCE = 7'b0001111, OP_SYSTEM = 7'b1110011; localparam INST_NOP = {7'b0000000, 5'd0, 5'd0, 3'b000, 5'd0, OP_ALU}; // nop initial begin for (i=0; i