data/full_repos/permissive/115487336/mycode/Mips/MultiCycle-Mips/MEMmodule.v
1: b"%Error: data/full_repos/permissive/115487336/mycode/Mips/MultiCycle-Mips/MEMmodule.v:40: Cannot find file containing module: 'MEM'\nMEM u_MEM(\n^~~\n        ... Looked in:\n             data/full_repos/permissive/115487336/mycode/Mips/MultiCycle-Mips,data/full_repos/permissive/115487336/MEM\n             data/full_repos/permissive/115487336/mycode/Mips/MultiCycle-Mips,data/full_repos/permissive/115487336/MEM.v\n             data/full_repos/permissive/115487336/mycode/Mips/MultiCycle-Mips,data/full_repos/permissive/115487336/MEM.sv\n             MEM\n             MEM.v\n             MEM.sv\n             obj_dir/MEM\n             obj_dir/MEM.v\n             obj_dir/MEM.sv\n%Error: Exiting due to 1 error(s)\n"
module MEMmodule(
	input clk,
	input rst_n,
	
	input [31:0] pc,
	input [31:0] data_addr,
	input IorD,
	input [31:0] mem_wd,
	input WE,
	input IRWrite,
	output reg [31:0] now_Instr
);

wire [31:0] real_addr;
assign real_addr[31:30] = 2'b0;
assign real_addr[29:0] = IorD ? data_addr[31:2] :  pc[31:2];

wire [31:0] memout;

MEM u_MEM(
	clk,
	WE,
	real_addr,
	mem_wd,
	memout
);



reg [31:0] next_Instr;

always@(posedge clk or negedge rst_n)
begin
	if(~rst_n)
	begin
		now_Instr<=32'hCCCC_CCCC;
	end
	else
	begin
		now_Instr<=next_Instr;
	end
end

always@(*)
begin
	if(IRWrite)
		next_Instr=memout;
	else
		next_Instr=now_Instr;
end
endmodule
module MEMmodule(
	input clk,
	input rst_n,
	
	input [31:0] pc,
	input [31:0] data_addr,
	input IorD,
	input [31:0] mem_wd,
	input WE,
	input IRWrite,
	output reg [31:0] now_Instr
);


wire [31:0] real_addr;
assign real_addr[31:30] = 2'b0;
assign real_addr[29:0] = IorD ? data_addr[31:2] :  pc[31:2];

wire [31:0] memout;

MEM u_MEM(
	clk,
	WE,
	real_addr,
	mem_wd,
	memout
);



reg [31:0] next_Instr;

always@(posedge clk or negedge rst_n)
begin
	if(~rst_n)
	begin
		now_Instr<=32'hCCCC_CCCC;
	end
	else
	begin
		now_Instr<=next_Instr;
	end
end

always@(*)
begin
	if(IRWrite)
		next_Instr=memout;
	else
		next_Instr=now_Instr;
end
endmodule